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

Merge branch 'vcmi/master' into 'vcmi/develop'

This commit is contained in:
Ivan Savenko
2024-05-31 09:34:21 +00:00
166 changed files with 2893 additions and 1363 deletions

View File

@@ -12,6 +12,7 @@
#include "StartInfo.h"
#include "NetPacksBase.h"
#include "../MetaString.h"
#include "../serializer/ESerializationVersion.h"
class CServerHandler;
class CVCMIServer;
@@ -42,6 +43,7 @@ struct DLL_LINKAGE LobbyClientConnected : public CLobbyPackToPropagate
// Changed by server before announcing pack
int clientId = -1;
int hostClientId = -1;
ESerializationVersion version = ESerializationVersion::CURRENT;
void visitTyped(ICPackVisitor & visitor) override;
@@ -53,6 +55,18 @@ struct DLL_LINKAGE LobbyClientConnected : public CLobbyPackToPropagate
h & clientId;
h & hostClientId;
try
{
if (h.version >= Handler::Version::RELEASE_152)
h & version;
else
version = ESerializationVersion::RELEASE_150;
}
catch (const std::runtime_error & e)
{
version = ESerializationVersion::RELEASE_150;
}
}
};