Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetClientTurnManager.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | void CNetClientTurnManager::NotifyFinishedUpdate(u32 turn) | ||||
CSyncCheckMessage msg; | CSyncCheckMessage msg; | ||||
msg.m_Turn = turn; | msg.m_Turn = turn; | ||||
msg.m_Hash = hash; | msg.m_Hash = hash; | ||||
m_NetClient.SendMessage(&msg); | m_NetClient.SendMessage(&msg); | ||||
} | } | ||||
void CNetClientTurnManager::OnDestroyConnection() | void CNetClientTurnManager::OnDestroyConnection() | ||||
{ | { | ||||
// Attempt to flush messages before leaving. | |||||
// Notice the sending is not reliable and rarely makes it to the Server. | |||||
if (m_NetClient.GetCurrState() == NCS_INGAME) | |||||
NotifyFinishedOwnCommands(m_CurrentTurn + COMMAND_DELAY); | NotifyFinishedOwnCommands(m_CurrentTurn + COMMAND_DELAY); | ||||
} | } | ||||
void CNetClientTurnManager::OnSimulationMessage(CSimulationMessage* msg) | void CNetClientTurnManager::OnSimulationMessage(CSimulationMessage* msg) | ||||
{ | { | ||||
// Command received from the server - store it for later execution | // Command received from the server - store it for later execution | ||||
AddCommand(msg->m_Client, msg->m_Player, msg->m_Data, msg->m_Turn); | AddCommand(msg->m_Client, msg->m_Player, msg->m_Data, msg->m_Turn); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator