From fce5298884e994eae20ae56b292129eb3cacee65 Mon Sep 17 00:00:00 2001 From: z411 Date: Thu, 2 Dec 2021 23:56:46 -0300 Subject: [PATCH] Remove sv_ready_restart as this command superseedes it --- qcsrc/server/command/cmd.qc | 33 +++++++++++--------------- qcsrc/server/command/cmd.qh | 2 -- qcsrc/server/command/vote.qc | 45 +++++++++++------------------------- qcsrc/server/command/vote.qh | 2 -- qcsrc/server/world.qc | 1 - xonotic-server.cfg | 2 -- 6 files changed, 27 insertions(+), 58 deletions(-) diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index a8a8747e1..7241b7415 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -374,32 +374,25 @@ void ClientCommand_ready(entity caller, int request) // todo: anti-spam for tog { if (IS_CLIENT(caller)) { - if (warmup_stage || autocvar_sv_ready_restart || g_race_qualifying == 2) + if (warmup_stage || g_race_qualifying == 2) { - if (!readyrestart_happened || autocvar_sv_ready_restart_repeatable) + if (time < game_starttime) // game is already restarting + return; + if (caller.ready) // toggle { - if (time < game_starttime) // game is already restarting - return; - if (caller.ready) // toggle - { - caller.ready = false; - if(IS_PLAYER(caller) || caller.caplayer == 1) - bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); - } - else - { - caller.ready = true; - if(IS_PLAYER(caller) || caller.caplayer == 1) - bprint(playername(caller.netname, caller.team, false), "^2 is ready\n"); - } - - // cannot reset the game while a timeout is active! - if (!timeout_status) ReadyCount(); + caller.ready = false; + if(IS_PLAYER(caller) || caller.caplayer == 1) + bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); } else { - sprint(caller, "^1Game has already been restarted\n"); + caller.ready = true; + if(IS_PLAYER(caller) || caller.caplayer == 1) + bprint(playername(caller.netname, caller.team, false), "^2 is ready\n"); } + + // cannot reset the game while a timeout is active! + if (!timeout_status) ReadyCount(); } } return; // never fall through to usage diff --git a/qcsrc/server/command/cmd.qh b/qcsrc/server/command/cmd.qh index f2f721571..802afc8bd 100644 --- a/qcsrc/server/command/cmd.qh +++ b/qcsrc/server/command/cmd.qh @@ -2,8 +2,6 @@ float autocvar_sv_clientcommand_antispam_time; int autocvar_sv_clientcommand_antispam_count; -bool autocvar_sv_ready_restart; -bool autocvar_sv_ready_restart_repeatable; .float cmd_floodtime; .float cmd_floodcount; diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index ec8011a8f..695d8842e 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -390,25 +390,16 @@ void reset_map(bool dorespawn) { if (!MUTATOR_CALLHOOK(reset_map_players)) { - //if (restart_mapalreadyrestarted || (time < game_starttime)) - //{ - FOREACH_CLIENT(IS_PLAYER(it), - { - /* - only reset players if a restart countdown is active - this can either be due to cvar sv_ready_restart_after_countdown having set - restart_mapalreadyrestarted to 1 after the countdown ended or when - sv_ready_restart_after_countdown is not used and countdown is still running - */ - // PlayerScore_Clear(it); - CS(it).killcount = 0; - // stop the player from moving so that he stands still once he gets respawned - it.velocity = '0 0 0'; - it.avelocity = '0 0 0'; - CS(it).movement = '0 0 0'; - PutClientInServer(it); - }); - //} + FOREACH_CLIENT(IS_PLAYER(it), + { + // PlayerScore_Clear(it); + CS(it).killcount = 0; + // stop the player from moving so that he stands still once he gets respawned + it.velocity = '0 0 0'; + it.avelocity = '0 0 0'; + CS(it).movement = '0 0 0'; + PutClientInServer(it); + }); } } } @@ -416,7 +407,6 @@ void reset_map(bool dorespawn) // Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set) void ReadyRestart_think(entity this) { - restart_mapalreadyrestarted = true; reset_map(true); Score_ClearAll(); delete(this); @@ -437,15 +427,10 @@ void ReadyRestart_force() cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime))); checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0; - if(warmup_stage) { - // Warmup: No countdown in warmup - game_starttime = time; - readyrestart_happened = false; - } else { - // Go into match mode - readyrestart_happened = true; - game_starttime = time + RESTART_COUNTDOWN; - } + if(warmup_stage) + game_starttime = time; // Warmup: No countdown in warmup + else + game_starttime = time + RESTART_COUNTDOWN; // Go into match mode // clear player attributes FOREACH_CLIENT(IS_PLAYER(it), { @@ -455,8 +440,6 @@ void ReadyRestart_force() PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, -val); }); - restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use - // disable the warmup global for the server if(!warmup_stage) localcmd("\nsv_hook_warmupend\n"); diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index 4dfd9e857..843d59618 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -63,8 +63,6 @@ void VoteCommand(int request, entity caller, int argc, string vote_command); const float RESTART_COUNTDOWN = 10; entity nagger; float readycount; // amount of players who are ready -float readyrestart_happened; // keeps track of whether a restart has already happened -float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed .float ready; // flag for if a player is ready .int team_saved; // team number to restore upon map reset .void(entity this) reset; // if set, an entity is reset using this diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index e2f2fd32b..00733e809 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -493,7 +493,6 @@ void cvar_changes_init() BADCVAR("sv_maxrate"); BADCVAR("sv_motd"); BADCVAR("sv_public"); - BADCVAR("sv_ready_restart"); BADCVAR("sv_showfps"); BADCVAR("sv_status_privacy"); BADCVAR("sv_taunt"); diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 1634c256c..f6a4b6256 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -15,9 +15,7 @@ set minplayers 0 "fill server with bots to reach this number of players in teaml set minplayers_per_team 0 "fill server with bots to reach this number of players per team (if bot_number is not enough)" // restart server if all players hit "ready"-button -set sv_ready_restart 0 "allow a map to be restarted once all players pressed the \"ready\" button" set sv_ready_restart_after_countdown 0 "reset players and map items after the countdown ended, instead of at the beginning of the countdown" -set sv_ready_restart_repeatable 0 "allows the players to restart the game as often as needed" alias sv_hook_readyrestart -- 2.39.2