X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fsv_cmd.qc;h=d1946b63660904b88307787d36baeeabe9e24995;hb=f2b27d4b960a11b7c0dd45dc4439edab40bcbfcb;hp=6ada1045168019e8589326922f29138afd823cba;hpb=f1cf1299b2a73cee53269f383119d2712413b32d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 6ada10451..d1946b636 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -161,7 +161,14 @@ void GameCommand_allready(int request) { case CMD_REQUEST_COMMAND: { - ReadyRestart(); + if(warmup_stage) + { + warmup_stage = 0; + ReadyRestart(); + } + else + LOG_INFO("Not in warmup."); + return; } @@ -184,8 +191,7 @@ void GameCommand_allspec(int request, int argc) string reason = argv(1); int n = 0; FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { - if (it.caplayer) it.caplayer = 0; - PutObserverInServer(it); + PutObserverInServer(it, true); ++n; }); if (n) bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n")); @@ -745,7 +751,7 @@ void GameCommand_gametype(int request, int argc) } else { - bprint("Game type switch to ", s, " failed: this type does not exist!\n"); + bprint("Failed to switch to ", s, ": this game type does not exist!\n"); } return; @@ -1009,8 +1015,7 @@ void GameCommand_moveplayer(int request, int argc) string pl_name = playername(client.netname, client.team, false); if (!IS_SPEC(client) && !IS_OBSERVER(client)) { - if (client.caplayer) client.caplayer = 0; - PutObserverInServer(client); + PutObserverInServer(client, true); successful = strcat(successful, (successful ? ", " : ""), pl_name); } @@ -1302,6 +1307,27 @@ void GameCommand_shuffleteams(int request) } } +void GameCommand_srestart(int request) +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + warmup_stage = cvar("g_warmup"); + ReadyRestart(); + return; + } + + default: + case CMD_REQUEST_USAGE: + { + LOG_HELP("Usage:^3 sv_cmd srestart"); + LOG_HELP(" No arguments required."); + return; + } + } +} + void GameCommand_stuffto(int request, int argc) { // This... is a fairly dangerous and powerful command... - It allows any arguments to be sent to a client via rcon. @@ -1623,7 +1649,7 @@ void GameCommand_(int request) // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;) SERVER_COMMAND(adminmsg, "Send an admin message to a client directly") { GameCommand_adminmsg(request, arguments); } -SERVER_COMMAND(allready, "Restart the server and reset the players") { GameCommand_allready(request); } +SERVER_COMMAND(allready, "Ends warmup and starts the match") { GameCommand_allready(request); } SERVER_COMMAND(allspec, "Force all players to spectate") { GameCommand_allspec(request, arguments); } SERVER_COMMAND(anticheat, "Create an anticheat report for a client") { GameCommand_anticheat(request, arguments); } SERVER_COMMAND(animbench, "Benchmark model animation (LAGS)") { GameCommand_animbench(request, arguments); } @@ -1648,6 +1674,7 @@ SERVER_COMMAND(radarmap, "Generate a radar image of the map") { GameCommand_rada SERVER_COMMAND(reducematchtime, "Decrease the timelimit value incrementally") { GameCommand_reducematchtime(request); } SERVER_COMMAND(setbots, "Adjust how many bots are in the match") { GameCommand_setbots(request, arguments); } SERVER_COMMAND(shuffleteams, "Randomly move players to different teams") { GameCommand_shuffleteams(request); } +SERVER_COMMAND(srestart, "Soft restart the server and reset the players") { GameCommand_srestart(request); } SERVER_COMMAND(stuffto, "Send a command to be executed on a client") { GameCommand_stuffto(request, arguments); } SERVER_COMMAND(trace, "Various debugging tools with tracing") { GameCommand_trace(request, arguments); } SERVER_COMMAND(unlockteams, "Enable the ability for players to switch or enter teams") { GameCommand_unlockteams(request); }