25#ifdef FREECIV_HAVE_LIBREADLINE
26#include <readline/readline.h>
96#define OPTION_NAME_SPACE 25
104#define SPECHASH_TAG kick
105#define SPECHASH_ASTR_KEY_TYPE
106#define SPECHASH_IDATA_TYPE time_t *
107#define SPECHASH_UDATA_TYPE time_t
108#define SPECHASH_IDATA_COPY time_duplicate
109#define SPECHASH_IDATA_FREE (kick_hash_data_free_fn_t) free
110#define SPECHASH_UDATA_TO_IDATA(t) (&(t))
111#define SPECHASH_IDATA_TO_UDATA(p) (NULL != p ? *p : 0)
178"------------------------------------------------------------------------------";
337 const char *cmdname = cmd <
CMD_NUM
349 "/%s: %s%s", cmdname, prefix,
line);
363 if (caller !=
pconn) {
369 if (
NULL != caller) {
405 const char *format, ...)
409 const char *format, ...)
441 _(
"Name is empty, so cannot be a player."));
445 _(
"Name is too long, so cannot be a player."));
449 _(
"Player name prefix '%s' is ambiguous."),
name);
453 _(
"No player by the name of '%s'."),
name);
457 _(
"Unexpected match_result %d (%s) for '%s'."),
459 log_error(
"Unexpected match_result %d (%s) for '%s'.",
476 _(
"Name is empty, so cannot be a connection."));
480 _(
"Name is too long, so cannot be a connection."));
484 _(
"Connection name prefix '%s' is ambiguous."),
name);
488 _(
"No connection by the name of '%s'."),
name);
492 _(
"Unexpected match_result %d (%s) for '%s'."),
494 log_error(
"Unexpected match_result %d (%s) for '%s'.",
508 _(
"Open metaserver connection to [%s]."),
521 _(
"Close metaserver connection to [%s]."),
538 _(
"Metaserver connection is open."));
541 _(
"Metaserver connection is closed."));
560 _(
"Metaserver connection is already open."));
571 _(
"Metaserver connection is already closed."));
576 _(
"Argument must be 'u', 'up', 'd', 'down', 'p', 'persistent', or '?'."));
586 char *arg,
bool check)
597 _(
"Metaserver patches string set to '%s'."), arg);
600 _(
"Metaserver patches string set to '%s', "
601 "not reporting to metaserver."), arg);
611 char *arg,
bool check)
616 "Set metamessage setting instead."));
626 _(
"Metaserver message string set to '%s'."), arg);
629 _(
"Metaserver message string set to '%s', "
630 "not reporting to metaserver."), arg);
677 _(
"You cannot save games manually on this server."));
694 _(
"You cannot save games manually on this server."));
712 _(
"%s is now under AI control."),
721 _(
"%s is now under human control."),
774 _(
"Wrong number of arguments to create command."));
833 _(
"A living user already exists by that name."));
841 _(
"A living player already exists by that name."));
848 _(
"Can't create player, requested nation %s not in "
849 "current nation set."),
856 _(
"Can't create players, nation %s conflicts with %s."),
867 _(
"Can't create players, no nations available."));
872 if (pplayer ==
NULL) {
885 _(
"Can't create players, no slots available."));
890 _(
"Maxplayers setting prevents creation of more players."));
907 _(
"%s is replacing dead player %s as an AI-controlled "
921 _(
"%s is replacing dead player %s as an AI-controlled "
1006 if (
name[0] ==
'\0') {
1023 _(
"A player already exists by that name."));
1028 _(
"A user already exists by that name."));
1035 if (
NULL == pplayer) {
1039 _(
"Can't add more players, server is full."));
1046 _(
"Can't add more players, not enough playable nations "
1047 "in current nation set (see 'nationset' setting)."));
1050 _(
"Can't add more players, not enough playable nations."));
1061 _(
"There is no AI type %s."), ai);
1078 _(
"%s replacing %s as an AI-controlled player."),
1089 _(
"Failed to create new player %s."),
name);
1094 _(
"%s has been added as an AI-controlled player (%s)."),
1132 if (
NULL == pplayer) {
1139 _(
"Command level '%s' or greater needed to remove a player "
1149 if (!caller || caller->
used) {
1151 _(
"Removed player %s from the game."),
name);
1199 log_error(
"Error: recursive calls to read!");
1217 _(
"Name \"%s\" disallowed for security reasons."),
1230 _(
"No command script found by the name \"%s\"."),
1257 if (
NULL != caller) {
1291 fputs(
"# These are server options saved from a running freeciv-server.\n",
1345 _(
"You cannot use the write command on this server"
1346 " for security reasons."));
1348 }
else if (!
check) {
1397 _(
"Cannot decrease command access level '%s' "
1398 "for connection '%s'; you only have '%s'."),
1406 _(
"Command access level set to '%s' for connection %s."),
1456 _(
"Anyone can now become game organizer "
1457 "'%s' by issuing the 'first' command."),
1480 _(
"Command access levels in effect:"));
1493 _(
"Command access level for new connections: %s"),
1496 _(
"Command access level for first player to take it: %s"),
1515 _(
"Command access level must be one of %s."),
1521 _(
"Cannot increase command access level to '%s';"
1522 " you only have '%s' yourself."),
1534 if (
pconn != caller) {
1548 _(
"Command access level set to '%s' for new players."),
1553 _(
"Command access level set to '%s' "
1554 "for first player to grab it."),
1562 _(
"Command access level set to '%s' for new players."),
1567 _(
"Command access level set to '%s' "
1568 "for first player to grab it."),
1577 _(
"Command access level set to '%s' "
1578 "for first player to grab it."),
1583 _(
"Command access level set to '%s' for new players."),
1612 _(
"The 'first' command makes no sense from the server command line."));
1616 _(
"You already have command access level '%s' or better."),
1621 _(
"Someone else is already game organizer."));
1623 }
else if (!
check) {
1626 _(
"Connection %s has opted to become the game organizer."),
1639 _(
"Default cmdlevel lowered to 'basic' on game start."));
1653#ifdef FREECIV_HAVE_LIBREADLINE
1660 return "rulesetdir";
1730#define LOOKUP_OPTION_NO_RESULT (-1)
1731#define LOOKUP_OPTION_AMBIGUOUS (-2)
1732#define LOOKUP_OPTION_LEVEL_NAME (-3)
1733#define LOOKUP_OPTION_RULESETDIR (-4)
1758 }
else if (
'\0' !=
name[0]
1800 ?
_(
"changeable") :
_(
"fixed")));
1838 _(
"Possible values (option can take any number of these):"));
1866 _(
"Explanations are available for the following server options:"));
1880 if ((++j % 4) == 0) {
1887 if (
buf[0] !=
'\0') {
1911 _(
"No explanation for that yet."));
1934 _(
"Server Operator: %s"),
str);
1955 if (
str[
i] ==
'\\') {
1958 if (
str[
i] ==
'n') {
1973 _(
"Connectmsg truncated to %u bytes."),
bufsize);
2010 _(
"Player '%s' now has AI skill level '%s'."),
2041 if (
is_ai(pplayer)) {
2048 _(
"Player '%s' now has AI skill level '%s'."),
2053 _(
"%s is not controlled by the AI."),
2066 _(
"Player '%s' now has AI skill level '%s'."),
2074 _(
"Default AI skill level set to '%s'."),
2090 if (caller ==
NULL) {
2098 _(
"Only players may use the away command."));
2171 if (
str[0] !=
'\0') {
2181 _(
"Sorry, you do not have access to view option '%s'."),
2203 _(
"Current ruleset directory is \"%s\""),
2218#define cmd_reply_show(string) \
2219 cmd_reply(called_as, caller, C_COMMENT, "%s", string)
2227 heading =
_(
"All options with non-default values");
2236 heading =
_(
"Situational options");
2239 heading =
_(
"Rarely used options");
2242 heading =
_(
"Options locked by the ruleset");
2254 cmd_reply_show(
_(
"In the column '##' the status of the option is shown:"));
2255 cmd_reply_show(
_(
" - a '!' means the option is locked by the ruleset."));
2257 cmd_reply_show(
_(
" - a '~' means that option follows default value."));
2304 cmd_reply_show(
_(
"A help text for each option is available via 'help "
2310 "Try 'show changed' to show settings with "
2311 "non-default values.\n"
2312 "Try 'show locked' to show settings locked "
2313 "by the ruleset."));
2318#undef cmd_reply_show
2350 if (prefix[0] ==
'\0') {
2351 memset(prefix,
' ',
sizeof(prefix)-1);
2410 _(
"Cannot change teams once game has begun."));
2420 _(
"Undefined argument. Usage:\n%s"),
2426 if (pplayer ==
NULL) {
2442 _(
"No such team %s. Please give a "
2443 "valid team name or number."), arg[1]);
2490 _(
"%s %d \"%s\" (needs %0.0f%%%s): %d for, "
2491 "%d against, and %d abstained out of %d players."),
2493 MIN(100,
pvote->need_pc * 100 + 1),
2503 _(
"There are no votes going on."));
2548 _(
"You are not allowed to use this command."));
2557 _(
"The argument \"%s\" is ambiguous."), arg[0]);
2562 _(
"Undefined argument. Usage:\n%s"),
2578 num_votes,
PL_(
"other vote running",
"other votes running",
2598 _(
"You are not allowed to vote on that."));
2612 _(
"You abstained from voting on \"%s\""),
pvote->cmdline);
2630 char *arg,
bool check)
2644 if (arg[0] ==
'\0') {
2645 if (caller ==
NULL) {
2649 _(
"Missing argument <vote number> or "
2650 "the string \"all\"."));
2656 _(
"You don't have any vote going on."));
2663 _(
"There isn't any vote going on."));
2669 _(
"All votes have been removed."));
2673 _(
"You are not allowed to use this command."));
2685 && caller->
id !=
pvote->caller_id) {
2688 _(
"You are not allowed to cancel this vote (%d)."),
2695 _(
"Usage: /cancelvote [<vote number>|all]"));
2705 _(
"%s has canceled the vote \"%s\" (number %d)."),
2712 _(
"The vote \"%s\" (number %d) has been canceled."),
2733 _(
"Can only use this command once game has begun."));
2753 _(
"Undefined argument. Usage:\n%s"),
2758 if (pplayer ==
NULL) {
2778 _(
"Undefined argument. Usage:\n%s"),
2783 if (pplayer ==
NULL) {
2808 log_normal(
_(
"players=%d cities=%d citizens=%d units=%d"),
2811 _(
"players=%d cities=%d citizens=%d units=%d"),
2820 _(
"Undefined argument. Usage:\n%s"),
2851 _(
"Undefined argument. Usage:\n%s"),
2893 _(
"Undefined argument. Usage:\n%s"),
2918 _(
"Undefined argument. Usage:\n%s"),
2950 _(
"Use the '%srulesetdir' command to change the ruleset "
2951 "directory."), caller ?
"/" :
"");
2980 _(
"Undefined argument. Usage:\n%s"),
3022 _(
"The parameter %s should only contain +- and 0-9."),
3155 _(
"Undefined argument. Usage:\n%s"),
3183 _(
"Undefined argument. Usage:\n%s"),
3217 fc_strlcpy(msg,
_(
"You cannot take a new player at this time."),
3225 PL_(
"You cannot take a new player because "
3226 "the maximum of %d player has already "
3227 "been reached (maxplayers setting).",
3228 "You cannot take a new player because "
3229 "the maximum of %d players has already "
3230 "been reached (maxplayers setting).",
3237 fc_strlcpy(msg,
_(
"You cannot take a new player because there "
3238 "are no free player slots."),
3262 fc_strlcpy(msg,
_(
"Sorry, one can't observe globally in this game."),
3270 _(
"Sorry, one can't observe barbarians in this game."),
3273 fc_strlcpy(msg,
_(
"Sorry, one can't take barbarians in this game."),
3282 _(
"Sorry, one can't observe dead players in this game."),
3286 _(
"Sorry, one can't take dead players in this game."),
3291 }
else if (
is_ai(pplayer)) {
3296 _(
"Sorry, one can't observe AI players in this game."),
3299 fc_strlcpy(msg,
_(
"Sorry, one can't take AI players in this game."),
3309 _(
"Sorry, one can't observe human players in this game."),
3313 _(
"Sorry, one can't take human players in this game."),
3328 fc_strlcpy(msg,
_(
"Sorry, one can't take players in this game."),
3335 fc_strlcpy(msg,
_(
"Sorry, one can't take players already "
3336 "connected in this game."),
msg_len);
3372 _(
"Only the player name form is allowed."));
3417 && pplayer ==
pconn->playing
3422 _(
"%s already controls %s. Using 'observe' would remove %s"),
3430 if (pplayer ==
pconn->playing &&
pconn->observer) {
3433 _(
"%s is already observing %s."),
3438 _(
"%s is already observing."),
3512 if (!caller &&
ntokens != 2) {
3520 _(
"Only the player name form is allowed."));
3538 if (
strcmp(arg[
i],
"-") == 0) {
3541 _(
"You cannot issue \"/take -\" when "
3542 "the game has already started."));
3566 "'%s'. /take not possible."),
3578 if ((
NULL != pplayer && !
pconn->observer && pplayer ==
pconn->playing)
3590 if (!pplayer && !
pconn->playing
3594 _(
"There is no free player slot for %s."),
3608 if (
NULL == caller) {
3610 _(
"Reassigned nation to %s by server console."),
3614 _(
"Reassigned nation to %s by %s."),
3622 if (!
aconn->observer) {
3650 pplayer =
pconn->playing;
3666 _(
"%s failed to attach to any player."),
3697 if (!caller &&
ntokens == 0) {
3719 _(
"You can not detach other users."));
3723 pplayer =
pconn->playing;
3726 if (!pplayer && !
pconn->observer) {
3799 if (!filename || filename[0] ==
'\0') {
3806 _(
"Cannot load a game while another is running."));
3811 _(
"Name \"%s\" disallowed for security reasons."),
3822 const char *
exts[] = {
3823 "sav",
"gz",
"bz2",
"xz",
"sav.gz",
"sav.bz2",
"sav.xz",
"sav.zst",
NULL
3826 const struct strvec **path;
3835 for (path =
paths; !
found && *path; path++) {
3843 for (path =
paths; !
found && *path; path++) {
3855 "scenario with the name \"%s\"."), filename);
3883 }
else if (
pconn->observer) {
3909 log_verbose(
"Load time: %g seconds (%g apparent)",
3916 log_verbose(
"load_command() does send_rulesets()");
3936 if (
strcmp(
pconn->username, pplayer->username) == 0) {
3960 pack.first = (
pach->first == pplayer);
3986 _(
"You must provide a ruleset name. Use \"/show ruleset\" to "
3987 "see what is the current ruleset."));
3993 _(
"Changing ruleset not allowed. It was locked from the commandline."));
4000 _(
"This setting can't be modified after the game has started."));
4005 _(
"The ruleset of \"%s\" can be changed by switching to a"
4006 " compatible ruleset before loading it."),
4014 _(
"Ruleset directory is already \"%s\""),
str);
4021 _(
"Name \"%s\" disallowed for security reasons."),
4030 _(
"Ruleset directory \"%s\" not found"),
str);
4039 log_verbose(
"set_rulesetdir() does load_rulesets() with \"%s\"",
str);
4063 _(
"Ruleset directory set to \"%s\""),
str);
4066 _(
"Failed loading rulesets from directory \"%s\", using \"%s\""),
4084 if (
NULL == caller) {
4086 _(
"That would be rather silly, since you are not a player."));
4093 _(
"%s. Try /help ignore"),
buf);
4105 _(
"Added pattern %s as entry %d to your ignore list."),
4122 _(
"That would be rather silly, since you are not a player."));
4136 if (
'\0' ==
buf[0]) {
4138 _(
"Missing range. Try /help unignore."));
4142 if (
'\0' ==
buf[0]) {
4147 _(
"\"%s\" is not a valid range. Try /help unignore."),
buf);
4155 _(
"\"%s\" is not a valid range. Try /help unignore."),
buf);
4161 _(
"\"%s\" is not a valid range. Try /help unignore."),
buf);
4167 if (!(1 <= first && first <= last && last <=
n)) {
4168 if (first == last) {
4170 _(
"Invalid entry number: %d."), first);
4173 _(
"Invalid range: %d to %d."), first, last);
4187 _(
"Removed pattern %s (entry %d) from your ignore list."),
4217 _(
"Two arguments needed. See '/help playercolor'."));
4244 _(
"Can only unset player color before game starts."));
4250 _(
"Invalid player color definition. See '/help playercolor'."));
4261 _(
"Warning: new color [%s] for %s is identical to %s."),
4274 _(
"Color of player %s set to [%s]."),
player_name(pplayer),
4295 bool is_male =
FALSE;
4303 _(
"At least one argument needed. See '/help playernation'."));
4310 _(
"Can only set player nation before game starts."));
4327 _(
"Nation of player %s reset."),
player_name(pplayer));
4334 _(
"Unrecognized nation: %s."), token[1]);
4341 _(
"%s nation is not available for user selection."),
4349 _(
"%s nation is already in use."), token[1]);
4357 _(
"Leader sex must be given when setting nation."));
4362 if (!
strcmp(token[2],
"0")) {
4364 }
else if (!
strcmp(token[2],
"1")) {
4368 _(
"Unrecognized gender: %s, expecting 1 or 0."), token[2]);
4377 _(
"Unrecognized style: %s."), token[4]);
4401 _(
"Nation of player %s set to [%s]."),
player_name(pplayer),
4485 if (!
check && caller) {
4492 _(
"Sorry, you are not allowed to use server commands."));
4517 _(
"Warning: '%s' interpreted as '%s', but it is ambiguous."
4523 caller ?
"/" :
"",
command, caller ?
"/" :
"");
4549 _(
"Your new vote canceled your previous vote."));
4556 what =
_(
"New teamvote");
4561 what =
_(
"New vote");
4568 _(
"%s (number %d) by %s: %s"),
what,
4578 _(
"Your new vote (\"%s\") was not "
4590 _(
"You are not allowed to use this command."));
4623 "%s: '%s %s'",
_(
"(server prompt)"),
command, arg);
4755 log_error(
"Unknown command variant: %d.", cmd);
4769 _(
"Game is over."));
4773 _(
"Ending the game. The server will restart once all clients "
4774 "have disconnected."));
4778 _(
"Cannot end the game: no game running."));
4793 _(
"You are not allowed to use this command."));
4805 _(
"You have already conceded the game."));
4814 _(
"%s has conceded the game and can no longer win."),
4821#define SPECENUM_NAME reset_args
4822#define SPECENUM_VALUE0 RESET_GAME
4823#define SPECENUM_VALUE0NAME "game"
4824#define SPECENUM_VALUE1 RESET_RULESET
4825#define SPECENUM_VALUE1NAME "ruleset"
4826#define SPECENUM_VALUE2 RESET_SCRIPT
4827#define SPECENUM_VALUE2NAME "script"
4828#define SPECENUM_VALUE3 RESET_DEFAULT
4829#define SPECENUM_VALUE3NAME "default"
4865 _(
"Guessing argument 'ruleset'."));
4869 _(
"Guessing argument 'game'."));
4877 _(
"The valid arguments are: 'game', 'ruleset', 'script' "
4892 _(
"Reset all settings to the values at the game start."));
4895 _(
"No saved settings from the game start available."));
4908 _(
"Reset all settings to ruleset values."));
4911 _(
"Failed to reset settings to ruleset values."));
4917 _(
"Reset all settings and rereading the server start "
4924 if (
NULL != caller) {
4926 _(
"Could not read script file '%s'."),
4935 _(
"Reset all settings to default values."));
4973 _(
"Option '%s' reset to default value, and will track any "
4974 "default changes."), arg);
4981#define SPECENUM_NAME lua_args
4982#define SPECENUM_VALUE0 LUA_CMD
4983#define SPECENUM_VALUE0NAME "cmd"
4984#define SPECENUM_VALUE1 LUA_FILE
4985#define SPECENUM_VALUE1NAME "file"
4986#define SPECENUM_VALUE2 LUA_UNSAFE_CMD
4987#define SPECENUM_VALUE2NAME "unsafe-cmd"
4988#define SPECENUM_VALUE3 LUA_UNSAFE_FILE
4989#define SPECENUM_VALUE3NAME "unsafe-file"
5038 _(
"Fall back to old syntax '%slua <script command>'."),
5048 _(
"No lua command or lua script file. See '%shelp lua'."),
5061 _(
"Unsafe Lua code can only be run by explicit command."));
5066 _(
"You aren't allowed to run unsafe Lua code."));
5074 _(
"Unsafe Lua code can only be run by explicit command."));
5079 _(
"You aren't allowed to run unsafe Lua code."));
5098 _(
"Freeciv script '%s' disallowed for security reasons."),
5112 _(
"No Freeciv script found by the name '%s'."),
5169#define SPECENUM_NAME delegate_args
5170#define SPECENUM_VALUE0 DELEGATE_CANCEL
5171#define SPECENUM_VALUE0NAME "cancel"
5172#define SPECENUM_VALUE1 DELEGATE_RESTORE
5173#define SPECENUM_VALUE1NAME "restore"
5174#define SPECENUM_VALUE2 DELEGATE_SHOW
5175#define SPECENUM_VALUE2NAME "show"
5176#define SPECENUM_VALUE3 DELEGATE_TAKE
5177#define SPECENUM_VALUE3NAME "take"
5178#define SPECENUM_VALUE4 DELEGATE_TO
5179#define SPECENUM_VALUE4NAME "to"
5202 const char *username =
NULL;
5207 "cannot delegate yet."));
5262 _(
"Valid arguments for 'delegate' are: %s."),
buf);
5282 _(
"Command level '%s' or greater needed to modify "
5291 _(
"Please specify a player for whom delegation should "
5302 _(
"You can't switch players from the console."));
5321 _(
"Please specify a player for whom the delegation should "
5332 _(
"You can't switch players from the console."));
5346 _(
"Please specify a player to take control of."));
5368 _(
"Please specify a user to whom control is to be delegated."));
5389 _(
"Command level '%s' or greater or special permission "
5390 "needed to modify others' delegations."),
5399 _(
"You do not control a player."));
5424 _(
"Can't delegate control of '%s' belonging to %s while "
5425 "they are controlling another player."),
5430 _(
"Can't change delegation of '%s' while controlled by "
5437 _(
"You can't delegate control while you are controlling "
5438 "a delegated player yourself."));
5451 _(
"%s already owns '%s', so cannot also be delegate. "
5452 "Use '%sdelegate cancel' to cancel an existing "
5460 _(
"You can't delegate control to yourself. "
5461 "Use '/delegate cancel' to cancel an existing "
5473 _(
"Control of player '%s' delegated to user %s."),
5485 _(
"No delegation defined for '%s'."),
5489 _(
"Control of player '%s' delegated to user %s."),
5499 _(
"No delegation defined for '%s'."),
5515 log_error(
"Failed to restore %s's connection as %s during "
5516 "'delegate cancel'.",
pdelegate->username,
5518 pdelegate->server.delegation.observer));
5524 _(
"Your delegated control of player '%s' was canceled."),
5542 _(
"You are already controlling a delegated player. "
5543 "Use '/delegate restore' to relinquish control of your "
5544 "current player first."));
5556 _(
"Can't take player while you have delegated control "
5557 "yourself. Use '/delegate cancel' to cancel your own "
5558 "delegation first."));
5575 _(
"Control of player '%s' has not been delegated to you."),
5584 _(
"Another user already controls player '%s'."),
5592 log_error(
"%s failed to take control of '%s' during 'delegate take'.",
5600 _(
"%s is now controlling player '%s'."), caller->
username,
5612 _(
"You are not currently controlling a delegated player."));
5619 log_error(
"Failed to restore %s's connection as %s during "
5620 "'delegate restore'.", caller->
username,
5631 _(
"%s is now connected as %s."), caller->
username,
5655 }
else if (observer) {
5667#define SPECENUM_NAME mapimg_args
5668#define SPECENUM_VALUE0 MAPIMG_COLORTEST
5669#define SPECENUM_VALUE0NAME "colortest"
5670#define SPECENUM_VALUE1 MAPIMG_CREATE
5671#define SPECENUM_VALUE1NAME "create"
5672#define SPECENUM_VALUE2 MAPIMG_DEFINE
5673#define SPECENUM_VALUE2NAME "define"
5674#define SPECENUM_VALUE3 MAPIMG_DELETE
5675#define SPECENUM_VALUE3NAME "delete"
5676#define SPECENUM_VALUE4 MAPIMG_SHOW
5677#define SPECENUM_VALUE4NAME "show"
5678#define SPECENUM_COUNT MAPIMG_COUNT
5714 _(
"Ambiguous 'mapimg' command."));
5740 _(
"The valid arguments are: %s."),
buf);
5755 _(
"Missing argument for 'mapimg define'."));
5779 "definition %d: '%s'."),
5788 _(
"Missing argument for 'mapimg delete'."));
5801 }
else if (
ntokens == 2 &&
sscanf(token[1],
"%d", &
id) != 0) {
5817 _(
"Bad argument for 'mapimg delete': '%s'."), token[1]);
5829 }
else if (
ntokens == 2 &&
sscanf(token[1],
"%d", &
id) != 0) {
5845 _(
"Bad argument for 'mapimg show': '%s'."), token[1]);
5862 _(
"Missing argument for 'mapimg create'."));
5867 if (
strcmp(token[1],
"all") == 0) {
5884 }
else if (
sscanf(token[1],
"%d", &
id) != 0) {
5902 _(
"Bad argument for 'mapimg create': '%s'."), token[1]);
5930 _(
"No player given for aicmd."));
5936 if (
NULL == pplayer) {
5947 _(
"No command for the AI console defined."));
5958 if (pplayer && pplayer->
ai) {
5961 _(
"AI console for player %s. Command: '%s'."),
5967 _(
"No AI console defined for the AI '%s' of player %s."),
5981#define SPECENUM_NAME fcdb_args
5982#define SPECENUM_VALUE0 FCDB_RELOAD
5983#define SPECENUM_VALUE0NAME "reload"
5984#define SPECENUM_VALUE1 FCDB_LUA
5985#define SPECENUM_VALUE1NAME "lua"
5986#define SPECENUM_COUNT FCDB_COUNT
6011 _(
"Freeciv database script deactivated at compile time."));
6018 _(
"Freeciv database script not activated at server start. "
6019 "See the Freeciv server's --auth command line option."));
6037 _(
"Ambiguous fcdb command."));
6067 _(
"The valid arguments are: %s."),
buf);
6129 log_verbose(
"Reduced maxplayers from %d to %d to fit "
6130 "to the number of start positions.",
6149 log_verbose(
"Had to cut down the number of players to the "
6150 "number of map start positions, there must be "
6151 "something wrong with the savegame or you "
6152 "adjusted the maxplayers value.");
6171 _(
"Not enough human players ('minplayers' server setting has value %d); game will not start."),
6178 _(
"No players; game will not start."));
6183 _(
"Not enough nations in the current nation set "
6184 "for all players; game will not start. "
6185 "(See 'nationset' setting.)"));
6188 _(
"Not enough nations for all players; game will "
6194 _(
"Neither 'startcity' nor 'startunits' setting gives "
6195 "players anything to start game with; game will "
6200 }
else if (!caller) {
6205 _(
"All players are ready; starting game."));
6221 _(
"Cannot start the game: the game is waiting for all clients "
6228 _(
"Cannot start the game: it is already running."));
6348 if (
pconn == caller) {
6372 _(
"There must be at least %d unique connections to the "
6415 _(
"Welcome - this is the introductory help text for the Freeciv "
6418 "Two important server concepts are Commands and Options. Commands, "
6419 "such as 'help', are used to interact with the server. Some commands "
6420 "take one or more arguments, separated by spaces. In many cases "
6421 "commands and command arguments may be abbreviated. Options are "
6422 "settings which control the server as it is running.\n"
6424 "To find out how to get more information about commands and options, "
6425 "use 'help help'.\n"
6427 "For the impatient, the main commands to get going are:\n"
6428 " show - to see current options\n"
6429 " set - to set options\n"
6430 " start - to start the game once players have connected\n"
6431 " save - to save the current game\n"
6432 " quit - to exit"));
6452 _(
"Command: %s - %s"),
6463 const char *
syn =
_(
"Synopsis: ");
6496 _(
"The following server commands are available:"));
6510 if ((++j % 4) == 0) {
6516 if (
buf[0] !=
'\0') {
6533 const char *src, *end;
6542 end =
buf +
sizeof(
buf) - 1;
6552 while (*src !=
'\0' && dest < end) {
6564#define SPECENUM_NAME help_general_args
6565#define SPECENUM_VALUE0 HELP_GENERAL_COMMANDS
6566#define SPECENUM_VALUE0NAME "commands"
6567#define SPECENUM_VALUE1 HELP_GENERAL_OPTIONS
6568#define SPECENUM_VALUE1NAME "options"
6569#define SPECENUM_COUNT HELP_GENERAL_COUNT
6578#define HELP_ARG_NUM (CMD_NUM + HELP_GENERAL_COUNT + settings_number())
6620 _(
"Help argument '%s' is ambiguous."), arg);
6627 _(
"No match for help argument '%s'."), arg);
6668 _(
"List of connections to server:"));
6676 if (
pconn->established) {
6698 if (delegate_to !=
NULL) {
6701 : pplayer->username;
6705 _(
"%s delegates control over player '%s' to user %s%s."),
6728 if (
NULL == caller) {
6730 _(
"That would be rather silly, since you are not a player."));
6787 if (
strlen(pplayer->username) > 0
6788 &&
strcmp(pplayer->username,
"nouser") != 0) {
6792 if (pplayer->is_ready) {
6802 }
else if (!pplayer->is_alive) {
6811 }
else if (
is_ai(pplayer)) {
6816 if (
is_ai(pplayer)) {
6824 PL_(
", %d connection:",
", %d connections:",
n),
n);
6831 _(
"%s from %s (command access level %s), "
6832 "bufsize=%dkb"),
pconn->username,
pconn->addr,
6834 (
pconn->send_buffer->nsize >> 10));
6835 if (
pconn->observer) {
6854 const char *filename,
void *
data_in)
6898 _(
"List of available rulesets, and how to load them:"));
6901 _(
"Ruleset : /rulesetdir <dir> : /read <script>"));
6945 _(
"List of nation sets available for 'nationset' option:"));
6959 PL_(
" %-10s %s (%d playable)",
6963 if (
strlen(description) > 0) {
6964 static const char prefix[] =
" ";
6992 PL_(
"%2d : '%s' : %d player :",
6993 "%2d : '%s' : %d players :",
7063#define SPECENUM_NAME list_args
7064#define SPECENUM_VALUE0 LIST_AIS
7065#define SPECENUM_VALUE0NAME "ais"
7066#define SPECENUM_VALUE1 LIST_COLORS
7067#define SPECENUM_VALUE1NAME "colors"
7068#define SPECENUM_VALUE2 LIST_CONNECTIONS
7069#define SPECENUM_VALUE2NAME "connections"
7070#define SPECENUM_VALUE3 LIST_DELEGATIONS
7071#define SPECENUM_VALUE3NAME "delegations"
7072#define SPECENUM_VALUE4 LIST_IGNORE
7073#define SPECENUM_VALUE4NAME "ignored users"
7074#define SPECENUM_VALUE5 LIST_MAPIMG
7075#define SPECENUM_VALUE5NAME "map image definitions"
7076#define SPECENUM_VALUE6 LIST_PLAYERS
7077#define SPECENUM_VALUE6NAME "players"
7078#define SPECENUM_VALUE7 LIST_RULESETS
7079#define SPECENUM_VALUE7NAME "rulesets"
7080#define SPECENUM_VALUE8 LIST_SCENARIOS
7081#define SPECENUM_VALUE8NAME "scenarios"
7082#define SPECENUM_VALUE9 LIST_NATIONSETS
7083#define SPECENUM_VALUE9NAME "nationsets"
7084#define SPECENUM_VALUE10 LIST_TEAMS
7085#define SPECENUM_VALUE10NAME "teams"
7086#define SPECENUM_VALUE11 LIST_VOTES
7087#define SPECENUM_VALUE11NAME "votes"
7115 _(
"Bad list argument: '%s'. Try '%shelp list'."),
7116 arg, (caller ?
"/" :
""));
7163 "Internal error: ind %d in show_list",
ind);
7168#ifdef FREECIV_HAVE_LIBREADLINE
7187 const char *
name =
"";
7218 return ((
char *)
NULL);
7338 return ((idx == 0) ?
"first" :
7339 (idx == 1) ?
"new" :
7799static bool is_lua(
int start)
7868 }
else if (
is_lua(start)) {
bool achievement_player_has(const struct achievement *pach, const struct player *pplayer)
int achievement_index(const struct achievement *pach)
#define achievements_iterate_end
#define achievements_iterate(_ach_)
const char * ai_name(const struct ai_type *ai)
struct ai_type * ai_type_by_name(const char *search)
int ai_type_get_count(void)
struct ai_type * get_ai_type(int id)
#define CALL_PLR_AI_FUNC(_func, _player,...)
#define ai_type_iterate_end
#define ai_type_iterate(NAME_ai)
const char * default_ai_type_name(void)
void astr_free(struct astring *astr)
const char * astr_build_or_list(struct astring *astr, const char *const *items, size_t number)
void astr_set(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
#define BV_ISSET(bv, bit)
#define SERVER_COMMAND_PREFIX
const char * city_name_get(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
static citizens city_size_get(const struct city *pcity)
#define city_list_iterate_end
enum cmd_echo command_echo(const struct command *pcommand)
const char * command_name_by_number(int i)
const char * command_name(const struct command *pcommand)
const struct command * command_by_number(int i)
const char * command_short_help(const struct command *pcommand)
char * command_extra_help(const struct command *pcommand)
enum cmdlevel command_level(const struct command *pcommand)
const char * command_synopsis(const struct command *pcommand)
bool connection_attach(struct connection *pconn, struct player *pplayer, bool observing)
bool connection_delegate_take(struct connection *pconn, struct player *dplayer)
struct player * find_uncontrolled_player(void)
void connection_close_server(struct connection *pconn, const char *reason)
void connection_detach(struct connection *pconn, bool remove_unused_player)
void conn_set_access(struct connection *pconn, enum cmdlevel new_level, bool granted)
bool connection_delegate_restore(struct connection *pconn)
size_t conn_pattern_to_string(const struct conn_pattern *ppattern, char *buf, size_t buf_len)
struct player * conn_get_player(const struct connection *pconn)
struct connection * conn_by_user_prefix(const char *user_name, enum m_pre_result *result)
struct connection * conn_by_user(const char *user_name)
void conn_list_compression_thaw(const struct conn_list *pconn_list)
void conn_pattern_destroy(struct conn_pattern *ppattern)
void conn_list_compression_freeze(const struct conn_list *pconn_list)
bool conn_controls_player(const struct connection *pconn)
const char * conn_description(const struct connection *pconn)
struct conn_pattern * conn_pattern_from_string(const char *pattern, enum conn_pattern_type prefer, char *error_buf, size_t error_buf_len)
enum cmdlevel conn_get_access(const struct connection *pconn)
#define conn_pattern_list_iterate_end
#define conn_list_iterate(connlist, pconn)
#define conn_pattern_list_iterate(plist, ppatern)
#define conn_list_iterate_end
void con_set_style(bool i)
void con_write(enum rfc_status rfc_status, const char *message,...)
#define MAX_LEN_CONSOLE_LINE
#define log_deprecation(message,...)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
void set_ai_level_directer(struct player *pplayer, enum ai_level level)
void free_tokens(char **tokens, size_t ntokens)
int get_tokens(const char *str, char **tokens, size_t num_tokens, const char *delimiterset)
char * internal_to_local_string_malloc(const char *text)
char * local_to_internal_string_malloc(const char *text)
#define PL_(String1, String2, n)
size_t featured_text_apply_tag(const char *text_source, char *featured_text, size_t featured_text_len, enum text_tag_type tag_type, ft_offset_t start_offset, ft_offset_t stop_offset,...)
const struct ft_color ftc_log
const struct ft_color ftc_command
const struct ft_color ftc_server
const struct ft_color ftc_any
VAR_ARG_CONST struct ft_color ftc_changed
const struct ft_color ftc_vote_team
const struct ft_color ftc_game_start
const struct ft_color ftc_server_prompt
const struct ft_color ftc_vote_public
struct unit * game_unit_by_number(int id)
#define GAME_MAX_READ_RECURSION
void send_scenario_description(struct conn_list *dest)
void send_scenario_info(struct conn_list *dest)
void send_game_info(struct conn_list *dest)
void cache_rulesets(void)
static GtkWidget * persistent
static char * leader_name
void handle_player_ready(struct player *pplayer, int player_no, bool is_ready)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define log_testmatic_alt(altlvl, message,...)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_normal(message,...)
#define log_error(message,...)
struct tile * map_pos_to_tile(const struct civ_map *nmap, int map_x, int map_y)
int map_startpos_count(void)
bool mapimg_id2str(int id, char *str, size_t str_len)
bool mapimg_colortest(const char *savename, const char *path)
struct mapdef * mapimg_isvalid(int id)
bool mapimg_define(const char *maparg, bool check)
bool mapimg_delete(int id)
bool mapimg_create(struct mapdef *pmapdef, bool force, const char *savename, const char *path)
const char * mapimg_error(void)
bool mapimg_show(int id, char *str, size_t str_len, bool detail)
void modpack_ruleset_cache_iterate(mrc_cb cb, void *data)
const char * modpack_file_from_ruleset_cache(const char *name)
const char * modpack_serv_file(struct section_file *sf)
const char * modpack_rulesetdir(struct section_file *sf)
const char * nation_rule_name(const struct nation_type *pnation)
int nations_match(const struct nation_type *pnation1, const struct nation_type *pnation2, bool ignore_conflicts)
struct nation_type * nation_of_unit(const struct unit *punit)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_set_name_translation(const struct nation_set *pset)
struct nation_type * nation_of_player(const struct player *pplayer)
bool is_nation_playable(const struct nation_type *nation)
bool nation_is_in_set(const struct nation_type *pnation, const struct nation_set *pset)
const char * nation_set_description(const struct nation_set *pset)
int nation_set_count(void)
struct nation_type * nation_by_rule_name(const char *name)
const char * nation_plural_translation(const struct nation_type *pnation)
const char * nation_set_rule_name(const struct nation_set *pset)
const char * nation_plural_for_player(const struct player *pplayer)
struct government * init_government_of_nation(const struct nation_type *pnation)
struct nation_style * style_of_nation(const struct nation_type *pnation)
#define nation_sets_iterate_end
#define nation_sets_iterate(NAME_pset)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define NO_NATION_SELECTED
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void notify_team(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void package_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_add_for_all(const struct packet_chat_msg *packet)
int send_packet_chat_msg(struct connection *pc, const struct packet_chat_msg *packet)
void dlsend_packet_game_load(struct conn_list *dest, bool load_successful, const char *load_filename)
void lsend_packet_achievement_info(struct conn_list *dest, const struct packet_achievement_info *packet)
struct city_list * cities
bool player_slot_is_used(const struct player_slot *pslot)
struct player * player_by_name_prefix(const char *name, enum m_pre_result *result)
struct player * player_by_number(const int player_id)
int player_slot_count(void)
struct player_slot * player_slot_by_number(int player_id)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct player * player_by_name(const char *name)
struct player * player_by_user(const char *name)
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
struct player * player_slot_get_player(const struct player_slot *pslot)
#define ai_level_cmd(_level_)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_list_iterate(playerlist, pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_list_iterate_end
#define set_as_human(plr)
void server_player_set_name(struct player *pplayer, const char *name)
struct player * server_create_player(int player_id, const char *ai_tname, struct rgbcolor *prgbcolor, bool allow_ai_type_fallbacking)
void player_status_add(struct player *plr, enum player_status pstatus)
int normal_player_count(void)
void player_set_under_human_control(struct player *pplayer)
void server_player_set_color(struct player *pplayer, const struct rgbcolor *prgbcolor)
void player_set_to_ai_mode(struct player *pplayer, enum ai_level skill_level)
bool server_player_set_name_full(const struct connection *caller, struct player *pplayer, const struct nation_type *pnation, const char *name, char *error_buf, size_t error_buf_len)
bool player_delegation_active(const struct player *pplayer)
void player_info_thaw(void)
void player_info_freeze(void)
struct nation_type * pick_a_nation(const struct nation_list *choices, bool ignore_conflicts, bool needs_startpos, enum barbarian_type barb_type)
const char * player_color_ftstr(struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
bool player_status_check(struct player *plr, enum player_status pstatus)
void player_delegation_set(struct player *pplayer, const char *username)
void server_remove_player(struct player *pplayer)
void server_player_init(struct player *pplayer, bool initmap, bool needs_team)
bool player_color_changeable(const struct player *pplayer, const char **reason)
void assign_player_colors(void)
bool client_can_pick_nation(const struct nation_type *pnation)
void send_player_diplstate_c(struct player *src, struct conn_list *dest)
const char * player_delegation_get(const struct player *pplayer)
bool nation_is_in_current_set(const struct nation_type *pnation)
void reset_all_start_commands(bool plrchange)
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
const char * secfile_error(void)
void secfile_destroy(struct section_file *secfile)
void secfile_check_unused(const struct section_file *secfile)
struct section_file * secfile_load_section(const char *filename, const char *section, bool allow_duplicates)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
struct research * research_get(const struct player *pplayer)
bool rgbcolor_from_hex(struct rgbcolor **prgbcolor, const char *hex)
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
bool rgbcolors_are_equal(const struct rgbcolor *c1, const struct rgbcolor *c2)
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
bool reload_rulesets_settings(void)
void send_rulesets(struct conn_list *dest)
void savegame_load(struct section_file *sfile)
void save_game(const char *orig_filename, const char *save_reason, bool scenario)
void script_fcdb_free(void)
bool script_fcdb_do_string(struct connection *caller, const char *str)
bool script_fcdb_call(const char *func_name,...)
bool script_fcdb_init(const char *fcdb_luafile)
bool script_server_unsafe_do_string(struct connection *caller, const char *str)
bool script_server_do_string(struct connection *caller, const char *str)
bool script_server_unsafe_do_file(struct connection *caller, const char *filename)
bool script_server_do_file(struct connection *caller, const char *filename)
bool setting_int_validate(const struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
void setting_action(const struct setting *pset)
void setting_admin_lock_clear(struct setting *pset)
const char * setting_default_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
bool setting_enum_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
struct setting * setting_by_name(const char *name)
void setting_set_to_default(struct setting *pset)
const char * setting_value_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
const char * setting_extra_help(const struct setting *pset, bool constant)
int setting_number(const struct setting *pset)
struct setting * setting_by_number(int id)
bool setting_int_set(struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
bool setting_is_visible(const struct setting *pset, struct connection *caller)
bool setting_locked(const struct setting *pset)
bool setting_non_default(const struct setting *pset)
enum sset_type setting_type(const struct setting *pset)
void setting_admin_lock_set(struct setting *pset)
bool setting_str_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
int setting_int_max(const struct setting *pset)
bool setting_bitwise_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
int settings_number(void)
bool setting_str_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
const char * setting_enum_val(const struct setting *pset, int val, bool pretty)
struct setting_list * level[OLEVELS_NUM]
void setting_changed(struct setting *pset)
enum setting_default_level setting_get_setdef(const struct setting *pset)
bool setting_enum_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
const char * setting_short_help(const struct setting *pset)
const char * setting_bitwise_bit(const struct setting *pset, int bit, bool pretty)
int setting_int_min(const struct setting *pset)
bool setting_bitwise_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
bool setting_bool_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
bool setting_is_changeable(const struct setting *pset, struct connection *caller, char *reject_msg, size_t reject_msg_len)
void settings_reset(void)
const char * setting_name(const struct setting *pset)
bool settings_game_reset(void)
void settings_list_update(void)
bool setting_bool_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
void send_server_setting(struct conn_list *dest, const struct setting *pset)
void send_server_settings(struct conn_list *dest)
#define settings_iterate(_level, _pset)
#define settings_iterate_end
const char * fileinfoname(const struct strvec *dirs, const char *filename)
void remove_trailing_spaces(char *s)
bool str_to_int(const char *str, int *pint)
const char * m_pre_description(enum m_pre_result result)
struct strvec * fileinfolist(const struct strvec *dirs, const char *suffix)
char * skip_leading_spaces(char *s)
enum m_pre_result match_prefix_full(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result, int *matches, int max_matches, int *pnum_matches)
const struct strvec * get_scenario_dirs(void)
void interpret_tilde(char *buf, size_t buf_size, const char *filename)
const struct strvec * get_save_dirs(void)
void remove_leading_spaces(char *s)
enum m_pre_result match_prefix(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result)
bool is_safe_filename(const char *name)
void remove_leading_trailing_spaces(char *s)
const struct strvec * get_data_dirs(void)
struct fileinfo_list * fileinfolist_infix(const struct strvec *dirs, const char *infix, bool nodups)
#define CLIP(lower, current, upper)
#define FC_MEMBER_SIZEOF(type, member)
#define fileinfo_list_iterate(list, pnode)
#define fileinfo_list_iterate_end
const char *(* m_pre_accessor_fn_t)(int)
#define CITY_LOG(loglevel, pcity, msg,...)
#define UNIT_LOG(loglevel, punit, msg,...)
void server_game_init(bool keep_ruleset_value)
void player_nation_defaults(struct player *pplayer, struct nation_type *pnation, bool set_name)
const char * aifill(int amount)
void set_server_state(enum server_states newstate)
bool game_was_started(void)
struct server_arguments srvarg
void check_for_full_turn_done(void)
void fc__noreturn server_quit(void)
enum server_states server_state(void)
void server_game_free(void)
static bool write_command(struct connection *caller, char *arg, bool check)
static const char * reset_accessor(int i)
static bool set_cmdlevel(struct connection *caller, struct connection *ptarget, enum cmdlevel level)
static struct setting * validate_setting_arg(enum command_id cmd, struct connection *caller, char *arg)
#define LOOKUP_OPTION_AMBIGUOUS
static const char * mapimg_accessor(int i)
void cmd_reply(enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *format,...)
static bool set_command(struct connection *caller, char *str, bool check)
static enum command_id cmd_of_level(enum ai_level level)
static void show_delegations(struct connection *caller)
static char setting_status(struct connection *caller, const struct setting *pset)
static void show_scenarios(struct connection *caller)
static bool delegate_command(struct connection *caller, char *arg, bool check)
static bool ignore_command(struct connection *caller, char *str, bool check)
static void show_help_command(struct connection *caller, enum command_id help_cmd, enum command_id id)
void set_running_game_access_level(void)
void notify_if_first_access_level_is_available(void)
static const char * lua_accessor(int i)
static const char * fcdb_accessor(int i)
static void show_help_command_list(struct connection *caller, enum command_id help_cmd)
void stdinhand_turn(void)
static void show_connections(struct connection *caller)
static bool explain_option(struct connection *caller, char *str, bool check)
static struct kick_hash * kick_table_by_user
static void show_ais(struct connection *caller)
bool conn_is_kicked(struct connection *pconn, int *time_remaining)
enum rfc_status create_command_newcomer(const char *name, const char *ai, bool check, struct nation_type *pnation, struct player **newplayer, char *buf, size_t buflen)
static void show_colors(struct connection *caller)
static bool set_ai_level(struct connection *caller, const char *name, enum ai_level level, bool check)
static struct kick_hash * kick_table_by_addr
static void show_help_option_list(struct connection *caller, enum command_id help_cmd)
static bool lock_command(struct connection *caller, char *str, bool check)
void stdinhand_init(void)
static bool take_command(struct connection *caller, char *str, bool check)
static bool wall(char *str, bool check)
static enum cmdlevel default_access_level
static void show_ruleset_info(struct connection *caller, enum command_id cmd, bool check, int read_recursion)
void show_players(struct connection *caller)
static void cmd_reply_matches(enum command_id cmd, struct connection *caller, m_pre_accessor_fn_t accessor_fn, int *matches, int num_matches)
#define LOOKUP_OPTION_NO_RESULT
static const char * list_accessor(int i)
static int lookup_option(const char *name)
static bool reset_command(struct connection *caller, char *arg, bool check, int read_recursion)
static void show_teams(struct connection *caller)
static bool handle_stdin_input_real(struct connection *caller, char *str, bool check, int read_recursion)
enum rfc_status create_command_pregame(const char *name, const char *ai, bool check, struct player **newplayer, char *buf, size_t buflen)
static bool metaconnection_command(struct connection *caller, char *arg, bool check)
static bool show_serverid(struct connection *caller, char *arg)
static void show_nationsets(struct connection *caller)
static const char * helparg_accessor(int i)
static bool metamessage_command(struct connection *caller, char *arg, bool check)
static bool away_command(struct connection *caller, bool check)
enum cmdlevel access_level_for_next_connection(void)
static bool playercolor_command(struct connection *caller, char *str, bool check)
bool handle_stdin_input_free(struct connection *caller, char *str)
void set_ai_level_direct(struct player *pplayer, enum ai_level level)
static bool player_name_check(const char *name, char *buf, size_t buflen)
static bool default_command(struct connection *caller, char *arg, bool check)
static bool create_command(struct connection *caller, const char *str, bool check)
static void vcmd_reply_prefix(enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *prefix, const char *format, va_list ap)
static const char * delegate_accessor(int i)
static void show_rulesets(struct connection *caller)
static bool surrender_command(struct connection *caller, char *str, bool check)
static bool end_command(struct connection *caller, char *str, bool check)
static const char * delegate_player_str(struct player *pplayer, bool observer)
static void cmd_reply_prefix(enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *prefix, const char *format,...) fc__attribute((__format__(__printf__
#define LOOKUP_OPTION_RULESETDIR
static bool timeout_command(struct connection *caller, char *str, bool check)
static void cmd_reply_no_such_player(enum command_id cmd, struct connection *caller, const char *name, enum m_pre_result match_result)
static bool metaserver_command(struct connection *caller, char *arg, bool check)
bool handle_stdin_input(struct connection *caller, char *str)
static bool cut_client_connection(struct connection *caller, char *name, bool check)
static void open_metaserver_connection(struct connection *caller, bool persistent)
static time_t * time_duplicate(const time_t *t)
static void show_mapimg(struct connection *caller, enum command_id cmd)
static bool may_use_nothing(struct connection *caller)
static void show_votes(struct connection *caller)
static const char *const vote_args[]
static bool show_settings(struct connection *caller, enum command_id called_as, char *str, bool check)
bool read_init_script(struct connection *caller, const char *script_filename, bool from_cmdline, bool check)
static bool unlock_command(struct connection *caller, char *str, bool check)
static bool a_connection_exists(void)
void stdinhand_free(void)
static bool cmdlevel_command(struct connection *caller, char *str, bool check)
static bool is_first_access_level_taken(void)
#define LOOKUP_OPTION_LEVEL_NAME
static bool firstlevel_command(struct connection *caller, bool check)
static void start_cmd_reply(struct connection *caller, bool notify, char *msg)
static bool connectmsg_command(struct connection *caller, char *str, bool check)
static const char horiz_line[]
static void cmd_reply_no_such_conn(enum command_id cmd, struct connection *caller, const char *name, enum m_pre_result match_result)
static void cmd_reply_line(enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *prefix, const char *line)
static void show_help_intro(struct connection *caller, enum command_id help_cmd)
static bool cancelvote_command(struct connection *caller, char *arg, bool check)
bool set_rulesetdir(struct connection *caller, const char *str, bool check, int read_recursion)
bool load_command(struct connection *caller, const char *filename, bool check, bool cmdline_load)
static bool read_init_script_real(struct connection *caller, const char *script_filename, bool from_cmdline, bool check, int read_recursion)
static void show_settings_one(struct connection *caller, enum command_id cmd, struct setting *pset)
static bool toggle_ai_command(struct connection *caller, char *arg, bool check)
static bool playernation_command(struct connection *caller, char *str, bool check)
static bool team_command(struct connection *caller, char *str, bool check)
static bool quit_game(struct connection *caller, bool check)
static bool vote_command(struct connection *caller, char *str, bool check)
#define cmd_reply_show(string)
bool start_command(struct connection *caller, bool check, bool notify)
static const char * optname_accessor(int i)
static bool show_help(struct connection *caller, char *arg)
#define OPTION_NAME_SPACE
struct strvec * get_init_script_choices(void)
static bool remove_player_command(struct connection *caller, char *arg, bool check)
static void ruleset_cache_listcmd_cb(const char *mp_name, const char *filename, void *data_in)
static bool debug_command(struct connection *caller, char *str, bool check)
static enum command_id command_named(const char *token, bool accept_ambiguity)
static bool fcdb_command(struct connection *caller, char *arg, bool check)
static bool mapimg_command(struct connection *caller, char *arg, bool check)
static bool unignore_command(struct connection *caller, char *str, bool check)
static bool observe_command(struct connection *caller, char *str, bool check)
static bool show_list(struct connection *caller, char *arg)
static bool scensave_command(struct connection *caller, char *arg, bool check)
static enum sset_level lookup_option_level(const char *name)
static bool may_use(struct connection *caller, enum command_id cmd)
static bool kick_command(struct connection *caller, char *name, bool check)
static const char * vote_arg_accessor(int i)
static bool is_restricted(struct connection *caller)
const char * script_extension
static bool show_command(struct connection *caller, char *str, bool check)
static bool lua_command(struct connection *caller, char *arg, bool check, int read_recursion)
static bool write_init_script(char *script_filename)
static enum cmdlevel first_access_level
static bool detach_command(struct connection *caller, char *str, bool check)
static bool aicmd_command(struct connection *caller, char *arg, bool check)
static void close_metaserver_connection(struct connection *caller)
static bool save_command(struct connection *caller, char *arg, bool check)
static bool set_ai_level_named(struct connection *caller, const char *name, const char *level_name, bool check)
static bool metapatches_command(struct connection *caller, char *arg, bool check)
static bool show_ignore(struct connection *caller)
static bool is_allowed_to_take(struct connection *requester, struct connection *taker, struct player *pplayer, bool will_obs, char *msg, size_t msg_len)
void toggle_ai_player_direct(struct connection *caller, struct player *pplayer)
static void show_help_option(struct connection *caller, enum command_id help_cmd, int id)
static bool read_command(struct connection *caller, char *arg, bool check, int read_recursion)
struct ai_type::@14 funcs
void(* gained_control)(struct player *pplayer)
void(* player_console)(struct player *pplayer, const char *cmd)
struct city::@17::@19 server
char start_units[MAX_LEN_STARTUNIT]
char connectmsg[MAX_LEN_MSG]
struct conn_list * est_connections
struct packet_game_info info
char rulesetdir[MAX_LEN_NAME]
struct packet_scenario_info scenario
struct conn_list * all_connections
char save_name[MAX_LEN_NAME]
struct civ_game::@31::@35 server
char allow_take[MAX_LEN_ALLOW_TAKE]
enum cmdlevel access_level
char username[MAX_LEN_NAME]
struct connection::@58::@64 server
char ipaddr[MAX_LEN_ADDR]
struct connection::@58::@64::@65 delegation
struct conn_pattern_list * ignore_list
struct connection * caller
char message[MAX_LEN_MSG]
enum ai_level skill_level
enum ai_level skill_level
struct player_ai ai_common
struct government * target_government
char username[MAX_LEN_NAME]
struct government * government
const struct ai_type * ai
struct conn_list * connections
struct nation_style * style
struct player::@70::@72 server
char metaserver_addr[256]
struct unit::@81::@84 server
struct nation_style * style_by_rule_name(const char *name)
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
FILE * fc_fopen(const char *filename, const char *opentype)
int fc_break_lines(char *str, size_t desired_len)
int fc_stat(const char *filename, struct stat *buf)
bool is_reg_file_for_access(const char *name, bool write_access)
int fc_strncasecmp(const char *str0, const char *str1, size_t n)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)
int team_index(const struct team *pteam)
const char * team_name_translation(const struct team *pteam)
struct team_slot * team_slot_by_number(int team_id)
const char * team_slot_name_translation(const struct team_slot *tslot)
bool team_add_player(struct player *pplayer, struct team *pteam)
struct team * team_new(struct team_slot *tslot)
struct team_slot * team_slot_by_rule_name(const char *team_name)
const struct player_list * team_members(const struct team *pteam)
void team_remove_player(struct player *pplayer)
#define teams_iterate_end
#define teams_iterate(_pteam)
struct city * tile_city(const struct tile *ptile)
void timer_destroy(struct timer *t)
void timer_start(struct timer *t)
struct timer * timer_new(enum timer_timetype type, enum timer_use use, const char *name)
double timer_read_seconds(struct timer *t)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const char * unit_name_translation(const struct unit *punit)
int describe_vote(struct vote *pvote, char *buf, int buflen)
bool conn_can_vote(const struct connection *pconn, const struct vote *pvote)
struct vote * vote_new(struct connection *caller, const char *allargs, int command_id)
bool vote_is_team_only(const struct vote *pvote)
struct vote * get_vote_by_no(int vote_no)
bool vote_would_pass_immediately(const struct connection *caller, int command_id)
void clear_all_votes(void)
struct vote * get_vote_by_caller(const struct connection *caller)
void connection_vote(struct connection *pconn, struct vote *pvote, enum vote_type type)
struct vote_list * vote_list
const struct connection * vote_get_caller(const struct vote *pvote)
int count_voters(const struct vote *pvote)
void remove_vote(struct vote *pvote)
bool conn_can_see_vote(const struct connection *pconn, const struct vote *pvote)
#define vote_list_iterate_end
#define vote_list_iterate(alist, pvote)