mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Multiplayer saved games
Enables to save multiplayer games. When the savegame is loaded, the settings are frozen (except the non-AI-player assignment settings).
This commit is contained in:
@@ -237,6 +237,8 @@ public:
|
||||
|
||||
void SendStartGameMessage(const CStr& initAttribs);
|
||||
|
||||
void SendStartSavedGameMessage(const CStr& initAttribs, const CStr& savedState);
|
||||
|
||||
/**
|
||||
* Call when the client (player or observer) has sent a flare.
|
||||
*/
|
||||
@@ -283,6 +285,7 @@ private:
|
||||
static bool OnPlayerAssignment(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnInGame(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnGameStart(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnSavedGameStart(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnJoinSyncStart(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnJoinSyncEndCommandBatch(CNetClient* client, CFsmEvent* event);
|
||||
static bool OnFlare(CNetClient* client, CFsmEvent* event);
|
||||
@@ -299,6 +302,12 @@ private:
|
||||
*/
|
||||
void SetAndOwnSession(CNetClientSession* session);
|
||||
|
||||
/**
|
||||
* Starts a game with the specified init attributes and saved state. Called
|
||||
* by the start game and start saved game callbacks.
|
||||
*/
|
||||
void StartGame(const JS::MutableHandleValue initAttributes, const std::string& savedState);
|
||||
|
||||
/**
|
||||
* Push a message onto the GUI queue listing the current player assignments.
|
||||
*/
|
||||
@@ -349,6 +358,8 @@ private:
|
||||
/// Serialized game state received when joining an in-progress game
|
||||
std::string m_JoinSyncBuffer;
|
||||
|
||||
std::string m_SavedState;
|
||||
|
||||
/// Time when the server was last checked for timeouts and bad latency
|
||||
std::time_t m_LastConnectionCheck;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user