diff --git a/binaries/system/readme.txt b/binaries/system/readme.txt index b971defd84..8c227ef204 100644 --- a/binaries/system/readme.txt +++ b/binaries/system/readme.txt @@ -41,6 +41,10 @@ Advanced / diagnostic: PATH is system path to commands.txt containing simulation log -writableRoot store runtime game data in root data directory (only use if you have write permissions on that directory) +-ooslog dumps simulation state in binary and ASCII representation each turn. + NOTE: game will run much slower with this option! +-serializationtest checks simulation state each turn for serialization errors. + NOTE: game will run much slower with this option! Windows-specific: -wQpcTscSafe allow timing via QueryPerformanceCounter despite the fact diff --git a/source/ps/GameSetup/Config.cpp b/source/ps/GameSetup/Config.cpp index b510daef0e..052563a053 100644 --- a/source/ps/GameSetup/Config.cpp +++ b/source/ps/GameSetup/Config.cpp @@ -191,6 +191,12 @@ static void ProcessCommandLineArgs(const CmdLineArgs& args) if (args.Has("vsync")) g_ConfigDB.CreateValue(CFG_COMMAND, "vsync")->m_String = "true"; + + if (args.Has("ooslog")) + g_ConfigDB.CreateValue(CFG_COMMAND, "ooslog")->m_String = "true"; + + if (args.Has("serializationtest")) + g_ConfigDB.CreateValue(CFG_COMMAND, "serializationtest")->m_String = "true"; } diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 6a99b8a42b..cd22a268af 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -33,6 +33,7 @@ #include "lib/file/vfs/vfs_util.h" #include "maths/MathUtil.h" #include "ps/CLogger.h" +#include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Loader.h" #include "ps/Profile.h" @@ -68,8 +69,8 @@ public: RegisterFileReloadFunc(ReloadChangedFileCB, this); -// m_EnableOOSLog = true; // TODO: this should be a command-line flag or similar -// m_EnableSerializationTest = true; // TODO: this should too + CFG_GET_USER_VAL("ooslog", Bool, m_EnableOOSLog); + CFG_GET_USER_VAL("serializationtest", Bool, m_EnableSerializationTest); } ~CSimulation2Impl()