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:
@@ -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()
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user