Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9915) move server commands into commands file
Home

[Freeciv-Dev] (PR#9915) move server commands into commands file

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9915) move server commands into commands file
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Sep 2004 19:57:23 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9915 >

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9914 >
> 
> Currently server settings are declared in stdinhand_info.h.  The 
> variable is declared static inside this file.
> 
> This is very bad!  First of all it's totally unnecessary since the 
> variable can easily be made extern.  It's ugly since the header file 
> (which usually only has interface stuff) is full of this data.  And it's 
> dangerous since anyone can include this file and end up with a 
> duplicated copy of this structure.
> 
> This patch makes new files settings.c and settings.h.  The data is moved 
> into settings.c with the interface in settings.h.
> 
> Note there are other static values in stdinhand_info.  Perhaps a new set 
> of files commands.[ch] would be justified.

Here's a patch that moves the commands into commands.[ch].  It may 
conflict with the settings patch but not too much.

jason

? server/commands.c
? server/commands.h
Index: po/POTFILES.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/po/POTFILES.in,v
retrieving revision 1.68
diff -u -r1.68 POTFILES.in
--- po/POTFILES.in      31 Aug 2004 17:01:14 -0000      1.68
+++ po/POTFILES.in      3 Sep 2004 02:55:51 -0000
@@ -22,6 +22,7 @@
 server/citytools.c
 server/cityturn.c
 server/civserver.c
+server/commands.c
 server/connecthand.c
 server/console.c
 server/diplhand.c
Index: server/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/Makefile.am,v
retrieving revision 1.35
diff -u -r1.35 Makefile.am
--- server/Makefile.am  29 Aug 2004 19:08:59 -0000      1.35
+++ server/Makefile.am  3 Sep 2004 02:55:52 -0000
@@ -25,6 +25,8 @@
                citytools.h     \
                cityturn.c      \
                cityturn.h      \
+               commands.c      \
+               commands.h      \
                connecthand.c   \
                connecthand.h   \
                console.c       \
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.340
diff -u -r1.340 stdinhand.c
--- server/stdinhand.c  29 Aug 2004 19:08:59 -0000      1.340
+++ server/stdinhand.c  3 Sep 2004 02:55:52 -0000
@@ -45,6 +45,7 @@
 #include "version.h"
 
 #include "citytools.h"
+#include "commands.h"
 #include "connecthand.h"
 #include "console.h"
 #include "diplhand.h"
Index: server/stdinhand_info.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand_info.h,v
retrieving revision 1.1
diff -u -r1.1 stdinhand_info.h
--- server/stdinhand_info.h     29 Aug 2004 19:08:59 -0000      1.1
+++ server/stdinhand_info.h     3 Sep 2004 02:55:53 -0000
@@ -936,400 +936,4 @@
 
 #define SETTINGS_NUM (ARRAY_SIZE(settings)-1)
 
-/**************************************************************************
-  Commands - can be recognised by unique prefix
-**************************************************************************/
-struct command {
-  const char *name;             /* name - will be matched by unique prefix   */
-  enum cmdlevel_id level;      /* access level required to use the command  */
-  const char *synopsis;                /* one or few-line summary of usage */
-  const char *short_help;      /* one line (about 70 chars) description */
-  const char *extra_help;      /* extra help information; will be line-wrapped 
*/
-};
-
-/* Order here is important: for ambiguous abbreviations the first
-   match is used.  Arrange order to:
-   - allow old commands 's', 'h', 'l', 'q', 'c' to work.
-   - reduce harm for ambiguous cases, where "harm" includes inconvenience,
-     eg accidently removing a player in a running game.
-*/
-enum command_id {
-  /* old one-letter commands: */
-  CMD_START_GAME = 0,
-  CMD_HELP,
-  CMD_LIST,
-  CMD_QUIT,
-  CMD_CUT,
-
-  /* completely non-harmful: */
-  CMD_EXPLAIN,
-  CMD_SHOW,
-  CMD_SCORE,
-  CMD_WALL,
-  CMD_VOTE,
-  
-  /* mostly non-harmful: */
-  CMD_DEBUG,
-  CMD_SET,
-  CMD_TEAM,
-  CMD_RULESETDIR,
-  CMD_METAINFO,
-  CMD_METACONN,
-  CMD_METASERVER,
-  CMD_AITOGGLE,
-  CMD_TAKE,
-  CMD_OBSERVE,
-  CMD_DETACH,
-  CMD_CREATE,
-  CMD_AWAY,
-  CMD_NOVICE,
-  CMD_EASY,
-  CMD_NORMAL,
-  CMD_HARD,
-  CMD_EXPERIMENTAL,
-  CMD_CMDLEVEL,
-  CMD_FIRSTLEVEL,
-  CMD_TIMEOUT,
-
-  /* potentially harmful: */
-  CMD_END_GAME,
-  CMD_REMOVE,
-  CMD_SAVE,
-  CMD_LOAD,
-  CMD_READ_SCRIPT,
-  CMD_WRITE_SCRIPT,
-
-  /* undocumented */
-  CMD_RFCSTYLE,
-
-  /* pseudo-commands: */
-  CMD_NUM,             /* the number of commands - for iterations */
-  CMD_UNRECOGNIZED,    /* used as a possible iteration result */
-  CMD_AMBIGUOUS                /* used as a possible iteration result */
-};
-
-
-static const struct command commands[] = {
-  {"start",    ALLOW_CTRL,
-   "start",
-   N_("Start the game, or restart after loading a savegame."),
-   N_("This command starts the game.  When starting a new game, "
-      "it should be used after all human players have connected, and "
-      "AI players have been created (if required), and any desired "
-      "changes to initial server options have been made.  "
-      "After 'start', each human player will be able to "
-      "choose their nation, and then the game will begin.  "
-      "This command is also required after loading a savegame "
-      "for the game to recommence.  Once the game is running this command "
-      "is no longer available, since it would have no effect.")
-  },
-
-  {"help",     ALLOW_INFO,
-   /* TRANS: translate text between <> only */
-   N_("help\n"
-      "help commands\n"
-      "help options\n"
-      "help <command-name>\n"
-      "help <option-name>"),
-   N_("Show help about server commands and server options."),
-   N_("With no arguments gives some introductory help.  "
-      "With argument \"commands\" or \"options\" gives respectively "
-      "a list of all commands or all options.  "
-      "Otherwise the argument is taken as a command name or option name, "
-      "and help is given for that command or option.  For options, the help "
-      "information includes the current and default values for that option.  "
-      "The argument may be abbreviated where unambiguous.")
-  },
-
-  {"list",     ALLOW_INFO,
-   "list\n"
-   "list players\n"
-   "list connections",
-   N_("Show a list of players or connections."),
-   N_("Show a list of players, or a list of connections to the server.  "
-      "The argument may be abbreviated, and defaults to 'players' if absent.")
-  },
-  {"quit",     ALLOW_HACK,
-   "quit",
-   N_("Quit the game and shutdown the server."), NULL
-  },
-  {"cut",      ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("cut <connection-name>"),
-   N_("Cut a client's connection to server."),
-   N_("Cut specified client's connection to the server, removing that client "
-      "from the game.  If the game has not yet started that client's player "
-      "is removed from the game, otherwise there is no effect on the player.  "
-      "Note that this command now takes connection names, not player names.")
-  },
-  {"explain",  ALLOW_INFO,
-   /* TRANS: translate text between <> only */
-   N_("explain\n"
-      "explain <option-name>"),
-   N_("Explain server options."),
-   N_("The 'explain' command gives a subset of the functionality of 'help', "
-      "and is included for backward compatibility.  With no arguments it "
-      "gives a list of options (like 'help options'), and with an argument "
-      "it gives help for a particular option (like 'help <option-name>').")
-  },
-  {"show",     ALLOW_INFO,
-   /* TRANS: translate text between <> only */
-   N_("show\n"
-      "show <option-name>\n"
-      "show <option-prefix>"),
-   N_("Show server options."),
-   N_("With no arguments, shows all server options (or available options, when 
"
-      "used by clients).  With an argument, show only the named option, "
-      "or options with that prefix.")
-  },
-  {"score",    ALLOW_CTRL,
-   "score",
-   N_("Show current scores."),
-   N_("For each connected client, pops up a window showing the current "
-      "player scores.")
-  },
-  {"wall",     ALLOW_HACK,
-   N_("wall <message>"),
-   N_("Send message to all connections."),
-   N_("For each connected client, pops up a window showing the message "
-      "entered.")
-  },
-  {"vote",     ALLOW_INFO,
-   N_("vote yes|no [vote number]"),
-   N_("Cast a vote."),
-      /* xgettext:no-c-format */
-   N_("A player with info level access issueing a control level command "
-      "starts a new vote for given command.  /vote followed by "
-      "\"yes\" or \"no\", and optionally a vote number, "
-      "gives your vote.  If you do not add a vote number, your vote applies "
-      "to the latest command.  You can only suggest one vote at a time.  "
-      "Voting concludes after a full turn has passed or more than 50% of the "
-      "votes have been cast for or against.")
-  },
-  {"debug",    ALLOW_CTRL,
-   N_("debug [ player <player> | city <x> <y> | units <x> <y> | unit <id> ]"),
-   N_("Turn on or off AI debugging of given entity."),
-   N_("Print AI debug information about given entity and turn continous "
-      "debugging output for this entity on or off."),
-  },
-  {"set",      ALLOW_CTRL,
-   N_("set <option-name> <value>"),
-   N_("Set server option."), NULL
-  },
-  {"team",     ALLOW_CTRL,
-   N_("team <player> [team]"),
-   N_("Change, add or remove a player's team affiliation."),
-   N_("Sets a player as member of a team. If no team specified, the "
-      "player is set teamless. Use \"\" if names contain whitespace. "
-      "A team is a group of players that start out allied, with shared "
-      "vision and embassies, and fight together to achieve team victory "
-      "with averaged individual scores.")
-  },
-  {"rulesetdir", ALLOW_CTRL,
-   N_("rulesetdir <directory>"),
-   N_("Choose new ruleset directory or modpack."),
-   N_("Choose new ruleset directory or modpack. Calling this\n "
-      "without any arguments will show you the currently selected "
-      "ruleset.")
-  },
-  {"metainfo", ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("metainfo <meta-line>"),
-   N_("Set metaserver info line."), NULL
-  },
-  {"metaconnection",   ALLOW_HACK,
-   "metaconnection u|up\n"
-   "metaconnection d|down\n"
-   "metaconnection ?",
-   N_("Control metaserver connection."),
-   N_("'metaconnection ?' reports on the status of the connection to 
metaserver.\n"
-      "'metaconnection down' or 'metac d' brings the metaserver connection 
down.\n"
-      "'metaconnection up' or 'metac u' brings the metaserver connection up.")
-  },
-  {"metaserver",ALLOW_HACK,
-   /* TRANS: translate text between <> only */
-   N_("metaserver <address>"),
-   N_("Set address for metaserver to report to."), NULL
-  },
-  {"aitoggle", ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("aitoggle <player-name>"),
-   N_("Toggle AI status of player."), NULL
-  },
-  {"take",    ALLOW_INFO,
-   /* TRANS: translate text between [] and <> only */
-   N_("take [connection-name] <player-name>"),
-   N_("Take over a player's place in the game."),
-   N_("Only the console and connections with cmdlevel 'hack' can force "
-      "other connections to take over a player. If you're not one of these, "
-      "only the <player-name> argument is allowed")
-  },
-  {"observe",    ALLOW_INFO,
-   /* TRANS: translate text between [] and <> only */
-   N_("observe [connection-name] <player-name>"),
-   N_("Observe a player."),
-   N_("Only the console and connections with cmdlevel 'hack' can force "
-      "other connections to observe a player. If you're not one of these, "
-      "only the <player-name> argument is allowed")
-  },
-  {"detach",    ALLOW_INFO,
-   /* TRANS: translate text between <> only */
-   N_("detach <connection-name>"),
-   N_("detach from a player."),
-   N_("Only the console and connections with cmdlevel 'hack' can force "
-      "other connections to detach from a player.")
-  },
-  {"create",   ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("create <player-name>"),
-   N_("Create an AI player with a given name."),
-   N_("The 'create' command is only available before the game has "
-      "been started.")
-  },
-  {"away",     ALLOW_INFO,
-   N_("away\n"
-      "away"),
-   N_("Set yourself in away mode. The AI will watch your back."),
-   N_("The AI will govern your nation but do minimal changes."),
-  },
-  {"novice",   ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("novice\n"
-      "novice <player-name>"),
-   N_("Set one or all AI players to 'novice'."),
-   N_("With no arguments, sets all AI players to skill level 'novice', and "
-      "sets the default level for any new AI players to 'novice'.  With an "
-      "argument, sets the skill level for that player only.")
-  },
-  {"easy",     ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("easy\n"
-      "easy <player-name>"),
-   N_("Set one or all AI players to 'easy'."),
-   N_("With no arguments, sets all AI players to skill level 'easy', and "
-      "sets the default level for any new AI players to 'easy'.  With an "
-      "argument, sets the skill level for that player only.")
-  },
-  {"normal",   ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("normal\n"
-      "normal <player-name>"),
-   N_("Set one or all AI players to 'normal'."),
-   N_("With no arguments, sets all AI players to skill level 'normal', and "
-      "sets the default level for any new AI players to 'normal'.  With an "
-      "argument, sets the skill level for that player only.")
-  },
-  {"hard",     ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("hard\n"
-      "hard <player-name>"),
-   N_("Set one or all AI players to 'hard'."),
-   N_("With no arguments, sets all AI players to skill level 'hard', and "
-      "sets the default level for any new AI players to 'hard'.  With an "
-      "argument, sets the skill level for that player only.")
-  },
-  {"experimental",     ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("experimental\n"
-      "experimental <player-name>"),
-   N_("Set one or all AI players to 'experimental'."),
-   N_("With no arguments, sets all AI players to skill 'experimental', and "
-      "sets the default level for any new AI players to this.  With an "
-      "argument, sets the skill level for that player only. THIS IS ONLY "
-      "FOR TESTING OF NEW AI FEATURES! For ordinary servers, this option "
-      "has no effect.")
-  },
-  {"cmdlevel", ALLOW_HACK,  /* confusing to leave this at ALLOW_CTRL */
-   /* TRANS: translate text between <> only */
-   N_("cmdlevel\n"
-      "cmdlevel <level>\n"
-      "cmdlevel <level> new\n"
-      "cmdlevel <level> first\n"
-      "cmdlevel <level> <connection-name>"),
-   N_("Query or set command access level access."),
-   N_("The command access level controls which server commands are available\n"
-      "to users via the client chatline.  The available levels are:\n"
-      "    none  -  no commands\n"
-      "    info  -  informational commands only\n"
-      "    ctrl  -  commands that affect the game and users\n"
-      "    hack  -  *all* commands - dangerous!\n"
-      "With no arguments, the current command access levels are reported.\n"
-      "With a single argument, the level is set for all existing "
-      "connections,\nand the default is set for future connections.\n"
-      "If 'new' is specified, the level is set for newly connecting clients.\n"
-      "If 'first come' is specified, the 'first come' level is set; it will 
be\n"
-      "granted to the first client to connect, or if there are connections\n"
-      "already, the first client to issue the 'firstlevel' command.\n"
-      "If a connection name is specified, the level is set for that "
-      "connection only.\n"
-      "Command access levels do not persist if a client disconnects, "
-      "because some untrusted person could reconnect with the same name.  "
-      "Note that this command now takes connection names, not player names."
-      )
-  },
-  {"firstlevel", ALLOW_INFO,  /* Not really "informational", but needs to
-                                be ALLOW_INFO to be useful. */
-   "firstlevel",
-   N_("Grab the 'first come' command access level."),
-   N_("If 'cmdlevel first come' has been used to set a special 'first come'\n"
-      "command access level, this is the command to grab it with.")
-  },
-  {"timeoutincrease", ALLOW_CTRL, 
-   /* TRANS: translate text between <> only */
-   N_("timeoutincrease <turn> <turninc> <value> <valuemult>"), 
-   N_("See \"help timeoutincrease\"."),
-   N_("Every <turn> turns, add <value> to timeout timer, then add <turninc> "
-      "to <turn> and multiply <value> by <valuemult>.  Use this command in "
-      "concert with the option \"timeout\". Defaults are 0 0 0 1")
-  },
-  {"endgame",  ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("endgame <player1 player2 player3 ...>"),
-   N_("End the game.  If players are listed, these win the game."),
-   N_("This command ends the game immediately and credits the given players, "
-      "if any, with winning it.")
-  },
-  {"remove",   ALLOW_CTRL,
-   /* TRANS: translate text between <> only */
-   N_("remove <player-name>"),
-   N_("Fully remove player from game."),
-   N_("This *completely* removes a player from the game, including "
-      "all cities and units etc.  Use with care!")
-  },
-  {"save",     ALLOW_HACK,
-   /* TRANS: translate text between <> only */
-   N_("save\n"
-      "save <file-name>"),
-   N_("Save game to file."),
-   N_("Save the current game to file <file-name>.  If no file-name "
-      "argument is given saves to \"<auto-save name 
prefix><year>m.sav[.gz]\".\n"
-      "To reload a savegame created by 'save', start the server with "
-      "the command-line argument:\n"
-      "    --file <filename>\n"
-      "and use the 'start' command once players have reconnected.")
-  },
-  {"load",      ALLOW_HACK,
-   /* TRANS: translate text between <> only */
-   N_("load\n"
-      "load <file-name>"),
-   N_("Load game from file."),
-   N_("Load a game from <file-name>. Any current data including players, "
-      "rulesets and server options are lost.\n")
-  },
-  {"read",     ALLOW_HACK,
-   /* TRANS: translate text between <> only */
-   N_("read <file-name>"),
-   N_("Process server commands from file."), NULL
-  },
-  {"write",    ALLOW_HACK,
-   /* TRANS: translate text between <> only */
-   N_("write <file-name>"),
-   N_("Write current settings as server commands to file."), NULL
-  },
-  {"rfcstyle", ALLOW_HACK,
-   "rfcstyle",
-   N_("Switch server output between 'RFC-style' and normal style."), NULL
-  }
-};
-
 #endif
/********************************************************************** 
 Freeciv - Copyright (C) 1996-2004 - The Freeciv Project
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

/**************************************************************************
  Commands - can be recognised by unique prefix
**************************************************************************/
struct command {
  const char *name;       /* name - will be matched by unique prefix   */
  enum cmdlevel_id level; /* access level required to use the command  */
  const char *synopsis;   /* one or few-line summary of usage */
  const char *short_help; /* one line (about 70 chars) description */
  const char *extra_help; /* extra help information; will be line-wrapped */
};

/* Order here is important: for ambiguous abbreviations the first
   match is used.  Arrange order to:
   - allow old commands 's', 'h', 'l', 'q', 'c' to work.
   - reduce harm for ambiguous cases, where "harm" includes inconvenience,
     eg accidently removing a player in a running game.
*/
enum command_id {
  /* old one-letter commands: */
  CMD_START_GAME = 0,
  CMD_HELP,
  CMD_LIST,
  CMD_QUIT,
  CMD_CUT,

  /* completely non-harmful: */
  CMD_EXPLAIN,
  CMD_SHOW,
  CMD_SCORE,
  CMD_WALL,
  CMD_VOTE,
  
  /* mostly non-harmful: */
  CMD_DEBUG,
  CMD_SET,
  CMD_TEAM,
  CMD_RULESETDIR,
  CMD_METAINFO,
  CMD_METACONN,
  CMD_METASERVER,
  CMD_AITOGGLE,
  CMD_TAKE,
  CMD_OBSERVE,
  CMD_DETACH,
  CMD_CREATE,
  CMD_AWAY,
  CMD_NOVICE,
  CMD_EASY,
  CMD_NORMAL,
  CMD_HARD,
  CMD_EXPERIMENTAL,
  CMD_CMDLEVEL,
  CMD_FIRSTLEVEL,
  CMD_TIMEOUT,

  /* potentially harmful: */
  CMD_END_GAME,
  CMD_REMOVE,
  CMD_SAVE,
  CMD_LOAD,
  CMD_READ_SCRIPT,
  CMD_WRITE_SCRIPT,

  /* undocumented */
  CMD_RFCSTYLE,

  /* pseudo-commands: */
  CMD_NUM,              /* the number of commands - for iterations */
  CMD_UNRECOGNIZED,     /* used as a possible iteration result */
  CMD_AMBIGUOUS         /* used as a possible iteration result */
};

extern const struct command commands[];
/********************************************************************** 
 Freeciv - Copyright (C) 1996-2004 - The Freeciv Project
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "fcintl.h"

#include "connection.h"

#include "commands.h"

/* Commands must match the values in enum command_id. */
const struct command commands[] = {
  {"start",     ALLOW_CTRL,
   "start",
   N_("Start the game, or restart after loading a savegame."),
   N_("This command starts the game.  When starting a new game, "
      "it should be used after all human players have connected, and "
      "AI players have been created (if required), and any desired "
      "changes to initial server options have been made.  "
      "After 'start', each human player will be able to "
      "choose their nation, and then the game will begin.  "
      "This command is also required after loading a savegame "
      "for the game to recommence.  Once the game is running this command "
      "is no longer available, since it would have no effect.")
  },

  {"help",      ALLOW_INFO,
   /* TRANS: translate text between <> only */
   N_("help\n"
      "help commands\n"
      "help options\n"
      "help <command-name>\n"
      "help <option-name>"),
   N_("Show help about server commands and server options."),
   N_("With no arguments gives some introductory help.  "
      "With argument \"commands\" or \"options\" gives respectively "
      "a list of all commands or all options.  "
      "Otherwise the argument is taken as a command name or option name, "
      "and help is given for that command or option.  For options, the help "
      "information includes the current and default values for that option.  "
      "The argument may be abbreviated where unambiguous.")
  },

  {"list",      ALLOW_INFO,
   "list\n"
   "list players\n"
   "list connections",
   N_("Show a list of players or connections."),
   N_("Show a list of players, or a list of connections to the server.  "
      "The argument may be abbreviated, and defaults to 'players' if absent.")
  },
  {"quit",      ALLOW_HACK,
   "quit",
   N_("Quit the game and shutdown the server."), NULL
  },
  {"cut",       ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("cut <connection-name>"),
   N_("Cut a client's connection to server."),
   N_("Cut specified client's connection to the server, removing that client "
      "from the game.  If the game has not yet started that client's player "
      "is removed from the game, otherwise there is no effect on the player.  "
      "Note that this command now takes connection names, not player names.")
  },
  {"explain",   ALLOW_INFO,
   /* TRANS: translate text between <> only */
   N_("explain\n"
      "explain <option-name>"),
   N_("Explain server options."),
   N_("The 'explain' command gives a subset of the functionality of 'help', "
      "and is included for backward compatibility.  With no arguments it "
      "gives a list of options (like 'help options'), and with an argument "
      "it gives help for a particular option (like 'help <option-name>').")
  },
  {"show",      ALLOW_INFO,
   /* TRANS: translate text between <> only */
   N_("show\n"
      "show <option-name>\n"
      "show <option-prefix>"),
   N_("Show server options."),
   N_("With no arguments, shows all server options (or available options, when "
      "used by clients).  With an argument, show only the named option, "
      "or options with that prefix.")
  },
  {"score",     ALLOW_CTRL,
   "score",
   N_("Show current scores."),
   N_("For each connected client, pops up a window showing the current "
      "player scores.")
  },
  {"wall",      ALLOW_HACK,
   N_("wall <message>"),
   N_("Send message to all connections."),
   N_("For each connected client, pops up a window showing the message "
      "entered.")
  },
  {"vote",      ALLOW_INFO,
   N_("vote yes|no [vote number]"),
   N_("Cast a vote."),
      /* xgettext:no-c-format */
   N_("A player with info level access issueing a control level command "
      "starts a new vote for given command.  /vote followed by "
      "\"yes\" or \"no\", and optionally a vote number, "
      "gives your vote.  If you do not add a vote number, your vote applies "
      "to the latest command.  You can only suggest one vote at a time.  "
      "Voting concludes after a full turn has passed or more than 50% of the "
      "votes have been cast for or against.")
  },
  {"debug",     ALLOW_CTRL,
   N_("debug [ player <player> | city <x> <y> | units <x> <y> | unit <id> ]"),
   N_("Turn on or off AI debugging of given entity."),
   N_("Print AI debug information about given entity and turn continous "
      "debugging output for this entity on or off."),
  },
  {"set",       ALLOW_CTRL,
   N_("set <option-name> <value>"),
   N_("Set server option."), NULL
  },
  {"team",      ALLOW_CTRL,
   N_("team <player> [team]"),
   N_("Change, add or remove a player's team affiliation."),
   N_("Sets a player as member of a team. If no team specified, the "
      "player is set teamless. Use \"\" if names contain whitespace. "
      "A team is a group of players that start out allied, with shared "
      "vision and embassies, and fight together to achieve team victory "
      "with averaged individual scores.")
  },
  {"rulesetdir", ALLOW_CTRL,
   N_("rulesetdir <directory>"),
   N_("Choose new ruleset directory or modpack."),
   N_("Choose new ruleset directory or modpack. Calling this\n "
      "without any arguments will show you the currently selected "
      "ruleset.")
  },
  {"metainfo",  ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("metainfo <meta-line>"),
   N_("Set metaserver info line."), NULL
  },
  {"metaconnection",    ALLOW_HACK,
   "metaconnection u|up\n"
   "metaconnection d|down\n"
   "metaconnection ?",
   N_("Control metaserver connection."),
   N_("'metaconnection ?' reports on the status of the connection to 
metaserver.\n"
      "'metaconnection down' or 'metac d' brings the metaserver connection 
down.\n"
      "'metaconnection up' or 'metac u' brings the metaserver connection up.")
  },
  {"metaserver",ALLOW_HACK,
   /* TRANS: translate text between <> only */
   N_("metaserver <address>"),
   N_("Set address for metaserver to report to."), NULL
  },
  {"aitoggle",  ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("aitoggle <player-name>"),
   N_("Toggle AI status of player."), NULL
  },
  {"take",    ALLOW_INFO,
   /* TRANS: translate text between [] and <> only */
   N_("take [connection-name] <player-name>"),
   N_("Take over a player's place in the game."),
   N_("Only the console and connections with cmdlevel 'hack' can force "
      "other connections to take over a player. If you're not one of these, "
      "only the <player-name> argument is allowed")
  },
  {"observe",    ALLOW_INFO,
   /* TRANS: translate text between [] and <> only */
   N_("observe [connection-name] <player-name>"),
   N_("Observe a player."),
   N_("Only the console and connections with cmdlevel 'hack' can force "
      "other connections to observe a player. If you're not one of these, "
      "only the <player-name> argument is allowed")
  },
  {"detach",    ALLOW_INFO,
   /* TRANS: translate text between <> only */
   N_("detach <connection-name>"),
   N_("detach from a player."),
   N_("Only the console and connections with cmdlevel 'hack' can force "
      "other connections to detach from a player.")
  },
  {"create",    ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("create <player-name>"),
   N_("Create an AI player with a given name."),
   N_("The 'create' command is only available before the game has "
      "been started.")
  },
  {"away",      ALLOW_INFO,
   N_("away\n"
      "away"),
   N_("Set yourself in away mode. The AI will watch your back."),
   N_("The AI will govern your nation but do minimal changes."),
  },
  {"novice",    ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("novice\n"
      "novice <player-name>"),
   N_("Set one or all AI players to 'novice'."),
   N_("With no arguments, sets all AI players to skill level 'novice', and "
      "sets the default level for any new AI players to 'novice'.  With an "
      "argument, sets the skill level for that player only.")
  },
  {"easy",      ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("easy\n"
      "easy <player-name>"),
   N_("Set one or all AI players to 'easy'."),
   N_("With no arguments, sets all AI players to skill level 'easy', and "
      "sets the default level for any new AI players to 'easy'.  With an "
      "argument, sets the skill level for that player only.")
  },
  {"normal",    ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("normal\n"
      "normal <player-name>"),
   N_("Set one or all AI players to 'normal'."),
   N_("With no arguments, sets all AI players to skill level 'normal', and "
      "sets the default level for any new AI players to 'normal'.  With an "
      "argument, sets the skill level for that player only.")
  },
  {"hard",      ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("hard\n"
      "hard <player-name>"),
   N_("Set one or all AI players to 'hard'."),
   N_("With no arguments, sets all AI players to skill level 'hard', and "
      "sets the default level for any new AI players to 'hard'.  With an "
      "argument, sets the skill level for that player only.")
  },
  {"experimental",      ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("experimental\n"
      "experimental <player-name>"),
   N_("Set one or all AI players to 'experimental'."),
   N_("With no arguments, sets all AI players to skill 'experimental', and "
      "sets the default level for any new AI players to this.  With an "
      "argument, sets the skill level for that player only. THIS IS ONLY "
      "FOR TESTING OF NEW AI FEATURES! For ordinary servers, this option "
      "has no effect.")
  },
  {"cmdlevel",  ALLOW_HACK,  /* confusing to leave this at ALLOW_CTRL */
   /* TRANS: translate text between <> only */
   N_("cmdlevel\n"
      "cmdlevel <level>\n"
      "cmdlevel <level> new\n"
      "cmdlevel <level> first\n"
      "cmdlevel <level> <connection-name>"),
   N_("Query or set command access level access."),
   N_("The command access level controls which server commands are available\n"
      "to users via the client chatline.  The available levels are:\n"
      "    none  -  no commands\n"
      "    info  -  informational commands only\n"
      "    ctrl  -  commands that affect the game and users\n"
      "    hack  -  *all* commands - dangerous!\n"
      "With no arguments, the current command access levels are reported.\n"
      "With a single argument, the level is set for all existing "
      "connections,\nand the default is set for future connections.\n"
      "If 'new' is specified, the level is set for newly connecting clients.\n"
      "If 'first come' is specified, the 'first come' level is set; it will 
be\n"
      "granted to the first client to connect, or if there are connections\n"
      "already, the first client to issue the 'firstlevel' command.\n"
      "If a connection name is specified, the level is set for that "
      "connection only.\n"
      "Command access levels do not persist if a client disconnects, "
      "because some untrusted person could reconnect with the same name.  "
      "Note that this command now takes connection names, not player names."
      )
  },
  {"firstlevel", ALLOW_INFO,  /* Not really "informational", but needs to
                                 be ALLOW_INFO to be useful. */
   "firstlevel",
   N_("Grab the 'first come' command access level."),
   N_("If 'cmdlevel first come' has been used to set a special 'first come'\n"
      "command access level, this is the command to grab it with.")
  },
  {"timeoutincrease", ALLOW_CTRL, 
   /* TRANS: translate text between <> only */
   N_("timeoutincrease <turn> <turninc> <value> <valuemult>"), 
   N_("See \"help timeoutincrease\"."),
   N_("Every <turn> turns, add <value> to timeout timer, then add <turninc> "
      "to <turn> and multiply <value> by <valuemult>.  Use this command in "
      "concert with the option \"timeout\". Defaults are 0 0 0 1")
  },
  {"endgame",   ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("endgame <player1 player2 player3 ...>"),
   N_("End the game.  If players are listed, these win the game."),
   N_("This command ends the game immediately and credits the given players, "
      "if any, with winning it.")
  },
  {"remove",    ALLOW_CTRL,
   /* TRANS: translate text between <> only */
   N_("remove <player-name>"),
   N_("Fully remove player from game."),
   N_("This *completely* removes a player from the game, including "
      "all cities and units etc.  Use with care!")
  },
  {"save",      ALLOW_HACK,
   /* TRANS: translate text between <> only */
   N_("save\n"
      "save <file-name>"),
   N_("Save game to file."),
   N_("Save the current game to file <file-name>.  If no file-name "
      "argument is given saves to \"<auto-save name 
prefix><year>m.sav[.gz]\".\n"
      "To reload a savegame created by 'save', start the server with "
      "the command-line argument:\n"
      "    --file <filename>\n"
      "and use the 'start' command once players have reconnected.")
  },
  {"load",      ALLOW_HACK,
   /* TRANS: translate text between <> only */
   N_("load\n"
      "load <file-name>"),
   N_("Load game from file."),
   N_("Load a game from <file-name>. Any current data including players, "
      "rulesets and server options are lost.\n")
  },
  {"read",      ALLOW_HACK,
   /* TRANS: translate text between <> only */
   N_("read <file-name>"),
   N_("Process server commands from file."), NULL
  },
  {"write",     ALLOW_HACK,
   /* TRANS: translate text between <> only */
   N_("write <file-name>"),
   N_("Write current settings as server commands to file."), NULL
  },
  {"rfcstyle",  ALLOW_HACK,
   "rfcstyle",
   N_("Switch server output between 'RFC-style' and normal style."), NULL
  }
};


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9915) move server commands into commands file, Jason Short <=