{
case CMD_REQUEST_COMMAND:
{
- sprint(self, cvar_changes);
+ print_to(self, cvar_changes);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 sv_cmd cvar_changes\n");
- sprint(self, " No arguments required.\n");
- //sprint(self, "See also: ^2cvar_purechanges^7\n");
+ print_to(self, "\nUsage:^3 sv_cmd cvar_changes\n");
+ print_to(self, " No arguments required.\n");
+ //print_to(self, "See also: ^2cvar_purechanges^7\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, cvar_purechanges);
+ print_to(self, cvar_purechanges);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 sv_cmd cvar_purechanges\n");
- sprint(self, " No arguments required.\n");
- //sprint(self, "See also: ^2cvar_changes^7\n");
+ print_to(self, "\nUsage:^3 sv_cmd cvar_purechanges\n");
+ print_to(self, " No arguments required.\n");
+ //print_to(self, "See also: ^2cvar_changes^7\n");
return;
}
}
if(command)
wordwrap_sprint(command, 1111); // why 1111?
else
- sprint(self, "ERROR: unsupported info command\n");
+ print_to(self, "ERROR: unsupported info command\n");
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd info request\n");
- sprint(self, " Where 'request' is the suffixed string appended onto the request for cvar.\n");
+ print_to(self, "\nUsage:^3 cmd info request\n");
+ print_to(self, " Where 'request' is the suffixed string appended onto the request for cvar.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, ladder_reply);
+ print_to(self, ladder_reply);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd ladder\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd ladder\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, lsmaps_reply);
+ print_to(self, lsmaps_reply);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd lsmaps\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd lsmaps\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, lsnewmaps_reply);
+ print_to(self, lsnewmaps_reply);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd lsnewmaps\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd lsnewmaps\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, maplist_reply);
+ print_to(self, maplist_reply);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd maplist\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd maplist\n");
+ print_to(self, " No arguments required.\n");
+ return;
+ }
+ }
+}
+
+void GameCommand_rankings(float request) // this is OLD.... jeez.
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ strunzone(rankings_reply);
+ rankings_reply = strzone(getrankings());
+ print(rankings_reply);
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 sv_cmd rankings\n");
+ print(" No arguments required.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- sprint(self, rankings_reply);
+ print_to(self, rankings_reply);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd rankings\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd rankings\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
float i;
for(i = 0; i < 10; ++i)
- sprint(self, records_reply[i]);
+ print_to(self, records_reply[i]);
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd records\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd records\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd teamstatus\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd teamstatus\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
if(autocvar_sv_timeout)
{
if (!timeoutStatus)
- return sprint(self, "^7Error: There is no active timeout which could be aborted!\n");
+ return print_to(self, "^7Error: There is no active timeout which could be aborted!\n");
if (self != timeoutInitiator)
- return sprint(self, "^7Error: You may not abort the active timeout. Only the player who called it can do that!\n");
+ return print_to(self, "^7Error: You may not abort the active timeout. Only the player who called it can do that!\n");
if (timeoutStatus == 1)
{
timeoutHandler.nextthink = time; //timeoutHandler has to take care of it immediately
}
else
- sprint(self, "^7Error: Your resumegame call was discarded!\n");
+ print_to(self, "^7Error: Your resumegame call was discarded!\n");
}
}
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd timein\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd timein\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
if(self.classname == "player")
{
if(votecalled)
- sprint(self, "^7Error: you can not call a timeout while a vote is active!\n");
+ print_to(self, "^7Error: you can not call a timeout while a vote is active!\n");
else
{
if (inWarmupStage && !g_warmup_allow_timeout)
- return sprint(self, "^7Error: You can not call a timeout in warmup-stage!\n");
+ return print_to(self, "^7Error: You can not call a timeout in warmup-stage!\n");
if (time < game_starttime )
- return sprint(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
+ return print_to(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
if (timeoutStatus != 2) {
//if the map uses a timelimit make sure that timeout cannot be called right before the map ends
lastPossibleTimeout = (myTl*60) - autocvar_sv_timeout_leadtime - 1;
if (lastPossibleTimeout < time - game_starttime)
- return sprint(self, "^7Error: It is too late to call a timeout now!\n");
+ return print_to(self, "^7Error: It is too late to call a timeout now!\n");
}
}
//player may not call a timeout if he has no calls left
if (self.allowedTimeouts < 1)
- return sprint(self, "^7Error: You already used all your timeout calls for this map!\n");
+ return print_to(self, "^7Error: You already used all your timeout calls for this map!\n");
//now all required checks are passed
}
}
else
- sprint(self, "^7Error: only players can call a timeout!\n");
+ print_to(self, "^7Error: only players can call a timeout!\n");
}
}
return; // never fall through to usage
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd timeout\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd timeout\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
entity tmp_player;
//string tmp_player_name;
- sprint(self, strcat("List of client information", (autocvar_sv_status_privacy ? " (some data is hidden for privacy)" : string_null), ":\n"));
- sprint(self, sprintf(" %-4s %-20s %-5s %-3s %-9s %-16s %s\n", "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
+ print_to(self, strcat("List of client information", (autocvar_sv_status_privacy ? " (some data is hidden for privacy)" : string_null), ":\n"));
+ print_to(self, sprintf(" %-4s %-20s %-5s %-3s %-9s %-16s %s\n", "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
FOR_EACH_CLIENT(tmp_player)
{
if(tmp_hours) { tmp_minutes -= (tmp_hours * 60); }
}
- sprint(self, sprintf(" %-4s %-20s %-5d %-3d %-9s %-16s %s\n",
+ print_to(self, sprintf(" %-4s %-20s %-5d %-3d %-9s %-16s %s\n",
strcat("#", ftos(num_for_edict(tmp_player))),
tmp_player.netname, //strcat(tmp_player_name, sprintf("%*s", (20 - strlen(strdecolorize(tmp_player_name))), "")),
tmp_player.ping, tmp_player.ping_packetloss,
++total_listed_players;
}
- sprint(self, strcat("Finished listing ", ftos(total_listed_players), " client(s). \n"));
+ print_to(self, strcat("Finished listing ", ftos(total_listed_players), " client(s). \n"));
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd who\n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd who\n");
+ print_to(self, " No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- sprint(self, "\nUsage:^3 cmd \n");
- sprint(self, " No arguments required.\n");
+ print_to(self, "\nUsage:^3 cmd \n");
+ print_to(self, " No arguments required.\n");
return;
}
}
}
}
-void GameCommand_cvar_changes(float request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- print(cvar_changes);
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd cvar_changes\n");
- print(" No arguments required.\n");
- print("See also: ^2cvar_purechanges^7\n");
- return;
- }
- }
-}
-
-void GameCommand_cvar_purechanges(float request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- print(cvar_purechanges);
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd cvar_purechanges\n");
- print(" No arguments required.\n");
- print("See also: ^2cvar_changes^7\n");
- return;
- }
- }
-}
-
void GameCommand_database(float request, float argc)
{
switch(request)
}
}
-void GameCommand_ladder(float request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- print(ladder_reply);
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd ladder\n");
- print(" No arguments required.\n");
- return;
- }
- }
-}
-
void GameCommand_lockteams(float request)
{
switch(request)
}
}
-void GameCommand_rankings(float request) // this is OLD.... jeez.
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- strunzone(rankings_reply);
- rankings_reply = strzone(getrankings());
- print(rankings_reply);
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd rankings\n");
- print(" No arguments required.\n");
- return;
- }
- }
-}
-
-void GameCommand_records(float request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- float i;
-
- for (i = 0; i < 10; ++i)
- print(records_reply[i]);
-
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd records\n");
- print(" No arguments required.\n");
- return;
- }
- }
-}
-
void GameCommand_reducematchtime(float request)
{
switch(request)
#endif
}
-void GameCommand_teamstatus(float request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- Score_NicePrint(world);
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 sv_cmd teamstatus\n");
- print(" No arguments required.\n");
- return;
- }
- }
-}
-
void GameCommand_time(float request)
{
switch(request)
SERVER_COMMAND("bbox", GameCommand_bbox(request), "Print detailed information about world size") \
SERVER_COMMAND("bot_cmd", GameCommand_bot_cmd(request, arguments), "Control and send commands to bots") \
SERVER_COMMAND("cointoss", GameCommand_cointoss(request, arguments), "Flip a virtual coin and give random result") \
- SERVER_COMMAND("cvar_changes", GameCommand_cvar_changes(request), "Prints a list of all changed server cvars") \
- SERVER_COMMAND("cvar_purechanges", GameCommand_cvar_purechanges(request), "Prints a list of all changed gameplay cvars") \
+ SERVER_COMMAND("cvar_changes", CommonCommand_cvar_changes(request), "Prints a list of all changed server cvars") \
+ SERVER_COMMAND("cvar_purechanges", CommonCommand_cvar_purechanges(request), "Prints a list of all changed gameplay cvars") \
SERVER_COMMAND("database", GameCommand_database(request, arguments), "Extra controls of the serverprogs database") \
SERVER_COMMAND("defer_clear", GameCommand_defer_clear(request, arguments), "Clear all queued defer commands for a specific client") \
SERVER_COMMAND("defer_clear_all", GameCommand_defer_clear_all(request), "Clear all queued defer commands for all clients") \
SERVER_COMMAND("gametype", GameCommand_gametype(request, arguments), "Simple command to change the active gametype") \
SERVER_COMMAND("gettaginfo", GameCommand_gettaginfo(request, arguments), "Get specific information about a weapon model") \
SERVER_COMMAND("gotomap", GameCommand_gotomap(request, arguments), "Simple command to switch to another map") \
- SERVER_COMMAND("ladder", GameCommand_ladder(request), "Get information about top players if supported") \
+ SERVER_COMMAND("info", CommonCommand_info(request, arguments), "todo") \
+ SERVER_COMMAND("ladder", CommonCommand_ladder(request), "Get information about top players if supported") \
SERVER_COMMAND("lockteams", GameCommand_lockteams(request), "Disable the ability for players to switch or enter teams") \
+ SERVER_COMMAND("lsmaps", CommonCommand_lsmaps(request), "List maps which can be used with the current game mode") \
+ SERVER_COMMAND("lsnewmaps", CommonCommand_lsnewmaps(request), "todo") \
SERVER_COMMAND("make_mapinfo", GameCommand_make_mapinfo(request), "Automatically rebuild mapinfo files") \
+ SERVER_COMMAND("maplist", CommonCommand_maplist(request), "Display full server maplist reply") \
SERVER_COMMAND("modelbug", GameCommand_modelbug(request), "TODO foobar") \
SERVER_COMMAND("moveplayer", GameCommand_moveplayer(request, arguments), "Change the team/status of a player") \
SERVER_COMMAND("nospectators", GameCommand_nospectators(request), "Automatically remove spectators from a match") \
SERVER_COMMAND("playerdemo", GameCommand_playerdemo(request, arguments), "Control the ability to save demos of players") \
SERVER_COMMAND("printstats", GameCommand_printstats(request), "TODO foobar") \
SERVER_COMMAND("radarmap", GameCommand_radarmap(request, arguments), "Generate a radar image of the map") \
- SERVER_COMMAND("rankings", GameCommand_rankings(request), "Print information about rankings") \
- SERVER_COMMAND("records", GameCommand_records(request), "List top 10 records for the current map") \
+ SERVER_COMMAND("rankings", CommonCommand_rankings(request), "Print information about rankings") \
+ SERVER_COMMAND("records", CommonCommand_records(request), "List top 10 records for the current map") \
SERVER_COMMAND("reducematchtime", GameCommand_reducematchtime(request), "Decrease the timelimit value incrementally") \
SERVER_COMMAND("setbots", GameCommand_setbots(request, arguments), "Adjust how many bots are in the match") \
SERVER_COMMAND("shuffleteams", GameCommand_shuffleteams(request), "Randomly move players to different teams") \
SERVER_COMMAND("stuffto", GameCommand_stuffto(request, arguments), "Send a command to be executed on a client") \
- SERVER_COMMAND("teamstatus", GameCommand_teamstatus(request), "Show information about player and team scores") \
+ SERVER_COMMAND("teamstatus", CommonCommand_teamstatus(request), "Show information about player and team scores") \
SERVER_COMMAND("time", GameCommand_time(request), "Print different formats/readouts of time") \
+ SERVER_COMMAND("timein", CommonCommand_timein(request), "Resume the game from being paused with a timeout") \
+ SERVER_COMMAND("timeout", CommonCommand_timeout(request), "Call a timeout which pauses the game for certain amount of time unless unpaused") \
SERVER_COMMAND("trace", GameCommand_trace(request, arguments), "Various debugging tools with tracing") \
SERVER_COMMAND("unlockteams", GameCommand_unlockteams(request), "Enable the ability for players to switch or enter teams") \
SERVER_COMMAND("warp", GameCommand_warp(request, arguments), "Choose different level in campaign") \
- SERVER_COMMAND("vote", VoteCommand(request, world, arguments, command), "Server side control of voting") /* handled in server/vote.qc */ \
+ SERVER_COMMAND("who", CommonCommand_who(request), "Display detailed client information about all players") \
+ SERVER_COMMAND("vote", VoteCommand(request, world, arguments, command), "Server side control of voting") \
/* nothing */
void GameCommand_macro_help()