Clarify character encoding arrangements, and stop claiming in various
[freeciv.git] / server / commands.h
blob96feed5ca764080a08f54474ea59e6b2d1c9b0cf
1 /**********************************************************************
2 Freeciv - Copyright (C) 1996-2004 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__COMMANDS_H
15 #define FC__COMMANDS_H
17 #include "connection.h" /* enum cmdlevel */
19 enum cmd_echo {
20 CMD_ECHO_NONE = 0,
21 CMD_ECHO_ADMINS, /* i.e. all with 'admin' access and above. */
22 CMD_ECHO_ALL,
25 /**************************************************************************
26 Commands - can be recognised by unique prefix
27 **************************************************************************/
28 /* Order here is important: for ambiguous abbreviations the first
29 match is used. Arrange order to:
30 - allow old commands 's', 'h', 'l', 'q', 'c' to work.
31 - reduce harm for ambiguous cases, where "harm" includes inconvenience,
32 eg accidently removing a player in a running game.
34 enum command_id {
35 /* old one-letter commands: */
36 CMD_START_GAME = 0,
37 CMD_HELP,
38 CMD_LIST,
39 CMD_QUIT,
40 CMD_CUT,
42 /* completely non-harmful: */
43 CMD_EXPLAIN,
44 CMD_SHOW,
45 CMD_WALL,
46 CMD_CONNECTMSG,
47 CMD_VOTE,
49 /* mostly non-harmful: */
50 CMD_DEBUG,
51 CMD_SET,
52 CMD_TEAM,
53 CMD_RULESETDIR,
54 CMD_METAMESSAGE,
55 CMD_METAPATCHES,
56 CMD_METACONN,
57 CMD_METASERVER,
58 CMD_AITOGGLE,
59 CMD_TAKE,
60 CMD_OBSERVE,
61 CMD_DETACH,
62 CMD_CREATE,
63 CMD_AWAY,
64 CMD_NOVICE,
65 CMD_EASY,
66 CMD_NORMAL,
67 CMD_HARD,
68 CMD_CHEATING,
69 CMD_EXPERIMENTAL,
70 CMD_CMDLEVEL,
71 CMD_FIRSTLEVEL,
72 CMD_TIMEOUT,
73 CMD_CANCELVOTE,
74 CMD_IGNORE,
75 CMD_UNIGNORE,
76 CMD_PLAYERCOLOR,
78 /* potentially harmful: */
79 CMD_END_GAME,
80 CMD_SURRENDER, /* not really harmful, info level */
81 CMD_REMOVE,
82 CMD_SAVE,
83 #ifdef DEBUG
84 CMD_SCENSAVE,
85 #endif
86 CMD_LOAD,
87 CMD_READ_SCRIPT,
88 CMD_WRITE_SCRIPT,
89 CMD_RESET,
90 CMD_LUA,
91 CMD_KICK,
92 CMD_DELEGATE,
93 CMD_FCDB,
94 CMD_MAPIMG,
96 /* undocumented */
97 CMD_RFCSTYLE,
98 CMD_SRVID,
100 /* pseudo-commands: */
101 CMD_NUM, /* the number of commands - for iterations */
102 CMD_UNRECOGNIZED, /* used as a possible iteration result */
103 CMD_AMBIGUOUS /* used as a possible iteration result */
106 const struct command *command_by_number(int i);
107 const char *command_name_by_number(int i);
109 const char *command_name(const struct command *pcommand);
110 const char *command_synopsis(const struct command *pcommand);
111 const char *command_short_help(const struct command *pcommand);
112 char *command_extra_help(const struct command *pcommand);
114 enum cmdlevel command_level(const struct command *pcommand);
115 enum cmd_echo command_echo(const struct command *pcommand);
116 int command_vote_flags(const struct command *pcommand);
117 int command_vote_percent(const struct command *pcommand);
119 #endif /* FC__COMMANDS_H */