Thread: [Gcblue-commits] gcb_wx/include/network tcConnectionData.h,1.9,1.10 tcControlMessageHandler.h,1.7,1.
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-04-29 18:52:12
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27186/include/network Modified Files: tcConnectionData.h tcControlMessageHandler.h tcMultiplayerInterface.h tcUpdateMessageHandler.h Log Message: Index: tcUpdateMessageHandler.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcUpdateMessageHandler.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcUpdateMessageHandler.h 8 May 2004 21:25:25 -0000 1.6 --- tcUpdateMessageHandler.h 29 Apr 2005 18:52:02 -0000 1.7 *************** *** 58,66 **** COMMAND_ACK = 4, ///< ack of command-related update DESTROY = 5, ///< destroys game obj ! SENSOR_UPDATE = 6 ///< update of sensor map tracks }; static void AddCommandAck(tcGameObject* obj, tcCommandStream& stream); static void AddCommandUpdate(tcGameObject* obj, tcCommandStream& stream); static void AddCreate(tcGameObject* obj, tcCreateStream& stream); static void AddCreateRequest(long id, tcStream& stream); --- 58,68 ---- COMMAND_ACK = 4, ///< ack of command-related update DESTROY = 5, ///< destroys game obj ! SENSOR_UPDATE = 6, ///< update of sensor map tracks ! CONTROL_REQUEST = 7 ///< request to take control of obj }; static void AddCommandAck(tcGameObject* obj, tcCommandStream& stream); static void AddCommandUpdate(tcGameObject* obj, tcCommandStream& stream); + static void AddControlRequest(long id, tcStream& stream); static void AddCreate(tcGameObject* obj, tcCreateStream& stream); static void AddCreateRequest(long id, tcStream& stream); *************** *** 75,78 **** --- 77,81 ---- void HandleCommandAck(tcCommandStream& stream); ///< command ack void HandleCommandUpdate(tcCommandStream& stream, int connectionId); ///< command update + void HandleControlRequest(tcStream& stream, int connectionId); void HandleCreate(tcCreateStream& stream); void HandleCreateRequest(tcStream& stream, int connectionId); Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMultiplayerInterface.h 17 Apr 2005 22:34:59 -0000 1.21 --- tcMultiplayerInterface.h 29 Apr 2005 18:52:02 -0000 1.22 *************** *** 34,38 **** #include <string> #include <vector> ! #define BEGIN_NAMESPACE(x) namespace x { --- 34,38 ---- #include <string> #include <vector> ! #include "tcAccountDatabase.h" #define BEGIN_NAMESPACE(x) namespace x { *************** *** 58,64 **** { public: ! std::string name; ///< handle for player bool isAuthenticated; ///< true if password has been verified ! int alliance; ///< player's alliance unsigned int timestamp; ///< time of last network update (30 Hz tics) unsigned int startTime; ///< time connection started (30 Hz tics) --- 58,66 ---- { public: ! std::string name; ///< username of player ! std::string nameWithRank; ///< name with rank title bool isAuthenticated; ///< true if password has been verified ! unsigned char alliance; ///< player's alliance ! unsigned char rank; ///< player's rank unsigned int timestamp; ///< time of last network update (30 Hz tics) unsigned int startTime; ///< time connection started (30 Hz tics) *************** *** 67,73 **** --- 69,88 ---- float ping_s; ///< value of last ping std::map<long, unsigned int> lastUpdate; ///< map of (obj id, update time (30Hz tics)) + tcAccountDatabase::UserData data; ///< local copy of account database entry (messy, merge or otherwise fix this) + int connectionId; void EraseEntry(long id); + unsigned char GetAlliance() const; + int GetConnectionId() const; bool GetLastUpdate(long id, unsigned int& updateTime); + const std::string& GetName() const; + const std::string& GetNameWithRank() const; + unsigned char GetRank() const; + bool IsGM() const; + void SetAlliance(unsigned char val); + void SetConnectionId(int id); + void SetName(const std::string& s); + void SetNameWithRank(const std::string& s); + void SetRank(unsigned char val); void SetUpdate(long id, unsigned int updateTime); }; *************** *** 109,117 **** const std::string& GetPassword() const; tcPlayerStatus& GetPlayerStatus(int connectionId); ///< redundant with GetConnectionStatus? void InitMessageHandlers(); bool IsChatTextAvail(); bool IsCommand(const std::string& text); bool IsServer(); ! int LogInPlayer(const std::string& username, int connectionId, wxString& msg); void LogOutAllPlayers(); void MakeClient(); --- 124,134 ---- const std::string& GetPassword() const; tcPlayerStatus& GetPlayerStatus(int connectionId); ///< redundant with GetConnectionStatus? + const std::string& GetPlayerName(int connectionId); void InitMessageHandlers(); bool IsChatTextAvail(); bool IsCommand(const std::string& text); bool IsServer(); ! int LogInPlayer(const std::string& username, int connectionId, ! tcPlayerStatus& playerStatus, wxString& msg); void LogOutAllPlayers(); void MakeClient(); *************** *** 128,133 **** --- 145,152 ---- void SendControlMessageUDP(int destination, int messageCode, int param = 0); void SendControlMessageUDPAck(int destination, int messageCode, int param = 0); + void SendControlRequest(long id); void SendTestUDP(int destination, const std::string& message); void SendUpdateMessage(int destination, tcStream& stream); + void SendUpdateMessageAck(int destination, tcStream& stream); void SetChatProtocol(int code); void SetEvtHandler(wxEvtHandler *eh); *************** *** 150,153 **** --- 169,173 ---- bool tcpChat; ///< true to use TCP for chat protocol, otherwise UDP tcPlayerStatus errorPlayerStatus; ///< status to return if player not found + tcPlayerStatus serverPlayerStatus; ///< status to use for server actions wxEvtHandler* evtHandler; ///< wxWidgets event handler for posting messages to application const unsigned int entityUpdateInterval; ///< 30 Hz tics *************** *** 157,160 **** --- 177,183 ---- void DistributeChatText(); bool IsNewPlayer(int id); + + void ProcessAllianceCommand(tcPlayerStatus& player, const wxString& args); + void ProcessGameMasterCommand(tcPlayerStatus& player, const wxString& args); void ProcessMessage(int messageId, int connectionId, unsigned messageSize, const unsigned char *data); Index: tcControlMessageHandler.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcControlMessageHandler.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcControlMessageHandler.h 16 Apr 2005 20:43:55 -0000 1.7 --- tcControlMessageHandler.h 29 Apr 2005 18:52:02 -0000 1.8 *************** *** 48,52 **** { CM_BEEP = 1, - CM_STARTGAME = 2, CM_TIME = 3, ///< time message also includes time acceleratin/pause state CM_ALLIANCE = 4, --- 48,51 ---- Index: tcConnectionData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcConnectionData.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcConnectionData.h 17 Apr 2005 22:34:59 -0000 1.9 --- tcConnectionData.h 29 Apr 2005 18:52:02 -0000 1.10 *************** *** 68,71 **** --- 68,72 ---- const wxIPV4address& GetPeerAddress() const; unsigned long GetReadCount() const; + unsigned int GetResentCount() const; wxSocketBase* GetSocket(); unsigned long GetWriteCount() const; *************** *** 99,102 **** --- 100,104 ---- unsigned int lastCountUpdate; unsigned int lastResendUpdate; + unsigned int resentCount; ///< number of packets resent because of ack timeout void AttachAckRider(tcMessage* message); |