[Gcblue-commits] gcb_wx/include/network tcMultiplayerInterface.h,1.22,1.23 tcUpdateMessageHandler.h,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-05-05 02:14:29
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv722/include/network Modified Files: tcMultiplayerInterface.h tcUpdateMessageHandler.h Log Message: Index: tcUpdateMessageHandler.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcUpdateMessageHandler.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcUpdateMessageHandler.h 29 Apr 2005 18:52:02 -0000 1.7 --- tcUpdateMessageHandler.h 5 May 2005 02:14:19 -0000 1.8 *************** *** 59,67 **** 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); --- 59,70 ---- DESTROY = 5, ///< destroys game obj SENSOR_UPDATE = 6, ///< update of sensor map tracks ! CONTROL_REQUEST = 7, ///< request to take control of obj ! SOUND_EFFECT = 8, ///< play sound effect for object ! SCRIPT_COMMANDS = 9 ///< script commands to execute on server }; static void AddCommandAck(tcGameObject* obj, tcCommandStream& stream); static void AddCommandUpdate(tcGameObject* obj, tcCommandStream& stream); + static void AddControlRelease(long id, tcStream& stream); static void AddControlRequest(long id, tcStream& stream); static void AddCreate(tcGameObject* obj, tcCreateStream& stream); *************** *** 69,72 **** --- 72,76 ---- static void AddDestroy(long id, tcStream& stream); static void AddSensorUpdateHeader(long alliance, tcStream& stream); + static void AddSoundEffect(long id, const std::string& effect, tcStream& stream); static void AddUpdate(tcGameObject* obj, tcUpdateStream& stream); *************** *** 81,85 **** --- 85,91 ---- void HandleCreateRequest(tcStream& stream, int connectionId); void HandleDestroy(tcStream& stream); + void HandleScriptCommands(tcStream& stream, int connectionId); void HandleSensorUpdate(tcUpdateStream& stream); + void HandleSoundEffect(tcStream& stream); void HandleUpdate(tcUpdateStream& stream, int connectionId); Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcMultiplayerInterface.h 29 Apr 2005 18:52:02 -0000 1.22 --- tcMultiplayerInterface.h 5 May 2005 02:14:19 -0000 1.23 *************** *** 131,134 **** --- 131,135 ---- int LogInPlayer(const std::string& username, int connectionId, tcPlayerStatus& playerStatus, wxString& msg); + void LogOutPlayer(const std::string& username); void LogOutAllPlayers(); void MakeClient(); *************** *** 145,149 **** --- 146,153 ---- void SendControlMessageUDP(int destination, int messageCode, int param = 0); void SendControlMessageUDPAck(int destination, int messageCode, int param = 0); + void SendControlRelease(long id); void SendControlRequest(long id); + void SendSoundEffect(const std::string& player, const std::string& effect, long id = -1); + void SendSoundEffect(int destination, const std::string& effect, long id = -1); void SendTestUDP(int destination, const std::string& message); void SendUpdateMessage(int destination, tcStream& stream); *************** *** 165,169 **** std::string myName; ///< name to identify player (username) std::string passwordHash; ///< hashed password ! std::map<int, tcPlayerStatus> playerInfo; ///< map of (connection id, tcPlayerStatus) pairs std::map<int, std::vector<tcMessageHandler*> > messageMap; ///< map of (message id, message handler vector) pairs bool tcpChat; ///< true to use TCP for chat protocol, otherwise UDP --- 169,174 ---- std::string myName; ///< name to identify player (username) std::string passwordHash; ///< hashed password ! std::map<int, tcPlayerStatus> playerInfo; ///< map of (connection id, tcPlayerStatus) pairs ! std::map<std::string, int> playerToConnection; ///< map of (player name, connection id) std::map<int, std::vector<tcMessageHandler*> > messageMap; ///< map of (message id, message handler vector) pairs bool tcpChat; ///< true to use TCP for chat protocol, otherwise UDP *************** *** 176,183 **** --- 181,192 ---- void ClearMessageMap(); void DistributeChatText(); + int GetPlayerConnectionId(const std::string& playerName); bool IsNewPlayer(int id); void ProcessAllianceCommand(tcPlayerStatus& player, const wxString& args); void ProcessGameMasterCommand(tcPlayerStatus& player, const wxString& args); + void ProcessGMAddAccount(const wxString& args, wxString& msg); + void ProcessGMCreate(const wxString& args, wxString& msg); + void ProcessGMMove(const wxString& args, wxString& msg); void ProcessMessage(int messageId, int connectionId, unsigned messageSize, const unsigned char *data); *************** *** 190,193 **** --- 199,203 ---- void UpdatePing(); void UpdatePlayerInfo(); + void UpdateScriptCommands(int connectionId); void UpdateSensorMaps(); void UpdateSensorMap(int connectionId); |