Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetClientTurnManager.h
Show All 13 Lines | |||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_NETCLIENTTURNMANAGER | #ifndef INCLUDED_NETCLIENTTURNMANAGER | ||||
#define INCLUDED_NETCLIENTTURNMANAGER | #define INCLUDED_NETCLIENTTURNMANAGER | ||||
#include "simulation2/system/TurnManager.h" | #include "simulation2/system/TurnManager.h" | ||||
#include "NetMessage.h" | #include "NetMessages.h" | ||||
class CNetClient; | class CNetClient; | ||||
/** | /** | ||||
* Implementation of CTurnManager for network clients. | * Implementation of CTurnManager for network clients. | ||||
*/ | */ | ||||
class CNetClientTurnManager : public CTurnManager | class CNetClientTurnManager : public CTurnManager | ||||
{ | { | ||||
NONCOPYABLE(CNetClientTurnManager); | NONCOPYABLE(CNetClientTurnManager); | ||||
public: | public: | ||||
CNetClientTurnManager(CSimulation2& simulation, CNetClient& client, int clientId, IReplayLogger& replay); | CNetClientTurnManager(CSimulation2& simulation, CNetClient& client, int clientId, IReplayLogger& replay); | ||||
void OnSimulationMessage(CSimulationMessage* msg) override; | void OnSimulationMessage(CSimulationMessage* msg) override; | ||||
void PostCommand(JS::HandleValue data) override; | void PostCommand(JS::HandleValue data) override; | ||||
/** | /** | ||||
* Notify the server that all commands are sent to prepare the connection for termination. | * Notify the server that all commands are sent to prepare the connection for termination. | ||||
*/ | */ | ||||
void OnDestroyConnection(); | void OnDestroyConnection(); | ||||
void OnSyncError(u32 turn, const CStr& expectedHash, const std::vector<CSyncErrorMessage::S_m_PlayerNames>& playerNames); | void OnSyncError(u32 turn, const CStr& expectedHash, const std::vector<CStrW>& playerNames); | ||||
private: | private: | ||||
void NotifyFinishedOwnCommands(u32 turn) override; | void NotifyFinishedOwnCommands(u32 turn) override; | ||||
void NotifyFinishedUpdate(u32 turn) override; | void NotifyFinishedUpdate(u32 turn) override; | ||||
CNetClient& m_NetClient; | CNetClient& m_NetClient; | ||||
}; | }; | ||||
#endif // INCLUDED_NETCLIENTTURNMANAGER | #endif // INCLUDED_NETCLIENTTURNMANAGER |
Wildfire Games · Phabricator