-#include "all.qh"
+#include "generic.qh"
+#include "_mod.qh"
+#include "reg.qh"
#include "markup.qh"
#include "rpn.qh"
#include "../mapinfo.qh"
-#ifndef MENUQC
+#ifdef GAMEQC
#include "../notifications/all.qh"
#endif
#endif
#ifdef SVQC
- #include <server/command/banning.qh>
- #include <server/command/cmd.qh>
- #include <server/command/common.qh>
- #include <server/command/sv_cmd.qh>
+ #include <server/command/_mod.qh>
#include <common/turrets/config.qh>
#include <common/weapons/config.qh>
#endif
string do_cvar = curl_uri_get_cvar[i];
if(status != 0)
{
- LOG_TRACEF("error: status is %d\n", status);
+ LOG_TRACEF("error: status is %d", status);
if(do_cvar)
strunzone(do_cvar);
return;
}
else // add it to the end of the list if the list doesn't already have it
{
- argc = tokenizebyseparator(cvar_string(original_cvar), " ");
- int i;
- for(i = 0; i < argc; ++i)
- if(argv(i) == tmp_string)
- return; // already in list
+ FOREACH_WORD(cvar_string(original_cvar), it == tmp_string,
+ {
+ return; // already in the list
+ });
- cvar_set(original_cvar, strcat(tmp_string, " ", cvar_string(original_cvar)));
+ cvar_set(original_cvar, cons(cvar_string(original_cvar), tmp_string));
}
return;
}
LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n");
LOG_INFO(" Where 'variable' is what to add 'value' to.\n");
LOG_INFO("See also: ^2removefromlist^7\n");
return;
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpcommands");
LOG_INFO(" No arguments required.\n");
return;
}
LOG_INFO("Incorrect parameters for ^2maplist^7\n");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n");
LOG_INFO(" Where 'action' is the command to complete,\n");
LOG_INFO(" and 'map' is what it acts upon (if required).\n");
LOG_INFO(" Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n");
LOG_INFO(" Where command will be executed next frame of this VM\n");
return;
}
{
if(argc == 3)
{
- float i;
string original_cvar = argv(1);
string removal = argv(2);
- string tmp_string;
- argc = tokenizebyseparator(cvar_string(original_cvar), " ");
-
- tmp_string = "";
- for(i = 0; i < argc; ++i)
- if(argv(i) != removal)
- tmp_string = strcat(tmp_string, " ", argv(i));
+ string tmp_string = "";
+ FOREACH_WORD(cvar_string(original_cvar), it != removal,
+ {
+ tmp_string = cons(tmp_string, it);
+ });
- tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1);
cvar_set(original_cvar, tmp_string);
return;
LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n");
LOG_INFO(" Where 'variable' is what cvar to remove 'value' from.\n");
LOG_INFO("See also: ^2addtolist^7\n");
return;
{
case CMD_REQUEST_COMMAND:
{
- #ifndef MENUQC
+ #ifdef GAMEQC
int NOTIF_ANNCE_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_ANNCE, { ++NOTIF_ANNCE_COUNT; });
int NOTIF_INFO_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_INFO, { ++NOTIF_INFO_COUNT; });
int NOTIF_CENTER_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_CENTER, { ++NOTIF_CENTER_COUNT; });
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " restartnotifs");
LOG_INFO(" No arguments required.\n");
return;
}
{
float f = cvar_settemp(argv(1), argv(2));
if(f == 1)
- LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+ LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.");
else if(f == -1)
- LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
+ LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".");
// else cvar_settemp itself errors out
return;
LOG_INFO("Incorrect parameters for ^2settemp^7\n");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n");
LOG_INFO(" Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
LOG_INFO("See also: ^2settemp_restore^7\n");
return;
float i = cvar_settemp_restore();
if(i)
- LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
+ LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.");
else
- LOG_TRACE("Nothing to restore.\n");
+ LOG_TRACE("Nothing to restore.");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n");
LOG_INFO(" No arguments required.\n");
LOG_INFO("See also: ^2settemp^7\n");
return;
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
return;
}
}