]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
sv_db_saveasdump and cl_db_saveasdump cvars
authorRudolf Polzer <divverent@alientrap.org>
Tue, 26 Oct 2010 18:58:26 +0000 (20:58 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 26 Oct 2010 18:58:26 +0000 (20:58 +0200)
defaultXonotic.cfg
qcsrc/client/Main.qc
qcsrc/server/g_world.qc

index 0ba520e135aefda888f97c0f42965804ecceb915..b89fdda7eade17330b48c422494d80c48b2ee4c8 100644 (file)
@@ -1990,3 +1990,7 @@ utf8_enable 1
 r_font_hinting 1
 r_font_disable_freetype 0
 r_font_size_snapping 2
+
+// database management
+set sv_db_saveasdump 0 "write server.db in dump format (loads slower, easier to read/parse)"
+set cl_db_saveasdump 0 "write client.db in dump format (loads slower, easier to read/parse)"
index 9ed7d92e3630a5c6e115c3c044ba98390f7b8fd7..9c50d7a3442d7fd36585ad836d26ced8ea07f6e6 100644 (file)
@@ -186,7 +186,10 @@ void CSQC_Shutdown(void)
        remove(players);
        db_close(binddb);
        db_close(tempdb);
-       db_save(ClientProgsDB, "client.db");
+       if(cvar("cl_db_saveasdump"))
+               db_dump(ClientProgsDB, "client.db");
+       else
+               db_save(ClientProgsDB, "client.db");
        db_close(ClientProgsDB);
 
        cvar_clientsettemp_restore();
index 6260d7e86d8f08a404afd3228908f70bdce1e774..73ae5605f0c713955d4e5e2760b12f20d41c5507 100644 (file)
@@ -2780,9 +2780,19 @@ void SV_Shutdown()
                print("Saving persistent data...\n");
                Ban_SaveBans();
                if(!cheatcount_total)
-                       db_save(ServerProgsDB, "server.db");
+               {
+                       if(cvar("sv_db_saveasdump"))
+                               db_dump(ServerProgsDB, "server.db");
+                       else
+                               db_save(ServerProgsDB, "server.db");
+               }
                if(cvar("developer"))
-                       db_save(TemporaryDB, "server-temp.db");
+               {
+                       if(cvar("sv_db_saveasdump"))
+                               db_dump(TemporaryDB, "server-temp.db");
+                       else
+                               db_save(TemporaryDB, "server-temp.db");
+               }
                CheatShutdown(); // must be after cheatcount check
                db_close(ServerProgsDB);
                db_close(TemporaryDB);