Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
menu_cmd.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GameCommand (string command)

Function Documentation

◆ GameCommand()

void GameCommand ( string command)

Definition at line 530 of file cl_cmd.qc.

531{
532 int argc = tokenize_console(command);
533
534 // Guide for working with argc arguments by example:
535 // argc: 1 - 2 - 3 - 4
536 // argv: 0 - 1 - 2 - 3
537 // cmd vote - master - login - password
538 string s = strtolower(argv(0));
539 if (s == "help")
540 {
541 if (argc == 1)
542 {
543 LOG_HELP("Client console commands:");
545
546 LOG_HELP("\nGeneric commands shared by all programs:");
548
549 LOG_HELP("\nUsage:^3 cl_cmd <command>^7, where possible commands are listed above.");
550 LOG_HELP("For help about a specific command, type cl_cmd help <command>");
551
552 return;
553 }
554 else if (GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
555 {
556 return;
557 }
558 else if (LocalCommand_macro_usage(argc)) // now try for normal commands too
559 {
560 return;
561 }
562 }
563 // continue as usual and scan for normal commands
564 if (GenericCommand(command) // handled by common/command/generic.qc
565 || LocalCommand_macro_command(argc, command) // handled by one of the above LocalCommand_* functions
566 || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
567 ) return;
568
569 // nothing above caught the command, must be invalid
570 LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.");
571}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
bool LocalCommand_macro_usage(int argc)
Definition cl_cmd.qc:509
bool LocalCommand_macro_command(int argc, string command)
Definition cl_cmd.qc:499
void LocalCommand_macro_help()
Definition cl_cmd.qc:494
string strtolower(string s)
#define tokenize_console
float GenericCommand_macro_usage(int argc)
Definition generic.qc:582
void GenericCommand_macro_help()
Definition generic.qc:567
float GenericCommand(string command)
Definition generic.qc:603
#define CSQC_ConsoleCommand
Definition _all.inc:309
#define LOG_HELP(...)
Definition log.qh:85
#define LOG_INFO(...)
Definition log.qh:65
string argv(float n)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References argv(), BanCommand(), BanCommand_macro_help(), BanCommand_macro_usage(), buf_create, CommonCommand_macro_command(), CommonCommand_macro_help(), CommonCommand_macro_usage(), CSQC_ConsoleCommand, cvar(), Dialog_Close(), entity(), FOREACH_ENTITY_ORDERED, GameCommand_macro_command(), GameCommand_macro_help(), GameCommand_macro_usage(), GenericCommand(), GenericCommand_macro_help(), GenericCommand_macro_usage(), if(), isdemo(), LocalCommand_macro_command(), LocalCommand_macro_help(), LocalCommand_macro_usage(), LOG_HELP, LOG_INFO, m_goto(), m_play_click_sound(), m_sync(), MENU_SOUND_OPEN, MUTATOR_CALLHOOK, nextent(), NULL, strcat(), string_null, strtolower(), strzone(), tokenize_console, and updateConwidths().