Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/commands.h Source File

Freeciv-3.1

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#include "connection.h" /* enum cmdlevel */
18
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,
23};
24
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.
33*/
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,
41
42 /* completely non-harmful: */
43 CMD_EXPLAIN,
44 CMD_SHOW,
45 CMD_WALL,
46 CMD_CONNECTMSG,
47 CMD_VOTE,
48
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_RESTRICTED,
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,
80 CMD_PLAYERNATION,
81
82 /* potentially harmful: */
83 CMD_END_GAME,
84 CMD_SURRENDER, /* not really harmful, info level */
85 CMD_REMOVE,
86 CMD_SAVE,
87 CMD_SCENSAVE,
88 CMD_LOAD,
89 CMD_READ_SCRIPT,
90 CMD_WRITE_SCRIPT,
91 CMD_RESET,
92 CMD_DEFAULT,
93 CMD_LUA,
94 CMD_KICK,
95 CMD_DELEGATE,
96 CMD_AICMD,
97 CMD_FCDB,
98 CMD_MAPIMG,
99
100 /* undocumented */
101 CMD_RFCSTYLE,
102 CMD_SRVID,
103
104 /* pseudo-commands: */
105 CMD_NUM, /* the number of commands - for iterations */
106 CMD_UNRECOGNIZED, /* used as a possible iteration result */
107 CMD_AMBIGUOUS /* used as a possible iteration result */
108};
109
110const struct command *command_by_number(int i);
111const char *command_name_by_number(int i);
112
113const char *command_name(const struct command *pcommand);
114const char *command_synopsis(const struct command *pcommand);
115const char *command_short_help(const struct command *pcommand);
116char *command_extra_help(const struct command *pcommand);
117
118enum cmdlevel command_level(const struct command *pcommand);
119enum cmd_echo command_echo(const struct command *pcommand);
120int command_vote_flags(const struct command *pcommand);
121int command_vote_percent(const struct command *pcommand);
122
123#endif /* FC__COMMANDS_H */
command_id
command_id
Definition commands.h:34
CMD_NUM
@ CMD_NUM
Definition commands.h:105
CMD_IGNORE
@ CMD_IGNORE
Definition commands.h:77
CMD_METASERVER
@ CMD_METASERVER
Definition commands.h:57
CMD_END_GAME
@ CMD_END_GAME
Definition commands.h:83
CMD_DEFAULT
@ CMD_DEFAULT
Definition commands.h:92
CMD_METAPATCHES
@ CMD_METAPATCHES
Definition commands.h:55
CMD_TEAM
@ CMD_TEAM
Definition commands.h:52
CMD_DELEGATE
@ CMD_DELEGATE
Definition commands.h:95
CMD_CHEATING
@ CMD_CHEATING
Definition commands.h:69
CMD_PLAYERCOLOR
@ CMD_PLAYERCOLOR
Definition commands.h:79
CMD_LIST
@ CMD_LIST
Definition commands.h:38
CMD_AITOGGLE
@ CMD_AITOGGLE
Definition commands.h:58
CMD_CUT
@ CMD_CUT
Definition commands.h:40
CMD_EXPLAIN
@ CMD_EXPLAIN
Definition commands.h:43
CMD_SHOW
@ CMD_SHOW
Definition commands.h:44
CMD_METAMESSAGE
@ CMD_METAMESSAGE
Definition commands.h:54
CMD_RULESETDIR
@ CMD_RULESETDIR
Definition commands.h:53
CMD_HARD
@ CMD_HARD
Definition commands.h:68
CMD_RFCSTYLE
@ CMD_RFCSTYLE
Definition commands.h:101
CMD_DETACH
@ CMD_DETACH
Definition commands.h:61
CMD_NORMAL
@ CMD_NORMAL
Definition commands.h:67
CMD_RESTRICTED
@ CMD_RESTRICTED
Definition commands.h:64
CMD_VOTE
@ CMD_VOTE
Definition commands.h:47
CMD_NOVICE
@ CMD_NOVICE
Definition commands.h:65
CMD_UNRECOGNIZED
@ CMD_UNRECOGNIZED
Definition commands.h:106
CMD_TIMEOUT
@ CMD_TIMEOUT
Definition commands.h:75
CMD_CREATE
@ CMD_CREATE
Definition commands.h:62
CMD_LOAD
@ CMD_LOAD
Definition commands.h:88
CMD_AICMD
@ CMD_AICMD
Definition commands.h:96
CMD_AMBIGUOUS
@ CMD_AMBIGUOUS
Definition commands.h:107
CMD_LUA
@ CMD_LUA
Definition commands.h:93
CMD_FCDB
@ CMD_FCDB
Definition commands.h:97
CMD_CANCELVOTE
@ CMD_CANCELVOTE
Definition commands.h:76
CMD_SAVE
@ CMD_SAVE
Definition commands.h:86
CMD_SRVID
@ CMD_SRVID
Definition commands.h:102
CMD_SCENSAVE
@ CMD_SCENSAVE
Definition commands.h:87
CMD_START_GAME
@ CMD_START_GAME
Definition commands.h:36
CMD_UNIGNORE
@ CMD_UNIGNORE
Definition commands.h:78
CMD_FIRSTLEVEL
@ CMD_FIRSTLEVEL
Definition commands.h:74
CMD_WALL
@ CMD_WALL
Definition commands.h:45
CMD_EASY
@ CMD_EASY
Definition commands.h:66
CMD_KICK
@ CMD_KICK
Definition commands.h:94
CMD_WRITE_SCRIPT
@ CMD_WRITE_SCRIPT
Definition commands.h:90
CMD_CONNECTMSG
@ CMD_CONNECTMSG
Definition commands.h:46
CMD_TAKE
@ CMD_TAKE
Definition commands.h:59
CMD_HELP
@ CMD_HELP
Definition commands.h:37
CMD_REMOVE
@ CMD_REMOVE
Definition commands.h:85
CMD_OBSERVE
@ CMD_OBSERVE
Definition commands.h:60
CMD_RESET
@ CMD_RESET
Definition commands.h:91
CMD_SURRENDER
@ CMD_SURRENDER
Definition commands.h:84
CMD_METACONN
@ CMD_METACONN
Definition commands.h:56
CMD_READ_SCRIPT
@ CMD_READ_SCRIPT
Definition commands.h:89
CMD_CMDLEVEL
@ CMD_CMDLEVEL
Definition commands.h:73
CMD_SET
@ CMD_SET
Definition commands.h:51
CMD_AWAY
@ CMD_AWAY
Definition commands.h:63
CMD_QUIT
@ CMD_QUIT
Definition commands.h:39
CMD_DEBUG
@ CMD_DEBUG
Definition commands.h:50
CMD_PLAYERNATION
@ CMD_PLAYERNATION
Definition commands.h:80
CMD_MAPIMG
@ CMD_MAPIMG
Definition commands.h:98
cmd_echo
cmd_echo
Definition commands.h:19
CMD_ECHO_ADMINS
@ CMD_ECHO_ADMINS
Definition commands.h:21
CMD_ECHO_NONE
@ CMD_ECHO_NONE
Definition commands.h:20
CMD_ECHO_ALL
@ CMD_ECHO_ALL
Definition commands.h:22
command_echo
enum cmd_echo command_echo(const struct command *pcommand)
Definition commands.c:786
command_name_by_number
const char * command_name_by_number(int i)
Definition commands.c:738
command_name
const char * command_name(const struct command *pcommand)
Definition commands.c:730
command_vote_percent
int command_vote_percent(const struct command *pcommand)
Definition commands.c:802
command_by_number
const struct command * command_by_number(int i)
Definition commands.c:721
command_vote_flags
int command_vote_flags(const struct command *pcommand)
Definition commands.c:794
command_short_help
const char * command_short_help(const struct command *pcommand)
Definition commands.c:754
command_extra_help
char * command_extra_help(const struct command *pcommand)
Definition commands.c:763
command_level
enum cmdlevel command_level(const struct command *pcommand)
Definition commands.c:778
command_synopsis
const char * command_synopsis(const struct command *pcommand)
Definition commands.c:746
connection.h
command
Definition commands.c:37