Xonotic
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 502 of file cl_cmd.qc.

References _dumptree_close(), _dumptree_open(), _dumptree_space, argv(), BanCommand(), BanCommand_macro_help(), BanCommand_macro_usage(), CommonCommand_macro_command(), CommonCommand_macro_help(), CommonCommand_macro_usage(), CSQC_ConsoleCommand(), cvar(), depthfirst(), firstChild, FOREACH_ENTITY_ORDERED, GameCommand_macro_command(), GameCommand_macro_help(), GameCommand_macro_usage(), GenericCommand(), GenericCommand_macro_help(), GenericCommand_macro_usage(), isdemo(), LocalCommand_macro_command(), LocalCommand_macro_help(), LocalCommand_macro_usage(), LOG_HELP, LOG_INFO, m_goto(), m_play_click_sound(), m_sync(), main, MENU_SOUND_OPEN, MUTATOR_CALLHOOK, nextSibling, NULL, parent, strcat(), string_null, tokenize_console, and updateConwidths().

503 {
504  int argc = tokenize_console(command);
505 
506  // Guide for working with argc arguments by example:
507  // argc: 1 - 2 - 3 - 4
508  // argv: 0 - 1 - 2 - 3
509  // cmd vote - master - login - password
510  string s = strtolower(argv(0));
511  if (s == "help")
512  {
513  if (argc == 1)
514  {
515  LOG_HELP("Client console commands:");
517 
518  LOG_HELP("\nGeneric commands shared by all programs:");
520 
521  LOG_HELP("\nUsage:^3 cl_cmd <command>^7, where possible commands are listed above.");
522  LOG_HELP("For help about a specific command, type cl_cmd help <command>");
523 
524  return;
525  }
526  else if (GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
527  {
528  return;
529  }
530  else if (LocalCommand_macro_usage(argc)) // now try for normal commands too
531  {
532  return;
533  }
534  }
535  // continue as usual and scan for normal commands
536  if (GenericCommand(command) // handled by common/command/generic.qc
537  || LocalCommand_macro_command(argc, command) // handled by one of the above LocalCommand_* functions
538  || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
539  ) return;
540 
541  // nothing above caught the command, must be invalid
542  LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.");
543 }
float GenericCommand(string command)
Definition: generic.qc:582
#define LOG_HELP(...)
Definition: log.qh:95
void GenericCommand_macro_help()
Definition: generic.qc:546
float GenericCommand_macro_usage(int argc)
Definition: generic.qc:561
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
bool LocalCommand_macro_command(int argc, string command)
Definition: cl_cmd.qc:471
void LocalCommand_macro_help()
Definition: cl_cmd.qc:466
#define LOG_INFO(...)
Definition: log.qh:70
bool LocalCommand_macro_usage(int argc)
Definition: cl_cmd.qc:481
#define tokenize_console
Definition: dpextensions.qh:24
bool CSQC_ConsoleCommand(string command)
Definition: cl_cmd.qc:634
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
+ Here is the call graph for this function: