Ticket #2420: sendNetworkMessagesAtGameEnd_v2.patch
File sendNetworkMessagesAtGameEnd_v2.patch, 2.0 KB (added by , 10 years ago) |
---|
-
source/network/NetClient.cpp
144 144 145 145 void CNetClient::DestroyConnection() 146 146 { 147 // send network messages of current frame before connection get's destroyed 148 if (m_ClientTurnManager) 149 { 150 m_ClientTurnManager->OnDestroyConnection(); // end sending commands for scheduled turn 151 Flush(); // make sure the messages are send 152 } 147 153 SAFE_DELETE(m_Session); 148 154 } 149 155 -
source/network/NetTurnManager.cpp
419 419 m_NetClient.SendMessage(&msg); 420 420 } 421 421 422 void CNetClientTurnManager::OnDestroyConnection() 423 { 424 NotifyFinishedOwnCommands(m_CurrentTurn + COMMAND_DELAY); 425 } 426 422 427 void CNetClientTurnManager::OnSimulationMessage(CSimulationMessage* msg) 423 428 { 424 429 // Command received from the server - store it for later execution -
source/network/NetTurnManager.h
200 200 virtual void OnSimulationMessage(CSimulationMessage* msg); 201 201 202 202 virtual void PostCommand(CScriptValRooted data); 203 204 /** 205 * notifiy the server that all commands for the scheduled turn are send before the connection is destroyed 206 */ 207 void OnDestroyConnection(); 203 208 204 209 protected: 205 210 virtual void NotifyFinishedOwnCommands(u32 turn); -
source/ps/GameSetup/GameSetup.cpp
654 654 655 655 void EndGame() 656 656 { 657 SAFE_DELETE(g_NetClient); 657 658 SAFE_DELETE(g_NetServer); 658 SAFE_DELETE(g_NetClient);659 659 SAFE_DELETE(g_Game); 660 660 661 661 ISoundManager::CloseGame();