]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
delay quit_and_redirect by a timer
authorRudolf Polzer <divverent@alientrap.org>
Thu, 23 Feb 2012 19:18:27 +0000 (20:18 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 23 Feb 2012 19:18:27 +0000 (20:18 +0100)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/g_world.qc

index d9db20f19cc65f906a8a38d6be9e507e9d179a8b..e4899175eba72fe36d90ce2ff26ac9aa465ca3a4 100644 (file)
@@ -1029,6 +1029,7 @@ set nextmap ""    "override the maplist when switching to the next map"
 set lastlevel ""
 set quit_when_empty 0  "set to 1, then the server exits when the next level would start but is empty"
 set quit_and_redirect ""       "set to an IP to redirect all players at the end of the match to another server. Set to \"self\" to let all players reconnect at the end of the match (use it to make seamless engine updates)"
+set quit_and_redirect_timer 1.5 "set to number of seconds after quit before performing the connect operation of quit_and_redirect"
 
 // singleplayer campaign
 set g_campaign 0
@@ -1928,4 +1929,4 @@ if_dedicated set g_start_delay 15 "delay before the game starts, so everyone can
 alias menu_sync "menu_cmd sync"
 
 set sv_join_notices ""
-set sv_join_notices_time 15
\ No newline at end of file
+set sv_join_notices_time 15
index e336efc538db42d1d1f737b96713047762903fe5..e32fa17f6ee2ef5f006b0bc4a490b567f1de61f6 100644 (file)
@@ -1052,6 +1052,7 @@ float autocvar_minplayers;
 string autocvar_nextmap;
 float autocvar_prvm_backtraceforwarnings;
 string autocvar_quit_and_redirect;
+float autocvar_quit_and_redirect_timer;
 float autocvar_quit_when_empty;
 float autocvar_r_showbboxes;
 float autocvar_rescan_pending;
index bd49365a625fd8588642fa9c93826fbd06f04dac..289f07fa7d51f64e304f27cad2c9cc8d395bcc11 100644 (file)
@@ -2860,11 +2860,12 @@ float RedirectionThink()
        clients_found = 0;
        FOR_EACH_REALCLIENT(self)
        {
+               // TODO add timer
                print("Redirecting: sending connect command to ", self.netname, "\n");
                if(redirection_target == "self")
-                       stuffcmd(self, "\ndisconnect; reconnect\n");
+                       stuffcmd(self, "\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " reconnect\n");
                else
-                       stuffcmd(self, strcat("\ndisconnect; connect ", redirection_target, "\n"));
+                       stuffcmd(self, strcat("\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " \"connect ", redirection_target, "\"\n"));
                ++clients_found;
        }