33#define SYN_ORIG_(String) "*" String
35#define SYN_TRANS_(String) ('*' == String[0] ? String + 1 : _(String))
43 char *(*extra_help_func)(
const char *cmdname);
53 {
"start", ALLOW_BASIC,
56 N_(
"Start the game, or restart after loading a savegame."),
57 N_(
"This command starts the game. When starting a new game, "
58 "it should be used after all human players have connected, and "
59 "AI players have been created (if required), and any desired "
60 "changes to initial server options have been made. "
61 "After 'start', each human player will be able to "
62 "choose their nation, and then the game will begin. "
63 "This command is also required after loading a savegame "
64 "for the game to recommence. Once the game is running this command "
65 "is no longer available, since it would have no effect."), NULL,
74 "help <command-name>\n"
75 "help <option-name>"),
76 N_(
"Show help about server commands and server options."),
77 N_(
"With no arguments gives some introductory help. "
78 "With argument \"commands\" or \"options\" gives respectively "
79 "a list of all commands or all options. "
80 "Otherwise the argument is taken as a command name or option name, "
81 "and help is given for that command or option. For options, the help "
82 "information includes the current and default values for that option. "
83 "The argument may be abbreviated where unambiguous."), NULL,
93 "list ignored users\n"
94 "list map image definitions\n"
101 N_(
"Show a list of various things."),
103 N_(
"Show a list of:\n"
104 " - the player colors,\n"
105 " - connections to the server,\n"
106 " - all player delegations,\n"
107 " - your ignore list,\n"
108 " - the list of defined map images,\n"
109 " - the list of the players in the game,\n"
110 " - the available rulesets (for 'read' command),\n"
111 " - the available scenarios,\n"
112 " - the available nation sets in this ruleset,\n"
113 " - the teams of players or\n"
114 " - the running votes.\n"
115 "The argument may be abbreviated, and defaults to 'players' if "
122 N_(
"Quit the game and shutdown the server."), NULL, NULL,
127 N_(
"cut <connection-name>"),
128 N_(
"Cut a client's connection to server."),
129 N_(
"Cut specified client's connection to the server, removing that client "
130 "from the game. If the game has not yet started that client's player "
131 "is removed from the game, otherwise there is no effect on the player. "
132 "Note that this command now takes connection names, not player names."),
136 {
"explain", ALLOW_INFO,
139 "explain <option-name>"),
140 N_(
"Explain server options."),
141 N_(
"The 'explain' command gives a subset of the functionality of 'help', "
142 "and is included for backward compatibility. With no arguments it "
143 "gives a list of options (like 'help options'), and with an argument "
144 "it gives help for a particular option (like 'help <option-name>')."),
151 "show <option-name>\n"
152 "show <option-prefix>\n"
160 N_(
"Show server options."),
161 N_(
"With no arguments, shows vital server options (or available options, "
162 "when used by clients). With an option name argument, show only the "
163 "named option, or options with that prefix. With \"all\", it shows "
164 "all options. With \"vital\", \"situational\" or \"rare\", a set of "
165 "options with this level. With \"changed\", it shows only the options "
166 "which have been modified, while with \"locked\" all settings locked "
167 "by the ruleset will be listed. With \"ruleset\", it will show the "
168 "current ruleset directory name."), NULL,
171 {
"wall", ALLOW_ADMIN,
173 N_(
"wall <message>"),
174 N_(
"Send message to all connections."),
175 N_(
"For each connected client, pops up a window showing the message "
179 {
"connectmsg", ALLOW_ADMIN,
181 N_(
"connectmsg <message>"),
182 N_(
"Set message to show to connecting players."),
183 N_(
"Set message to send to clients when they connect.\n"
184 "Empty message means that no message is sent."), NULL,
187 {
"vote", ALLOW_BASIC,
189 N_(
"vote yes|no|abstain [vote number]"),
193 N_(
"A player with basic level access issuing a control level command "
194 "starts a new vote for the command. The /vote command followed by "
195 "\"yes\", \"no\", or \"abstain\", and optionally a vote number, "
196 "gives your vote. If you do not add a vote number, your vote applies "
197 "to the latest vote. You can only suggest one vote at a time. "
198 "The vote will pass immediately if more than half of the voters "
199 "who have not abstained vote for it, or fail immediately if at "
200 "least half of the voters who have not abstained vote against it."),
204 {
"debug", ALLOW_CTRL,
206 N_(
"debug diplomacy <player>\n"
208 "debug tech <player>\n"
209 "debug city <x> <y>\n"
210 "debug units <x> <y>\n"
214 N_(
"Turn on or off AI debugging of given entity."),
215 N_(
"Print AI debug information about given entity and turn continuous "
216 "debugging output for this entity on or off."), NULL,
221 N_(
"set <option-name> <value>"),
222 N_(
"Set server option."),
224 N_(
"Set an option on the server. The syntax and legal values depend "
225 "on the option; see the help for each option. Some options are "
226 "\"bitwise\", in that they consist of a choice from a set of values; "
227 "separate these with |, for instance, '/set topology wrapx|iso'. For "
228 "these options, use syntax like '/set topology \"\"' to set no "
234 N_(
"team <player> <team>"),
235 N_(
"Change a player's team affiliation."),
236 N_(
"A team is a group of players that start out allied, with shared "
237 "vision and embassies, and fight together to achieve team victory "
238 "with averaged individual scores. Each player is always a member "
239 "of a team (possibly the only member). This command changes which "
240 "team a player is a member of. Use \"\" if names contain whitespace."),
244 {
"rulesetdir", ALLOW_CTRL,
246 N_(
"rulesetdir <directory>"),
247 N_(
"Choose new ruleset directory or modpack."),
251 {
"metamessage", ALLOW_CTRL,
253 N_(
"metamessage <meta-line>"),
254 N_(
"Set metaserver info line."),
255 N_(
"This command is deprecated. Set metamessage setting directly instead. "
256 "Command sets user defined metaserver info line. If parameter is omitted, "
257 "previously set metamessage will be removed. For most of the time "
258 "user defined metamessage will be used instead of automatically "
259 "generated messages, if it is available."), NULL,
262 {
"metapatches", ALLOW_HACK,
264 N_(
"metapatches <meta-line>"),
265 N_(
"Set metaserver patches line."), NULL, NULL,
268 {
"metaconnection", ALLOW_ADMIN,
271 "metaconnection d|down\n"
272 "metaconnection p|persistent\n"
274 N_(
"Control metaserver connection."),
275 N_(
"'metaconnection ?' reports on the status of the connection to metaserver. "
276 "'metaconnection down' or 'metac d' brings the metaserver connection down. "
277 "'metaconnection up' or 'metac u' brings the metaserver connection up. "
278 "'metaconnection persistent' or 'metac p' is like 'up', but keeps trying after failures. "),
282 {
"metaserver", ALLOW_ADMIN,
284 N_(
"metaserver <address>"),
285 N_(
"Set address (URL) for metaserver to report to."), NULL, NULL,
288 {
"aitoggle", ALLOW_CTRL,
290 N_(
"aitoggle <player-name>"),
291 N_(
"Toggle AI status of player."), NULL, NULL,
296 N_(
"take [connection-name] <player-name>"),
297 N_(
"Take over a player's place in the game."),
299 N_(
"Only the console and connections with cmdlevel 'hack' can force "
300 "other connections to take over a player. If you're not one of these, "
301 "only the <player-name> argument is allowed. If '-' is given for the "
302 "player name and the connection does not already control a player, one "
303 "is created and assigned to the connection. The 'allowtake' option "
304 "controls which players may be taken and in what circumstances."),
308 {
"observe", ALLOW_INFO,
310 N_(
"observe [connection-name] [player-name]"),
311 N_(
"Observe a player or the whole game."),
313 N_(
"Only the console and connections with cmdlevel 'hack' can force "
314 "other connections to observe a player. If you're not one of these, "
315 "only the [player-name] argument is allowed. If the console gives no "
316 "player-name or the connection uses no arguments, then the connection "
317 "is attached to a global observer. The 'allowtake' option controls "
318 "which players may be observed and in what circumstances."), NULL,
321 {
"detach", ALLOW_INFO,
323 N_(
"detach <connection-name>"),
324 N_(
"Detach from a player."),
325 N_(
"Only the console and connections with cmdlevel 'hack' can force "
326 "other connections to detach from a player."), NULL,
329 {
"create", ALLOW_CTRL,
331 N_(
"create <player-name> [ai type]"),
332 N_(
"Create an AI player with a given name."),
334 N_(
"With the 'create' command a new player with the given name is "
336 "If 'player-name' is empty, a random name will be assigned when the "
337 "game begins. Until then the player will be known by a name derived "
339 "The 'ai type' parameter can be used to select which AI module will be "
340 "used for the created player. This requires that the respective module "
341 "has been loaded or built in to the server.\n"
342 "If the game has already started, the new player will have no units or "
343 "cities; also, if no free player slots are available, the slot of a "
344 "dead player can be reused (removing all record of that player from the "
345 "running game)."), NULL,
348 {
"away", ALLOW_BASIC,
351 N_(
"Set yourself in away mode. The AI will watch your back."),
355 {
"restricted", ALLOW_CTRL,
358 "restricted <player-name>"),
363 {
"novice", ALLOW_CTRL,
366 "novice <player-name>"),
374 "easy <player-name>"),
379 {
"normal", ALLOW_CTRL,
382 "normal <player-name>"),
390 "hard <player-name>"),
395 {
"cheating", ALLOW_CTRL,
398 "cheating <player-name>"),
404 {
"experimental", ALLOW_CTRL,
407 "experimental <player-name>"),
409 N_(
"Set one or all AI players to 'Experimental'."), NULL,
ai_level_help,
413 {
"cmdlevel", ALLOW_ADMIN,
417 "cmdlevel <level> new\n"
418 "cmdlevel <level> first\n"
419 "cmdlevel <level> <connection-name>"),
420 N_(
"Query or set command access level access."),
421 N_(
"The command access level controls which server commands are available "
422 "to users via the client chatline. The available levels are:\n"
423 " none - no commands\n"
424 " info - informational or observer commands only\n"
425 " basic - commands available to players in the game\n"
426 " ctrl - commands that affect the game and users\n"
427 " admin - commands that affect server operation\n"
428 " hack - *all* commands - dangerous!\n"
429 "With no arguments, the current command access levels are reported. "
430 "With a single argument, the level is set for all existing "
431 "connections, and the default is set for future connections. "
432 "If 'new' is specified, the level is set for newly connecting clients. "
433 "If 'first come' is specified, the 'first come' level is set; it will be "
434 "granted to the first client to connect, or if there are connections "
435 "already, the first client to issue the 'first' command. "
436 "If a connection name is specified, the level is set for that "
438 "Command access levels do not persist if a client disconnects, "
439 "because some untrusted person could reconnect with the same name. "
440 "Note that this command now takes connection names, not player names."
444 {
"first", ALLOW_BASIC,
447 N_(
"If there is none, become the game organizer with increased permissions."),
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 <turninc> "
456 "to <turn> and multiply <value> by <valuemult>. Use this command in "
457 "concert with the option \"timeout\". Defaults are 0 0 0 1"), NULL,
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."), NULL,
473 {
"ignore", ALLOW_INFO,
475 N_(
"ignore [type=]<pattern>"),
476 N_(
"Block all messages from users matching the pattern."),
477 N_(
"The given pattern will be added to your ignore list; you will not "
478 "receive any messages from users matching this pattern. The type "
479 "may be either \"user\", \"host\", or \"ip\". The default type "
480 "(if omitted) is to match against the username. The pattern supports "
481 "unix glob style wildcards, i.e., * matches zero or more character, ? "
482 "exactly one character, [abc] exactly one of 'a' 'b' or 'c', etc. "
483 "To access your current ignore list, issue \"/list ignore\"."), NULL,
486 {
"unignore", ALLOW_INFO,
488 N_(
"unignore <range>"),
489 N_(
"Remove ignore list entries."),
490 N_(
"The ignore list entries in the given range will be removed; "
491 "you will be able to receive messages from the respective users. "
492 "The range argument may be a single number or a pair of numbers "
493 "separated by a dash '-'. If the first number is omitted, it is "
494 "assumed to be 1; if the last is omitted, it is assumed to be "
495 "the last valid ignore list index. To access your current ignore "
496 "list, issue \"/list ignore\"."), NULL,
499 {
"playercolor", ALLOW_ADMIN,
501 N_(
"playercolor <player-name> <color>\n"
502 "playercolor <player-name> reset"),
503 N_(
"Define the color of a player."),
504 N_(
"This command sets the color of a specific player, overriding any color "
505 "assigned according to the 'plrcolormode' setting.\n"
506 "The color is defined using hexadecimal notation (hex) for the "
507 "combination of Red, Green, and Blue color components (RGB), similarly "
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 red:\n"
512 " playercolor Caesar ff0000\n"
513 "Before the game starts, this command can only be used if the "
514 "'plrcolormode' setting is set to 'PLR_SET'; a player's color can be "
515 "unset again by specifying 'reset'.\n"
516 "Once the game has started and colors have been assigned, this command "
517 "changes the player color in any mode; 'reset' cannot be used.\n"
518 "To list the player colors, use 'list colors'."), NULL,
521 {
"playernation", ALLOW_ADMIN,
523 N_(
"playernation <player-name> [nation] [is-male] [leader] [style]"),
524 N_(
"Define the nation of a player."),
525 N_(
"This command sets the nation, leader name, style, and gender of a "
526 "specific player.\nThe gender parameter should be 1 if male, "
527 "otherwise 0. Omitting any of the player settings will reset the "
528 "player to defaults.\n"
529 "This command may not be used once the game has started."), NULL,
532 {
"endgame", ALLOW_ADMIN,
535 N_(
"End the game immediately in a draw."), NULL, NULL,
538 {
"surrender", ALLOW_BASIC,
541 N_(
"Concede the game."),
542 N_(
"This tells everyone else that you concede the game, and if all "
543 "but one player (or one team) have conceded the game in this way "
544 "then the game ends."), NULL,
547 {
"remove", ALLOW_CTRL,
549 N_(
"remove <player-name>"),
550 N_(
"Fully remove player from game."),
551 N_(
"This *completely* removes a player from the game, including "
552 "all cities and units etc. Use with care!"), NULL,
555 {
"save", ALLOW_ADMIN,
559 N_(
"Save game to file."),
560 N_(
"Save the current game to file <file-name>. If no file-name "
561 "argument is given saves to \"<auto-save name prefix><year>m.sav[.gz]\". "
562 "To reload a savegame created by 'save', start the server with "
563 "the command-line argument:\n"
564 " '--file <filename>' or '-f <filename>'\n"
565 "and use the 'start' command once players have reconnected."), NULL,
568 {
"scensave", ALLOW_ADMIN,
571 "scensave <file-name>"),
572 N_(
"Save game to file as scenario."),
573 N_(
"Save the current game to file <file-name> as scenario. If no file-name "
574 "argument is given saves to \"<auto-save name prefix><year>m.sav[.gz]\". "
575 "To reload a savegame created by 'scensave', start the server with "
576 "the command-line argument:\n"
577 " '--file <filename>' or '-f <filename>'\n"
578 "and use the 'start' command once players have reconnected."), NULL,
585 N_(
"Load game from file."),
586 N_(
"Load a game from <file-name>. Any current data including players, "
587 "rulesets and server options are lost."), NULL,
592 N_(
"read <file-name>"),
593 N_(
"Process server commands from file."), NULL, NULL,
596 {
"write", ALLOW_HACK,
598 N_(
"write <file-name>"),
599 N_(
"Write current settings as server commands to file."), NULL, NULL,
602 {
"reset", ALLOW_CTRL,
604 SYN_ORIG_(
"reset [game|ruleset|script|default]"),
605 N_(
"Reset all server settings."),
606 N_(
"Reset all settings if it is possible. The following levels are "
608 " game - using the values defined at the game start\n"
609 " ruleset - using the values defined in the ruleset\n"
610 " script - using default values and rereading the start script\n"
611 " default - using default values\n"), NULL,
614 {
"default", ALLOW_CTRL,
616 N_(
"default <option name>"),
617 N_(
"Set option to its default value"),
618 N_(
"Reset the option to its default value. If the default ever changes "
619 "in a future version, the option's value will follow that change."),
625 N_(
"lua cmd <script line>\n"
626 "lua unsafe-cmd <script line>\n"
627 "lua file <script file>\n"
628 "lua unsafe-file <script file>\n"
629 "lua <script line> (deprecated)"),
630 N_(
"Evaluate a line of Freeciv script or a Freeciv script file in the "
633 N_(
"Subcommands with the 'unsafe' prefix run the script in an instance "
634 "separate from the ruleset. This instance doesn't restrict access "
635 "to Lua functions that can be used to hack the computer running "
636 "the Freeciv server. Access to it is therefore limited to the console "
637 "and connections with cmdlevel 'hack'"), NULL,
643 N_(
"Cut a connection and disallow reconnect."),
644 N_(
"The connection given by the 'user' argument will be cut from the "
645 "server and not allowed to reconnect. The time the user wouldn't be "
646 "able to reconnect is controlled by the 'kicktime' setting."), NULL,
649 {
"delegate", ALLOW_BASIC,
651 N_(
"delegate to <username> [player-name]\n"
652 "delegate cancel [player-name]\n"
653 "delegate take <player-name>\n"
655 "delegate show <player-name>"),
656 N_(
"Delegate control to another user."),
657 N_(
"Delegation allows a user to nominate another user who can temporarily "
658 "take over control of their player while they are away.\n"
659 "'delegate to <username>': allow <username> to 'delegate take' your "
661 "'delegate cancel': nominated user can no longer take your player.\n"
662 "'delegate take <player-name>': take control of a player who has been "
663 "delegated to you. (Behaves like 'take', except that the 'allowtake' "
664 "restrictions are not enforced.)\n"
665 "'delegate restore': relinquish control of a delegated player (opposite "
666 "of 'delegate take') and restore your previous view, if any. (This also "
667 "happens automatically if the player's owner reconnects.)\n"
668 "'delegate show': show who control of your player is currently "
669 "delegated to, if anyone.\n"
670 "The [player-name] argument can only be used by connections with "
671 "cmdlevel 'admin' or above to force the corresponding change of the "
672 "delegation status."), NULL,
675 {
"aicmd", ALLOW_ADMIN,
677 N_(
"aicmd <player> <command>"),
678 N_(
"Execute AI command"),
679 N_(
"Execute a command in the context of the AI for the given player"),
683 {
"fcdb", ALLOW_ADMIN,
686 "fcdb lua <script>"),
687 N_(
"Manage the authentication database."),
688 N_(
"The argument 'reload' causes the database script file to be re-read "
689 "after a change, while the argument 'lua' evaluates a line of Lua "
690 "script in the context of the Lua instance for the database."), NULL,
693 {
"mapimg", ALLOW_ADMIN,
695 N_(
"mapimg define <mapdef>\n"
696 "mapimg show <id>|all\n"
697 "mapimg create <id>|all\n"
698 "mapimg delete <id>|all\n"
700 N_(
"Create image files of the world/player map."),
704 {
"rfcstyle", ALLOW_HACK,
707 N_(
"Switch server output between 'RFC-style' and normal style."), NULL, NULL,
710 {
"serverid", ALLOW_INFO,
713 N_(
"Simply returns the id of the server."), NULL, NULL,
733 return pcommand->
name;
781 return pcommand->
level;
789 return pcommand->
echo;
static struct command commands[]
enum cmd_echo command_echo(const struct command *pcommand)
#define SYN_TRANS_(String)
const char * command_name_by_number(int i)
const char * command_name(const struct command *pcommand)
int command_vote_percent(const struct command *pcommand)
#define SYN_ORIG_(String)
const struct command * command_by_number(int i)
int command_vote_flags(const struct command *pcommand)
const char * command_short_help(const struct command *pcommand)
char * command_extra_help(const struct command *pcommand)
enum cmdlevel command_level(const struct command *pcommand)
const char * command_synopsis(const struct command *pcommand)
char * ai_level_help(const char *cmdname)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
char * mapimg_help(const char *cmdname)
char *(* extra_help_func)(const char *cmdname)