Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/commands.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
commands.h
Go to the documentation of this file.
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.
7
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***********************************************************************/
13
14#ifndef FC__COMMANDS_H
15#define FC__COMMANDS_H
16
17/* common */
18#include "connection.h" /* enum cmdlevel */
19
20 enum cmd_echo {
21 CMD_ECHO_NONE = 0,
22 CMD_ECHO_ADMINS, /* i.e. all with 'admin' access and above. */
23 CMD_ECHO_ALL,
24};
25
26/**************************************************************************
27 Commands - can be recognised by unique prefix
28**************************************************************************/
29/* Order here is important: for ambiguous abbreviations the first
30 match is used. Arrange order to:
31 - allow old commands 's', 'h', 'l', 'q', 'c' to work.
32 - reduce harm for ambiguous cases, where "harm" includes inconvenience,
33 eg accidently removing a player in a running game.
34*/
35 enum command_id {
36 /* old one-letter commands: */
37 CMD_START_GAME = 0,
38 CMD_HELP,
39 CMD_LIST,
40 CMD_QUIT,
41 CMD_CUT,
42
43 /* completely non-harmful: */
44 CMD_EXPLAIN,
45 CMD_SHOW,
46 CMD_WALL,
47 CMD_CONNECTMSG,
48 CMD_VOTE,
49
50 /* mostly non-harmful: */
51 CMD_DEBUG,
52 CMD_SET,
53 CMD_TEAM,
54 CMD_RULESETDIR,
55 CMD_METAMESSAGE,
56 CMD_METAPATCHES,
57 CMD_METACONN,
58 CMD_METASERVER,
59 CMD_AITOGGLE,
60 CMD_TAKE,
61 CMD_OBSERVE,
62 CMD_DETACH,
63 CMD_CREATE,
64 CMD_AWAY,
65 CMD_RESTRICTED,
66 CMD_NOVICE,
67 CMD_EASY,
68 CMD_NORMAL,
69 CMD_HARD,
70 CMD_CHEATING,
71#ifdef FREECIV_DEBUG
72 CMD_EXPERIMENTAL,
73#endif
74 CMD_CMDLEVEL,
75 CMD_FIRSTLEVEL,
76 CMD_TIMEOUT,
77 CMD_CANCELVOTE,
78 CMD_IGNORE,
79 CMD_UNIGNORE,
80 CMD_PLAYERCOLOR,
81 CMD_PLAYERNATION,
82
83 /* potentially harmful: */
84 CMD_END_GAME,
85 CMD_SURRENDER, /* not really harmful, info level */
86 CMD_REMOVE,
87 CMD_SAVE,
88 CMD_SCENSAVE,
89 CMD_LOAD,
90 CMD_READ_SCRIPT,
91 CMD_WRITE_SCRIPT,
92 CMD_RESET,
93 CMD_DEFAULT,
94 CMD_LUA,
95 CMD_KICK,
96 CMD_DELEGATE,
97 CMD_AICMD,
98 CMD_FCDB,
99 CMD_MAPIMG,
100
101 CMD_LOCK,
102 CMD_UNLOCK,
103
104 /* undocumented */
105 CMD_RFCSTYLE,
106 CMD_SRVID,
107
108 /* pseudo-commands: */
109 CMD_NUM, /* the number of commands - for iterations */
110 CMD_UNRECOGNIZED, /* used as a possible iteration result */
111 CMD_AMBIGUOUS /* used as a possible iteration result */
112};
113
114const struct command *command_by_number(int i);
115const char *command_name_by_number(int i);
116
117const char *command_name(const struct command *pcommand);
118const char *command_synopsis(const struct command *pcommand);
119const char *command_short_help(const struct command *pcommand);
120char *command_extra_help(const struct command *pcommand);
121
122enum cmdlevel command_level(const struct command *pcommand);
123enum cmd_echo command_echo(const struct command *pcommand);
124int command_vote_flags(const struct command *pcommand);
125int command_vote_percent(const struct command *pcommand);
126
127#endif /* FC__COMMANDS_H */
command_id
command_id
Definition commands.h:35
CMD_NUM
@ CMD_NUM
Definition commands.h:109
CMD_UNLOCK
@ CMD_UNLOCK
Definition commands.h:102
CMD_IGNORE
@ CMD_IGNORE
Definition commands.h:78
CMD_LOCK
@ CMD_LOCK
Definition commands.h:101
CMD_METASERVER
@ CMD_METASERVER
Definition commands.h:58
CMD_END_GAME
@ CMD_END_GAME
Definition commands.h:84
CMD_DEFAULT
@ CMD_DEFAULT
Definition commands.h:93
CMD_METAPATCHES
@ CMD_METAPATCHES
Definition commands.h:56
CMD_TEAM
@ CMD_TEAM
Definition commands.h:53
CMD_DELEGATE
@ CMD_DELEGATE
Definition commands.h:96
CMD_CHEATING
@ CMD_CHEATING
Definition commands.h:70
CMD_PLAYERCOLOR
@ CMD_PLAYERCOLOR
Definition commands.h:80
CMD_LIST
@ CMD_LIST
Definition commands.h:39
CMD_AITOGGLE
@ CMD_AITOGGLE
Definition commands.h:59
CMD_CUT
@ CMD_CUT
Definition commands.h:41
CMD_EXPLAIN
@ CMD_EXPLAIN
Definition commands.h:44
CMD_SHOW
@ CMD_SHOW
Definition commands.h:45
CMD_METAMESSAGE
@ CMD_METAMESSAGE
Definition commands.h:55
CMD_RULESETDIR
@ CMD_RULESETDIR
Definition commands.h:54
CMD_HARD
@ CMD_HARD
Definition commands.h:69
CMD_RFCSTYLE
@ CMD_RFCSTYLE
Definition commands.h:105
CMD_DETACH
@ CMD_DETACH
Definition commands.h:62
CMD_NORMAL
@ CMD_NORMAL
Definition commands.h:68
CMD_RESTRICTED
@ CMD_RESTRICTED
Definition commands.h:65
CMD_VOTE
@ CMD_VOTE
Definition commands.h:48
CMD_NOVICE
@ CMD_NOVICE
Definition commands.h:66
CMD_UNRECOGNIZED
@ CMD_UNRECOGNIZED
Definition commands.h:110
CMD_TIMEOUT
@ CMD_TIMEOUT
Definition commands.h:76
CMD_CREATE
@ CMD_CREATE
Definition commands.h:63
CMD_LOAD
@ CMD_LOAD
Definition commands.h:89
CMD_AICMD
@ CMD_AICMD
Definition commands.h:97
CMD_AMBIGUOUS
@ CMD_AMBIGUOUS
Definition commands.h:111
CMD_LUA
@ CMD_LUA
Definition commands.h:94
CMD_FCDB
@ CMD_FCDB
Definition commands.h:98
CMD_CANCELVOTE
@ CMD_CANCELVOTE
Definition commands.h:77
CMD_SAVE
@ CMD_SAVE
Definition commands.h:87
CMD_SRVID
@ CMD_SRVID
Definition commands.h:106
CMD_SCENSAVE
@ CMD_SCENSAVE
Definition commands.h:88
CMD_START_GAME
@ CMD_START_GAME
Definition commands.h:37
CMD_UNIGNORE
@ CMD_UNIGNORE
Definition commands.h:79
CMD_FIRSTLEVEL
@ CMD_FIRSTLEVEL
Definition commands.h:75
CMD_WALL
@ CMD_WALL
Definition commands.h:46
CMD_EASY
@ CMD_EASY
Definition commands.h:67
CMD_KICK
@ CMD_KICK
Definition commands.h:95
CMD_WRITE_SCRIPT
@ CMD_WRITE_SCRIPT
Definition commands.h:91
CMD_CONNECTMSG
@ CMD_CONNECTMSG
Definition commands.h:47
CMD_TAKE
@ CMD_TAKE
Definition commands.h:60
CMD_HELP
@ CMD_HELP
Definition commands.h:38
CMD_REMOVE
@ CMD_REMOVE
Definition commands.h:86
CMD_OBSERVE
@ CMD_OBSERVE
Definition commands.h:61
CMD_RESET
@ CMD_RESET
Definition commands.h:92
CMD_SURRENDER
@ CMD_SURRENDER
Definition commands.h:85
CMD_METACONN
@ CMD_METACONN
Definition commands.h:57
CMD_READ_SCRIPT
@ CMD_READ_SCRIPT
Definition commands.h:90
CMD_CMDLEVEL
@ CMD_CMDLEVEL
Definition commands.h:74
CMD_SET
@ CMD_SET
Definition commands.h:52
CMD_AWAY
@ CMD_AWAY
Definition commands.h:64
CMD_QUIT
@ CMD_QUIT
Definition commands.h:40
CMD_DEBUG
@ CMD_DEBUG
Definition commands.h:51
CMD_PLAYERNATION
@ CMD_PLAYERNATION
Definition commands.h:81
CMD_MAPIMG
@ CMD_MAPIMG
Definition commands.h:99
cmd_echo
cmd_echo
Definition commands.h:20
CMD_ECHO_ADMINS
@ CMD_ECHO_ADMINS
Definition commands.h:22
CMD_ECHO_NONE
@ CMD_ECHO_NONE
Definition commands.h:21
CMD_ECHO_ALL
@ CMD_ECHO_ALL
Definition commands.h:23
command_echo
enum cmd_echo command_echo(const struct command *pcommand)
Definition commands.c:799
command_name_by_number
const char * command_name_by_number(int i)
Definition commands.c:751
command_name
const char * command_name(const struct command *pcommand)
Definition commands.c:743
command_vote_percent
int command_vote_percent(const struct command *pcommand)
Definition commands.c:815
command_by_number
const struct command * command_by_number(int i)
Definition commands.c:734
command_vote_flags
int command_vote_flags(const struct command *pcommand)
Definition commands.c:807
command_short_help
const char * command_short_help(const struct command *pcommand)
Definition commands.c:767
command_extra_help
char * command_extra_help(const struct command *pcommand)
Definition commands.c:776
command_level
enum cmdlevel command_level(const struct command *pcommand)
Definition commands.c:791
command_synopsis
const char * command_synopsis(const struct command *pcommand)
Definition commands.c:759
incite_cost
char * incite_cost
Definition comments.c:74
connection.h
command
Definition commands.c:37