18#ifndef INCLUDED_NETCLIENTTURNMANAGER
19#define INCLUDED_NETCLIENTTURNMANAGER
26#include <js/TypeDecls.h>
51 void OnSyncError(
turn_id_t turn,
const CStr& expectedHash,
const std::vector<CSyncErrorMessage::S_m_PlayerNames>& playerNames);
std::int32_t turn_id_t
At 1000 turns/second, a 32-bit counter would overflow in ~49 days.
Definition: SimulationCommand.h:31
Implementation of CTurnManager for network clients.
Definition: NetClientTurnManager.h:37
void PostCommand(JS::HandleValue data) override
Called by simulation code, to add a new command to be distributed to all clients and executed soon.
Definition: NetClientTurnManager.cpp:53
void OnSyncError(turn_id_t turn, const CStr &expectedHash, const std::vector< CSyncErrorMessage::S_m_PlayerNames > &playerNames)
Definition: NetClientTurnManager.cpp:116
void OnSimulationMessage(CSimulationMessage *msg) override
Called by networking code when a simulation message is received.
Definition: NetClientTurnManager.cpp:110
CNetClientTurnManager(CSimulation2 &simulation, CNetClient &client, int clientId, IReplayLogger &replay)
Definition: NetClientTurnManager.cpp:48
void OnDestroyConnection()
Notify the server that all commands are sent to prepare the connection for termination.
Definition: NetClientTurnManager.cpp:102
void NotifyFinishedUpdate(turn_id_t turn, const UpdateCallback &sendEventToAll) override
Called when this client has finished a simulation update.
Definition: NetClientTurnManager.cpp:82
void NotifyFinishedOwnCommands(turn_id_t turn) override
Called when this client has finished sending all its commands scheduled for the given turn.
Definition: NetClientTurnManager.cpp:66
NONCOPYABLE(CNetClientTurnManager)
CNetClient & m_NetClient
Definition: NetClientTurnManager.h:58
Network client.
Definition: NetClient.h:73
Public API for simulation system.
Definition: Simulation2.h:57
Special message type for simulation commands.
Definition: NetMessage.h:123
Common turn system (used by clients and offline games).
Definition: TurnManager.h:88
std::function< void(const std::string &, const std::optional< JS::HandleValueArray >)> UpdateCallback
Definition: TurnManager.h:92
Replay log recorder interface.
Definition: Replay.h:40