27 #define SYN_ORIG_(String) "*" String
29 #define SYN_TRANS_(String) ('*' == String[0] ? String + 1 : _(String))
37 char *(*extra_help_func)(
const char *cmdname);
47 {
"start", ALLOW_BASIC,
50 N_(
"Start the game, or restart after loading a savegame."),
51 N_(
"This command starts the game. When starting a new game, "
52 "it should be used after all human players have connected, and "
53 "AI players have been created (if required), and any desired "
54 "changes to initial server options have been made. "
55 "After 'start', each human player will be able to "
56 "choose their nation, and then the game will begin. "
57 "This command is also required after loading a savegame "
58 "for the game to recommence. Once the game is running this command "
59 "is no longer available, since it would have no effect."),
67 "help <command-name>\n"
68 "help <option-name>"),
69 N_(
"Show help about server commands and server options."),
70 N_(
"With no arguments gives some introductory help. "
71 "With argument \"commands\" or \"options\" gives respectively "
72 "a list of all commands or all options. "
73 "Otherwise the argument is taken as a command name or option name, "
74 "and help is given for that command or option. For options, the "
76 "information includes the current and default values for that "
78 "The argument may be abbreviated where unambiguous."),
87 "list ignored users\n"
88 "list map image definitions\n"
95 N_(
"Show a list of various things."),
97 N_(
"Show a list of:\n"
98 " - the player colors,\n"
99 " - connections to the server,\n"
100 " - all player delegations,\n"
101 " - your ignore list,\n"
102 " - the list of defined map images,\n"
103 " - the list of the players in the game,\n"
104 " - the available rulesets (for 'read' command),\n"
105 " - the available scenarios,\n"
106 " - the available nation sets in this ruleset,\n"
107 " - the teams of players or\n"
108 " - the running votes.\n"
109 "The argument may be abbreviated, and defaults to 'players' if "
114 SYN_ORIG_(
"quit"),
N_(
"Quit the game and shutdown the server."),
118 N_(
"cut <connection-name>"),
N_(
"Cut a client's connection to server."),
119 N_(
"Cut specified client's connection to the server, removing that "
121 "from the game. If the game has not yet started that client's "
123 "is removed from the game, otherwise there is no effect on the "
125 "Note that this command now takes connection names, not player "
128 {
"explain", ALLOW_INFO,
131 "explain <option-name>"),
132 N_(
"Explain server options."),
133 N_(
"The 'explain' command gives a subset of the functionality of "
135 "and is included for backward compatibility. With no arguments it "
136 "gives a list of options (like 'help options'), and with an "
138 "it gives help for a particular option (like 'help "
144 "show <option-name>\n"
145 "show <option-prefix>\n"
153 N_(
"Show server options."),
154 N_(
"With no arguments, shows vital server options (or available "
156 "when used by clients). With an option name argument, show only the "
157 "named option, or options with that prefix. With \"all\", it shows "
158 "all options. With \"vital\", \"situational\" or \"rare\", a set of "
159 "options with this level. With \"changed\", it shows only the "
161 "which have been modified, while with \"locked\" all settings "
163 "by the ruleset will be listed. With \"ruleset\", it will show the "
164 "current ruleset directory name."),
166 {
"wall", ALLOW_ADMIN,
168 N_(
"wall <message>"),
N_(
"Send message to all connections."),
169 N_(
"For each connected client, pops up a window showing the message "
172 {
"connectmsg", ALLOW_ADMIN,
174 N_(
"connectmsg <message>"),
175 N_(
"Set message to show to connecting players."),
176 N_(
"Set message to send to clients when they connect.\n"
177 "Empty message means that no message is sent."),
179 {
"vote", ALLOW_BASIC,
181 N_(
"vote yes|no|abstain [vote number]"),
185 N_(
"A player with basic level access issuing a control level command "
186 "starts a new vote for the command. The /vote command followed by "
187 "\"yes\", \"no\", or \"abstain\", and optionally a vote number, "
188 "gives your vote. If you do not add a vote number, your vote "
190 "to the latest vote. You can only suggest one vote at a time. "
191 "The vote will pass immediately if more than half of the voters "
192 "who have not abstained vote for it, or fail immediately if at "
193 "least half of the voters who have not abstained vote against it."),
195 {
"debug", ALLOW_CTRL,
197 N_(
"debug diplomacy <player>\n"
199 "debug tech <player>\n"
200 "debug city <x> <y>\n"
201 "debug units <x> <y>\n"
205 N_(
"Turn on or off AI debugging of given entity."),
206 N_(
"Print AI debug information about given entity and turn continuous "
207 "debugging output for this entity on or off."),
211 N_(
"set <option-name> <value>"),
N_(
"Set server option."),
213 N_(
"Set an option on the server. The syntax and legal values depend "
214 "on the option; see the help for each option. Some options are "
215 "\"bitwise\", in that they consist of a choice from a set of "
217 "separate these with |, for instance, '/set topology wrapx|iso'. "
219 "these options, use syntax like '/set topology \"\"' to set no "
224 N_(
"team <player> <team>"),
N_(
"Change a player's team affiliation."),
225 N_(
"A team is a group of players that start out allied, with shared "
226 "vision and embassies, and fight together to achieve team victory "
227 "with averaged individual scores. Each player is always a member "
228 "of a team (possibly the only member). This command changes which "
229 "team a player is a member of. Use \"\" if names contain "
232 {
"rulesetdir", ALLOW_CTRL,
234 N_(
"rulesetdir <directory>"),
235 N_(
"Choose new ruleset directory or modpack."),
nullptr,
nullptr,
237 {
"metamessage", ALLOW_CTRL,
239 N_(
"metamessage <meta-line>"),
N_(
"Set metaserver info line."),
240 N_(
"Set user defined metaserver info line. If parameter is omitted, "
241 "previously set metamessage will be removed. For most of the time "
242 "user defined metamessage will be used instead of automatically "
243 "generated messages, if it is available."),
245 {
"metapatches", ALLOW_HACK,
247 N_(
"metapatches <meta-line>"),
N_(
"Set metaserver patches line."),
249 {
"metaconnection", ALLOW_ADMIN,
252 "metaconnection d|down\n"
254 N_(
"Control metaserver connection."),
255 N_(
"'metaconnection ?' reports on the status of the connection to "
257 "'metaconnection down' or 'metac d' brings the metaserver "
259 "'metaconnection up' or 'metac u' brings the metaserver connection "
261 "'metaconnection persistent' or 'metac p' is like 'up', but keeps "
262 "trying after failures. "),
264 {
"metaserver", ALLOW_ADMIN,
266 N_(
"metaserver <address>"),
267 N_(
"Set address (URL) for metaserver to report to."),
nullptr,
nullptr,
269 {
"aitoggle", ALLOW_CTRL,
271 N_(
"aitoggle <player-name>"),
N_(
"Toggle AI status of player."),
275 N_(
"take [connection-name] <player-name>"),
276 N_(
"Take over a player's place in the game."),
278 N_(
"Only the console and connections with cmdlevel 'hack' can force "
279 "other connections to take over a player. If you're not one of "
281 "only the <player-name> argument is allowed. If '-' is given for "
283 "player name and the connection does not already control a player, "
285 "is created and assigned to the connection. The 'allowtake' option "
286 "controls which players may be taken and in what circumstances."),
288 {
"observe", ALLOW_INFO,
290 N_(
"observe [connection-name] [player-name]"),
291 N_(
"Observe a player or the whole game."),
293 N_(
"Only the console and connections with cmdlevel 'hack' can force "
294 "other connections to observe a player. If you're not one of these, "
295 "only the [player-name] argument is allowed. If the console gives "
297 "player-name or the connection uses no arguments, then the "
299 "is attached to a global observer. The 'allowtake' option controls "
300 "which players may be observed and in what circumstances."),
302 {
"detach", ALLOW_INFO,
304 N_(
"detach <connection-name>"),
N_(
"Detach from a player."),
305 N_(
"Only the console and connections with cmdlevel 'hack' can force "
306 "other connections to detach from a player."),
308 {
"create", ALLOW_CTRL,
310 N_(
"create <player-name> [ai type]"),
311 N_(
"Create an AI player with a given name."),
313 N_(
"With the 'create' command a new player with the given name is "
315 "If 'player-name' is empty, a random name will be assigned when the "
316 "game begins. Until then the player will be known by a name derived "
318 "The 'ai type' parameter can be used to select which AI module will "
320 "used for the created player. This requires that the respective "
322 "has been loaded or built in to the server.\n"
323 "If the game has already started, the new player will have no units "
325 "cities; also, if no free player slots are available, the slot of a "
326 "dead player can be reused (removing all record of that player from "
330 {
"away", ALLOW_BASIC,
333 N_(
"Set yourself in away mode. The AI will watch your back."),
nullptr,
335 {
"handicapped", ALLOW_CTRL,
338 "handicapped <player-name>"),
340 N_(
"Set one or all AI players to 'Handicapped'."),
nullptr,
342 {
"novice", ALLOW_CTRL,
345 "novice <player-name>"),
352 "easy <player-name>"),
356 {
"normal", ALLOW_CTRL,
359 "normal <player-name>"),
366 "hard <player-name>"),
370 {
"cheating", ALLOW_CTRL,
373 "cheating <player-name>"),
375 N_(
"Set one or all AI players to 'Cheating'."),
nullptr,
ai_level_help,
378 {
"experimental", ALLOW_CTRL,
381 "experimental <player-name>"),
383 N_(
"Set one or all AI players to 'Experimental'."),
nullptr,
386 {
"cmdlevel", ALLOW_ADMIN,
390 "cmdlevel <level> new\n"
391 "cmdlevel <level> first\n"
392 "cmdlevel <level> <connection-name>"),
393 N_(
"Query or set command access level access."),
394 N_(
"The command access level controls which server commands are "
396 "to users via the client chatline. The available levels are:\n"
397 " none - no commands\n"
398 " info - informational or observer commands only\n"
399 " basic - commands available to players in the game\n"
400 " ctrl - commands that affect the game and users\n"
401 " admin - commands that affect server operation\n"
402 " hack - *all* commands - dangerous!\n"
403 "With no arguments, the current command access levels are reported. "
404 "With a single argument, the level is set for all existing "
405 "connections, and the default is set for future connections. "
406 "If 'new' is specified, the level is set for newly connecting "
408 "If 'first come' is specified, the 'first come' level is set; it "
410 "granted to the first client to connect, or if there are "
412 "already, the first client to issue the 'first' command. "
413 "If a connection name is specified, the level is set for that "
415 "Command access levels do not persist if a client disconnects, "
416 "because some untrusted person could reconnect with the same name. "
417 "Note that this command now takes connection names, not player "
420 {
"first", ALLOW_BASIC,
423 N_(
"If there is none, become the game organizer with increased "
426 {
"timeoutshow", ALLOW_INFO,
SYN_ORIG_(
"timeoutshow"),
427 N_(
"Show timeout settings and timers."),
428 N_(
"Shows information about the timeout for the current turn, for "
429 "instance how much time is left."),
431 {
"timeoutset", ALLOW_CTRL,
433 N_(
"timeoutset <time>"),
434 N_(
"Changes the timeout for the current turn."),
436 N_(
"This command changes the remaining time for the current turn. "
437 "Passing a value of 0 ends the turn immediately.\n"
438 "The time is specified as hours, minutes, and seconds using the "
439 "format hh:mm:ss (minutes and hours are optional)."),
441 {
"timeoutadd", ALLOW_CTRL,
443 N_(
"timeoutadd <time>"),
N_(
"Adds more time to the current turn."),
445 N_(
"This increases the timeout for the current turn, giving players "
446 "more time to finish their actions.\n"
447 "The time is specified as hours, minutes, and seconds using the "
448 "format hh:mm:ss (minutes and hours are optional). Negative values "
451 {
"timeoutincrease", ALLOW_CTRL,
453 N_(
"timeoutincrease <turn> <turninc> <value> <valuemult>"),
454 N_(
"See \"/help timeoutincrease\"."),
455 N_(
"Every <turn> turns, add <value> to timeout timer, then add "
457 "to <turn> and multiply <value> by <valuemult>. Use this command in "
458 "concert with the option \"timeout\". Defaults are 0 0 0 1"),
460 {
"cancelvote", ALLOW_BASIC,
463 "cancelvote <vote number>\n"
466 N_(
"Cancel a running vote."),
468 N_(
"With no arguments this command removes your own vote. If you have "
469 "an admin access level, you can cancel any vote by vote number, or "
470 "all votes with the \'all\' argument."),
472 {
"ignore", ALLOW_INFO,
474 N_(
"ignore [type=]<pattern>"),
475 N_(
"Block all messages from users matching the pattern."),
476 N_(
"The given pattern will be added to your ignore list; you will not "
477 "receive any messages from users matching this pattern. The type "
478 "may be either \"user\", \"host\", or \"ip\". The default type "
479 "(if omitted) is to match against the username. The pattern "
481 "unix glob style wildcards, i.e., * matches zero or more character, "
483 "exactly one character, [abc] exactly one of 'a' 'b' or 'c', etc. "
484 "To access your current ignore list, issue \"/list ignore\"."),
486 {
"unignore", ALLOW_INFO,
488 N_(
"unignore <range>"),
N_(
"Remove ignore list entries."),
489 N_(
"The ignore list entries in the given range will be removed; "
490 "you will be able to receive messages from the respective users. "
491 "The range argument may be a single number or a pair of numbers "
492 "separated by a dash '-'. If the first number is omitted, it is "
493 "assumed to be 1; if the last is omitted, it is assumed to be "
494 "the last valid ignore list index. To access your current ignore "
495 "list, issue \"/list ignore\"."),
497 {
"playercolor", ALLOW_ADMIN,
499 N_(
"playercolor <player-name> <color>\n"
500 "playercolor <player-name> reset"),
501 N_(
"Define the color of a player."),
502 N_(
"This command sets the color of a specific player, overriding any "
504 "assigned according to the 'plrcolormode' setting.\n"
505 "The color is defined using hexadecimal notation (hex) for the "
506 "combination of Red, Green, and Blue color components (RGB), "
508 "to HTML. For each component, the lowest (darkest) value is 0 (in "
509 "hex: 00), and the highest value is 255 (in hex: FF). The color "
510 "definition is simply the three hex values concatenated together "
511 "(RRGGBB). For example, the following command sets Caesar to pure "
513 " playercolor Caesar ff0000\n"
514 "Before the game starts, this command can only be used if the "
515 "'plrcolormode' setting is set to 'PLR_SET'; a player's color can "
517 "unset again by specifying 'reset'.\n"
518 "Once the game has started and colors have been assigned, this "
520 "changes the player color in any mode; 'reset' cannot be used.\n"
521 "To list the player colors, use 'list colors'."),
523 {
"playernation", ALLOW_ADMIN,
525 N_(
"playernation <player-name> [nation] [is-male] [leader] [style]"),
526 N_(
"Define the nation of a player."),
527 N_(
"This command sets the nation, leader name, style, and gender of a "
528 "specific player. The string \"random\" can be used to select a "
529 "random nation.\nThe gender parameter should be 1 if male, "
530 "otherwise 0. Omitting any of the player settings will reset the "
531 "player to defaults.\n"
532 "This command may not be used once the game has started."),
534 {
"endgame", ALLOW_ADMIN,
536 SYN_ORIG_(
"endgame"),
N_(
"End the game immediately in a draw."),
538 {
"surrender", ALLOW_BASIC,
541 N_(
"This tells everyone else that you concede the game, and if all "
542 "but one player (or one team) have conceded the game in this way "
543 "then the game ends."),
545 {
"remove", ALLOW_CTRL,
547 N_(
"remove <player-name>"),
N_(
"Fully remove player from game."),
548 N_(
"This *completely* removes a player from the game, including "
549 "all cities and units etc. Use with care!"),
551 {
"save", ALLOW_ADMIN,
555 N_(
"Save game to file."),
556 N_(
"Save the current game to file <file-name>. If no file-name "
557 "argument is given saves to \"<auto-save name "
558 "prefix><year>m.sav[.gz]\". "
559 "To reload a savegame created by 'save', start the server with "
560 "the command-line argument:\n"
561 " '--file <filename>' or '-f <filename>'\n"
562 "and use the 'start' command once players have reconnected."),
564 {
"scensave", ALLOW_ADMIN,
567 "scensave <file-name>"),
568 N_(
"Save game to file as scenario."),
569 N_(
"Save the current game to file <file-name> as scenario. If no "
571 "argument is given saves to \"<auto-save name "
572 "prefix><year>m.sav[.gz]\". "
573 "To reload a savegame created by 'scensave', start the server with "
574 "the command-line argument:\n"
575 " '--file <filename>' or '-f <filename>'\n"
576 "and use the 'start' command once players have reconnected."),
582 N_(
"Load game from file."),
583 N_(
"Load a game from <file-name>. Any current data including players, "
584 "rulesets and server options are lost."),
588 N_(
"read <file-name>"),
N_(
"Process server commands from file."),
590 {
"write", ALLOW_HACK,
592 N_(
"write <file-name>"),
593 N_(
"Write current settings as server commands to file."),
nullptr,
595 {
"reset", ALLOW_CTRL,
597 SYN_ORIG_(
"reset [game|ruleset|script|default]"),
598 N_(
"Reset all server settings."),
599 N_(
"Reset all settings if it is possible. The following levels are "
601 " game - using the values defined at the game start\n"
602 " ruleset - using the values defined in the ruleset\n"
603 " script - using default values and rereading the start script\n"
604 " default - using default values\n"),
606 {
"default", ALLOW_CTRL,
608 N_(
"default <option name>"),
N_(
"Set option to its default value"),
609 N_(
"Reset the option to its default value. If the default ever changes "
610 "in a future version, the option's value will follow that change."),
614 N_(
"lua cmd <script line>\n"
615 "lua unsafe-cmd <script line>\n"
616 "lua file <script file>\n"
617 "lua unsafe-file <script file>\n"
618 "lua <script line> (deprecated)"),
619 N_(
"Evaluate a line of Freeciv21 script or a Freeciv script file in "
620 "the current game."),
621 N_(
"The unsafe prefix runs the script in an instance separate from the "
622 "ruleset. This instance doesn't restrict access to Lua functions "
623 "that can be used to hack the computer running the Freeciv21 "
624 "server. Access to it is therefore limited to the console and "
625 "connections with cmdlevel 'hack'"),
629 N_(
"kick <user>"),
N_(
"Cut a connection and disallow reconnect."),
630 N_(
"The connection given by the 'user' argument will be cut from the "
631 "server and not allowed to reconnect. The time the user wouldn't be "
632 "able to reconnect is controlled by the 'kicktime' setting."),
634 {
"delegate", ALLOW_BASIC,
636 N_(
"delegate to <username> [player-name]\n"
637 "delegate cancel [player-name]\n"
638 "delegate take <player-name>\n"
640 "delegate show <player-name>"),
641 N_(
"Delegate control to another user."),
642 N_(
"Delegation allows a user to nominate another user who can "
644 "take over control of their player while they are away.\n"
645 "'delegate to <username>': allow <username> to 'delegate take' your "
647 "'delegate cancel': nominated user can no longer take your player.\n"
648 "'delegate take <player-name>': take control of a player who has "
650 "delegated to you. (Behaves like 'take', except that the "
652 "restrictions are not enforced.)\n"
653 "'delegate restore': relinquish control of a delegated player "
655 "of 'delegate take') and restore your previous view, if any. (This "
657 "happens automatically if the player's owner reconnects.)\n"
658 "'delegate show': show who control of your player is currently "
659 "delegated to, if anyone.\n"
660 "The [player-name] argument can only be used by connections with "
661 "cmdlevel 'admin' or above to force the corresponding change of the "
662 "delegation status."),
664 {
"aicmd", ALLOW_ADMIN,
666 N_(
"aicmd <player> <command>"),
N_(
"Execute AI command"),
667 N_(
"Execute a command in the context of the AI for the given player"),
669 {
"fcdb", ALLOW_ADMIN,
672 "fcdb lua <script>"),
673 N_(
"Manage the authentication database."),
674 N_(
"The argument 'reload' causes the database script file to be "
676 "after a change, while the argument 'lua' evaluates a line of Lua "
677 "script in the context of the Lua instance for the database."),
679 {
"mapimg", ALLOW_ADMIN,
681 N_(
"mapimg define <mapdef>\n"
682 "mapimg show <id>|all\n"
683 "mapimg create <id>|all\n"
684 "mapimg delete <id>|all\n"
686 N_(
"Create image files of the world/player map."),
nullptr,
mapimg_help,
688 {
"rfcstyle", ALLOW_HACK,
691 N_(
"Switch server output between 'RFC-style' and normal style."),
693 {
"serverid", ALLOW_INFO,
695 SYN_ORIG_(
"serverid"),
N_(
"Simply returns the id of the server."),
712 return pcommand->
name;
760 return pcommand->
level;
768 return pcommand->
echo;
static struct command commands[]
enum cmd_echo command_echo(const struct command *pcommand)
Returns the flag of the command to notify the users about its usage.
#define SYN_TRANS_(String)
const char * command_name(const struct command *pcommand)
Return name of the command.
int command_vote_percent(const struct command *pcommand)
Returns the vote percent required for this command to pass in a vote.
const struct command * command_by_number(int i)
Return command by its number.
const char * command_short_help(const struct command *pcommand)
Returns the short help text of the command (translated).
char * command_extra_help(const struct command *pcommand)
Returns the extra help text of the command (translated).
#define SYN_ORIG_(String)
int command_vote_flags(const struct command *pcommand)
Returns a bit-wise combination of all vote flags set for this command.
enum cmdlevel command_level(const struct command *pcommand)
What is the permissions level required for running the command?
const char * command_name_by_number(int i)
Return name of the command by commands number.
const char * command_synopsis(const struct command *pcommand)
Returns the synopsis text of the command (translated).
char * ai_level_help(const char *cmdname)
Helper function for skill level command help.
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
char * mapimg_help(const char *cmdname)
Return a help string for the 'mapimg' command.
char *(* extra_help_func)(const char *cmdname)