1
0
forked from mirrors/0ad

Add an engine "compatible" version

When a patch version is released, it must declare compatibility with the
previous patch versions of the same main release. This allows players to
keep replaying their games and to keep playing online with users of
other patches of the same main release.

This should have anticipated for dae7a8c394
This commit is contained in:
Itms
2025-10-20 13:54:34 +02:00
parent 50f6da2a13
commit 866d6f0527
17 changed files with 81 additions and 34 deletions
+2 -2
View File
@@ -77,8 +77,8 @@ CLogger::CLogger(std::ostream& mainLog, std::ostream& interestingLog, const bool
m_InterestingLog{interestingLog},
m_UseDebugPrintf{useDebugPrintf}
{
m_MainLog << html_header0 << PYROGENESIS_VERSION << ") Main log" << html_header1;
m_InterestingLog << html_header0 << PYROGENESIS_VERSION << ") Main log (warnings and errors only)" << html_header1;
m_MainLog << html_header0 << PS_VERSION << ") Main log" << html_header1;
m_InterestingLog << html_header0 << PS_VERSION << ") Main log (warnings and errors only)" << html_header1;
}
CLogger::~CLogger()
+1 -1
View File
@@ -57,7 +57,7 @@ static void AppendAsciiFile(FILE* out, const OsPath& pathname)
void psBundleLogs(FILE* f)
{
fwprintf(f, L"Build Version: %ls\n\n", build_version);
fwprintf(f, L"Engine Version: %hs\n\n", PYROGENESIS_VERSION);
fwprintf(f, L"Engine Version: %hs\n\n", PS_VERSION);
fwprintf(f, L"System info:\n\n");
OsPath path1 = psLogDir()/"system_info.txt";
+1 -1
View File
@@ -80,7 +80,7 @@ void CReplayLogger::StartGame(JS::MutableHandleValue attribs)
Script::SetProperty(rq, attribs, "timestamp", (double)std::time(nullptr));
// Add engine version and currently loaded mods for sanity checks when replaying
Script::SetProperty(rq, attribs, "engine_version", PYROGENESIS_VERSION);
Script::SetProperty(rq, attribs, "engine_serialization_version", PS_SERIALIZATION_VERSION);
JS::RootedValue mods(rq.cx);
Script::ToJSVal(rq, &mods, g_Mods.GetEnabledModsData());
Script::SetProperty(rq, attribs, "mods", mods);
+2 -1
View File
@@ -112,7 +112,8 @@ Status SavedGames::Save(const CStrW& name, const CStrW& description, CSimulation
Script::CreateObject(
rq,
&metadata,
"engine_version", PYROGENESIS_VERSION,
"engine_version", PS_VERSION,
"engine_serialization_version", PS_SERIALIZATION_VERSION,
"time", static_cast<double>(now),
"playerID", g_Game->GetPlayerID(),
"mods", mods,
+1 -1
View File
@@ -61,7 +61,7 @@ const u8 minimumReplayDuration = 3;
OsPath VisualReplay::GetDirectoryPath()
{
return Paths(g_CmdLineArgs).UserData() / "replays" / PYROGENESIS_VERSION;
return Paths(g_CmdLineArgs).UserData() / "replays" / PS_SERIALIZATION_VERSION;
}
OsPath VisualReplay::GetCacheFilePath()
+2 -1
View File
@@ -135,7 +135,8 @@ JS::Value GetEngineInfo(const ScriptInterface& scriptInterface)
Script::CreateObject(
rq,
&metainfo,
"engine_version", PYROGENESIS_VERSION,
"engine_version", PS_VERSION,
"engine_serialization_version", PS_SERIALIZATION_VERSION,
"mods", mods);
Script::DeepFreezeObject(rq, metainfo);