From: Rudolf Polzer Date: Thu, 23 Feb 2012 19:18:27 +0000 (+0100) Subject: delay quit_and_redirect by a timer X-Git-Tag: xonotic-v0.6.0~54 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bc338fedcc64d36c0537ac194d63f84c69a95e36;p=xonotic%2Fxonotic-data.pk3dir.git delay quit_and_redirect by a timer --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index d9db20f19..e4899175e 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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 diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index e336efc53..e32fa17f6 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index bd49365a6..289f07fa7 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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; }