- store CVARs non-destructively in savegames.

The old method using a single string with a backslash as separator is unable to handle anything with actual backslashes in the data.
It now uses a JSON object with each CVAR being a separate key.
This commit is contained in:
Christoph Oelckers 2020-01-12 12:59:08 +01:00
commit e3eae62af2
4 changed files with 52 additions and 6 deletions

View file

@ -1925,6 +1925,10 @@ void G_DoLoadGame ()
uint8_t *vars_p = (uint8_t *)cvar.GetChars();
C_ReadCVars(&vars_p);
}
else
{
C_SerializeCVars(arc, "servercvars", CVAR_SERVERINFO);
}
uint32_t time[2] = { 1,0 };
@ -2286,11 +2290,7 @@ void G_DoSaveGame (bool okForQuicksave, bool forceQuicksave, FString filename, c
// Intermission stats for hubs
G_SerializeHub(savegameglobals);
{
FString vars = C_GetMassCVarString(CVAR_SERVERINFO);
savegameglobals.AddString("importantcvars", vars.GetChars());
}
C_SerializeCVars(savegameglobals, "servercvars", CVAR_SERVERINFO);
if (level.time != 0 || level.maptime != 0)
{