1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge pull request #3609 from IvanSavenko/single_process

Allow running server as part of client process
This commit is contained in:
Ivan Savenko
2024-02-14 12:06:22 +02:00
committed by GitHub
39 changed files with 1203 additions and 1282 deletions

View File

@@ -36,6 +36,7 @@ VCMI_LIB_NAMESPACE_END
class CClient;
class CBaseForLobbyApply;
class GlobalLobbyClient;
class IServerRunner;
class HighScoreCalculation;
class HighScoreParameter;
@@ -100,17 +101,17 @@ class CServerHandler final : public IServerAPI, public LobbyInfo, public INetwor
std::shared_ptr<INetworkConnection> networkConnection;
std::unique_ptr<GlobalLobbyClient> lobbyClient;
std::unique_ptr<CApplier<CBaseForLobbyApply>> applier;
std::unique_ptr<IServerRunner> serverRunner;
std::shared_ptr<CMapInfo> mapToStart;
std::vector<std::string> localPlayerNames;
std::shared_ptr<HighScoreCalculation> highScoreCalc;
boost::thread threadRunLocalServer;
boost::thread threadNetwork;
std::atomic<EClientState> state;
void threadRunNetwork();
void threadRunServer(bool connectToLobby);
void waitForServerShutdown();
void sendLobbyPack(const CPackForLobby & pack) const override;