]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add a cvar "sessionid" to make progs.db unique across multiple servers using the...
authorRudolf Polzer <divverent@xonotic.org>
Tue, 1 Nov 2011 08:26:06 +0000 (09:26 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 1 Nov 2011 08:26:06 +0000 (09:26 +0100)
qcsrc/server/autocvars.qh
qcsrc/server/g_world.qc

index 21f21141e0e9871402d736805c23cd8416ca45b3..3a6e123e04b10bb6e29a33fc0ca14be74fedd14a 100644 (file)
@@ -1058,6 +1058,7 @@ float autocvar_quit_when_empty;
 float autocvar_r_showbboxes;
 float autocvar_rescan_pending;
 float autocvar_samelevel;
+string autocvar_sessionid;
 #define autocvar_skill cvar("skill")
 float autocvar_skill_auto;
 #define autocvar_slowmo cvar("slowmo")
index e139c6b975573faf0801eb5ec3fdf56a1f2852b9..1980047b06c8f744b07d7150da41bc724033765f 100644 (file)
@@ -643,7 +643,7 @@ void spawnfunc_worldspawn (void)
        // needs to be done so early as they would still spawn
        RegisterWeapons();
 
-       ServerProgsDB = db_load("server.db");
+       ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
        TemporaryDB = db_create();
 
@@ -2914,7 +2914,7 @@ void RestoreGame()
        // some things then break, so let's work around them...
 
        // Progs DB (capture records)
-       ServerProgsDB = db_load("server.db");
+       ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
        // Mapinfo
        MapInfo_Shutdown();
@@ -2948,9 +2948,9 @@ void SV_Shutdown()
                if(!cheatcount_total)
                {
                        if(autocvar_sv_db_saveasdump)
-                               db_dump(ServerProgsDB, "server.db");
+                               db_dump(ServerProgsDB, strcat("server.db", autocvar_sessionid));
                        else
-                               db_save(ServerProgsDB, "server.db");
+                               db_save(ServerProgsDB, strcat("server.db", autocvar_sessionid));
                }
                if(autocvar_developer)
                {