webperimental: killstack decides stack protects.
[freeciv.git] / server / commands.h
blob15bdacc2ed90d52662188472d94851cd98bdcec4
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_HANDICAPPED,
65 CMD_NOVICE,
66 CMD_EASY,
67 CMD_NORMAL,
68 CMD_HARD,
69 CMD_CHEATING,
70 #ifdef FREECIV_DEBUG
71 CMD_EXPERIMENTAL,
72 #endif
73 CMD_CMDLEVEL,
74 CMD_FIRSTLEVEL,
75 CMD_TIMEOUT,
76 CMD_CANCELVOTE,
77 CMD_IGNORE,
78 CMD_UNIGNORE,
79 CMD_PLAYERCOLOR,
81 /* potentially harmful: */
82 CMD_END_GAME,
83 CMD_SURRENDER, /* not really harmful, info level */
84 CMD_REMOVE,
85 CMD_SAVE,
86 CMD_SCENSAVE,
87 CMD_LOAD,
88 CMD_READ_SCRIPT,
89 CMD_WRITE_SCRIPT,
90 CMD_RESET,
91 CMD_DEFAULT,
92 CMD_LUA,
93 CMD_KICK,
94 CMD_DELEGATE,
95 CMD_AICMD,
96 CMD_FCDB,
97 CMD_MAPIMG,
99 /* undocumented */
100 CMD_RFCSTYLE,
101 CMD_SRVID,
103 /* pseudo-commands: */
104 CMD_NUM, /* the number of commands - for iterations */
105 CMD_UNRECOGNIZED, /* used as a possible iteration result */
106 CMD_AMBIGUOUS /* used as a possible iteration result */
109 const struct command *command_by_number(int i);
110 const char *command_name_by_number(int i);
112 const char *command_name(const struct command *pcommand);
113 const char *command_synopsis(const struct command *pcommand);
114 const char *command_short_help(const struct command *pcommand);
115 char *command_extra_help(const struct command *pcommand);
117 enum cmdlevel command_level(const struct command *pcommand);
118 enum cmd_echo command_echo(const struct command *pcommand);
119 int command_vote_flags(const struct command *pcommand);
120 int command_vote_percent(const struct command *pcommand);
122 #endif /* FC__COMMANDS_H */