12 #include <fc_config.h>
59 size_t reject_msg_len);
61 char *reject_msg,
size_t reject_msg_len);
65 size_t reject_msg_len);
68 size_t reject_msg_len);
72 size_t reject_msg_len);
75 typedef const char *(*help_callback_func_t)(
const struct setting *pset);
76 typedef const struct sset_val_name *(*val_name_func_t)(
int value);
101 enum sset_type
stype;
167 struct setting_list *
level[OLEVELS_NUM];
179 const struct setting *
const *pset2);
181 #define settings_snprintf(_buf, _buf_len, format, ...) \
182 if (_buf != nullptr) { \
183 fc_snprintf(_buf, _buf_len, format, ##__VA_ARGS__); \
199 #define NAME_CASE(_val, _support, _pretty) \
201 static const struct sset_val_name name = {_support, _pretty}; \
210 switch (caravanbonus) {
211 NAME_CASE(CBS_CLASSIC,
"CLASSIC",
N_(
"Classic Freeciv"));
212 NAME_CASE(CBS_LOGARITHMIC,
"LOGARITHMIC",
N_(
"Log^2 N style"));
213 NAME_CASE(CBS_LINEAR,
"LINEAR",
N_(
"Linear max trade"));
214 NAME_CASE(CBS_DISTANCE,
"DISTANCE",
N_(
"Pure distance"));
238 switch (1 << topology_bit) {
239 NAME_CASE(TF_WRAPX,
"WRAPX",
N_(
"Wrap East-West"));
240 NAME_CASE(TF_WRAPY,
"WRAPY",
N_(
"Wrap North-South"));
252 switch (revenue_style) {
253 NAME_CASE(TRS_CLASSIC,
"CLASSIC",
N_(
"Classic Freeciv"));
254 NAME_CASE(TRS_SIMPLE,
"SIMPLE",
N_(
"Proportional to tile trade"));
284 N_(
"Two or three players per continent"));
286 N_(
"All players on a single continent"));
288 N_(
"Depending on size of continents"));
298 switch (team_placement) {
299 NAME_CASE(TEAM_PLACEMENT_DISABLED,
"DISABLED",
N_(
"Disabled"));
300 NAME_CASE(TEAM_PLACEMENT_CLOSEST,
"CLOSEST",
N_(
"As close as possible"));
301 NAME_CASE(TEAM_PLACEMENT_CONTINENT,
"CONTINENT",
302 N_(
"On the same continent"));
303 NAME_CASE(TEAM_PLACEMENT_HORIZONTAL,
"HORIZONTAL",
304 N_(
"Horizontal placement"));
305 NAME_CASE(TEAM_PLACEMENT_VERTICAL,
"VERTICAL",
N_(
"Vertical placement"));
315 switch (persistent_ready) {
316 NAME_CASE(PERSISTENTR_DISABLED,
"DISABLED",
N_(
"Disabled"));
317 NAME_CASE(PERSISTENTR_CONNECTED,
"CONNECTED",
318 N_(
"As long as connected"));
329 switch (condition_bit) {
343 switch (autosaves_bit) {
363 N_(
"See everything inside borders"));
365 N_(
"Borders expand to unknown, revealing tiles"));
375 switch (trait_dist) {
393 N_(
"Per-nation, in order"));
403 switch (happyborders) {
419 N_(
"Only allowed between human players"));
423 N_(
"Only allowed between two humans, or two AI players"));
449 switch (barbarians) {
464 switch (revolentype) {
468 N_(
"First time 'revolen', then always quicker"));
470 N_(
"Random, max always quicker"));
481 NAME_CASE(REVEAL_MAP_START,
"START",
N_(
"Reveal map at game start"));
482 NAME_CASE(REVEAL_MAP_DEAD,
"DEAD",
N_(
"Unfog map for dead players"));
493 NAME_CASE(AIRLIFTING_ALLIED_SRC,
"FROM_ALLIES",
494 N_(
"Allows units to be airlifted from allied cities"));
495 NAME_CASE(AIRLIFTING_ALLIED_DEST,
"TO_ALLIES",
496 N_(
"Allows units to be airlifted to allied cities"));
497 NAME_CASE(AIRLIFTING_UNLIMITED_SRC,
"SRC_UNLIMITED",
498 N_(
"Unlimited units from source city"));
499 NAME_CASE(AIRLIFTING_UNLIMITED_DEST,
"DEST_UNLIMITED",
500 N_(
"Unlimited units to destination city"));
511 NAME_CASE(PMT_CONCURRENT,
"ALL",
N_(
"All players move concurrently"));
512 NAME_CASE(PMT_PLAYERS_ALTERNATE,
"PLAYER",
513 N_(
"All players alternate movement"));
514 NAME_CASE(PMT_TEAMS_ALTERNATE,
"TEAM",
N_(
"Team alternate movement"));
538 switch (compresstype) {
541 #ifdef FREECIV_HAVE_BZ2
542 NAME_CASE(COMPRESS_BZIP2,
"BZIP2",
N_(
"Using bzip2 (deprecated)"));
544 #ifdef FREECIV_HAVE_LZMA
547 #ifdef FREECIV_HAVE_ZSTD
548 NAME_CASE(COMPRESS_ZSTD,
"ZSTD",
N_(
"Using Zstandard"));
573 N_(
"Wait time applies to activity completion at turn change"));
589 static char pmhelp[512];
593 pmhelp,
sizeof(pmhelp),
594 _(
"This setting controls whether players may make moves at the same "
595 "time during a turn. Change in setting takes effect next turn. "
596 "Currently, at least to the end of this turn, mode is \"%s\"."),
608 static char hutshelp[512];
613 "Currently this setting is being overridden by an old "
614 "scenario or savegame, which has set the absolute number "
615 "of huts to %d. Explicitly set this setting again to make "
616 "it take effect instead."),
648 qInfo(
_(
"Warning: aifill not met: %s."), msg);
650 _(
"Warning: aifill not met: %s."), msg);
662 if (pplayer->nation !=
nullptr) {
681 _(
"Warning: not enough nations in this nation set for all "
682 "current players."));
711 if (
is_human(pplayer) && !pplayer->is_connected) {
727 int timeout = *pset->
integer.pvalue;
731 game.
tinfo.seconds_to_phasedone = timeout;
744 int timeout = *pset->
integer.pvalue;
749 game.
tinfo.seconds_to_phasedone = timeout;
771 struct packet_set_topology packet;
773 packet.topology_id = *pset->
integer.pvalue;
777 send_packet_set_topology(pconn, &packet);
807 char *reject_msg,
size_t reject_msg_len)
815 reject_msg, reject_msg_len,
816 _(
"Invalid save name definition: '%s' (resolves to '%s')."), value,
829 char *reject_msg,
size_t reject_msg_len)
835 _(
"You cannot disable the map generator."));
842 reject_msg, reject_msg_len,
843 _(
"You cannot require a map generator when a map is loaded."));
854 char *reject_msg,
size_t reject_msg_len)
858 _(
"Invalid score name definition: '%s'."), value);
870 char *reject_msg,
size_t reject_msg_len)
878 _(
"Demography string validation failed at character: "
879 "'%c'. Try \"/help demography\"."),
889 char *reject_msg,
size_t reject_msg_len)
897 }
else if (!(value & (1 <<
AS_TIMER))
913 char *reject_msg,
size_t reject_msg_len)
915 int len = qstrlen(value), i;
916 bool havecharacter_state =
false;
925 for (i = 0; i <
len; i++) {
927 if (strchr(
"HhAadbOo", value[i])) {
928 havecharacter_state =
true;
934 if (havecharacter_state && strchr(
"1234", value[i])) {
935 havecharacter_state =
false;
941 _(
"Allowed take string validation failed at "
942 "character: '%c'. Try \"/help allowtake\"."),
956 char *reject_msg,
size_t reject_msg_len)
958 int len = qstrlen(value), i;
960 bool firstnative =
false;
963 for (i = 0; i <
len; i++) {
964 if (strchr(
"cwxksfdDaA", value[i])) {
970 _(
"Starting units string validation failed at "
971 "character '%c'. Try \"/help startunits\"."),
982 &&
BV_ISSET(pterrain->native_to, first_role)) {
992 reject_msg, reject_msg_len,
993 _(
"The first starting unit must be native to at least one "
994 "\"Starter\" terrain. Try \"/help startunits\"."));
1006 char *reject_msg,
size_t reject_msg_len)
1011 _(
"Cannot set endturn earlier than current turn."));
1021 char *reject_msg,
size_t reject_msg_len)
1025 _(
"Number of players (%d) is higher than requested "
1026 "value (%d). Keeping old value."),
1034 reject_msg, reject_msg_len,
1035 _(
"Requested value (%d) is greater than number of available start "
1036 "positions (%d). Keeping old value."),
1048 char *reject_msg,
size_t reject_msg_len)
1050 if (strlen(value) == 0) {
1057 _(
"Unknown nation set \"%s\". See '%slist nationsets' "
1058 "for possible values."),
1059 value, caller ?
"/" :
"");
1068 char *reject_msg,
size_t reject_msg_len)
1071 if (caller && caller->
access_level < ALLOW_HACK && value < 30
1074 _(
"You are not allowed to set timeout values less "
1075 "than 30 seconds."));
1079 if (value == -1 &&
game.
server.unitwaittime != 0) {
1083 _(
"For autogames ('timeout' = -1) 'unitwaittime' "
1084 "should be deactivated (= 0)."));
1088 if (value > 0 && value <
game.
server.unitwaittime * 3 / 2) {
1092 reject_msg, reject_msg_len,
1094 _(
"'timeout' can not be lower than 3/2 of the 'unitwaittime' "
1095 "setting (= %d). Please change 'unitwaittime' first."),
1107 char *reject_msg,
size_t reject_msg_len)
1110 if (caller && caller->
access_level < ALLOW_HACK && value < 30
1113 _(
"You are not allowed to set timeout values less "
1114 "than 30 seconds."));
1125 char *reject_msg,
size_t reject_msg_len)
1127 if (
game.
info.timeout == -1 && value != 0) {
1130 _(
"For autogames ('timeout' = -1) 'unitwaittime' "
1131 "should be deactivated (= 0)."));
1137 reject_msg, reject_msg_len,
1139 _(
"'unitwaittime' has to be lower than 2/3 of the 'timeout' setting "
1140 "(= %d). Please change 'timeout' first."),
1152 char *reject_msg,
size_t reject_msg_len)
1159 reject_msg, reject_msg_len,
1160 _(
"For an isometric or hexagonal map the ysize must be even."));
1171 char *reject_msg,
size_t reject_msg_len)
1177 reject_msg, reject_msg_len,
1178 _(
"The map size (%d * %d = %d) must be larger than %d tiles."),
1183 reject_msg, reject_msg_len,
1184 _(
"The map size (%d * %d = %d) must be lower than %d tiles."), value,
1196 char *reject_msg,
size_t reject_msg_len)
1202 reject_msg, reject_msg_len,
1203 _(
"The map size (%d * %d = %d) must be larger than %d tiles."),
1208 reject_msg, reject_msg_len,
1209 _(
"The map size (%d * %d = %d) must be lower than %d tiles."),
1213 && value % 2 != 0) {
1217 reject_msg, reject_msg_len,
1218 _(
"For an isometric or hexagonal map the ysize must be even."));
1229 char *reject_msg,
size_t reject_msg_len)
1232 && ((value & (TF_ISO)) != 0 || (value & (TF_HEX)) != 0)
1237 reject_msg, reject_msg_len,
1238 _(
"For an isometric or hexagonal map the ysize must be even."));
1249 char *reject_msg,
size_t reject_msg_len)
1251 #ifdef FREECIV_HAVE_BZ2
1252 if (value == COMPRESS_BZIP2) {
1254 _(
"Bzip2 is deprecated as compresstype. Consider other options."));
1265 char *reject_msg,
size_t reject_msg_len)
1269 for (
const auto &pnation :
nations) {
1276 _(
"No nations in the currently loaded ruleset have "
1277 "associated colors."));
1283 #define GEN_BOOL(name, value, sclass, scateg, slevel, al_read, al_write, \
1284 short_help, extra_help, func_validate, func_action, \
1287 name, sclass, al_read, al_write, short_help, extra_help, nullptr, \
1288 SST_BOOL, scateg, slevel, \
1289 {.boolean = {&value, _default, func_validate, bool_name, false}}, \
1290 func_action, false \
1293 #define GEN_INT(name, value, sclass, scateg, slevel, al_read, al_write, \
1294 short_help, extra_help, func_help, func_validate, \
1295 func_action, _min, _max, _default) \
1297 name, sclass, al_read, al_write, short_help, extra_help, func_help, \
1298 SST_INT, scateg, slevel, \
1299 {.integer = {(int *) &value, _default, _min, _max, func_validate, \
1301 func_action, false \
1304 #define GEN_STRING(name, value, sclass, scateg, slevel, al_read, al_write, \
1305 short_help, extra_help, func_validate, func_action, \
1308 name, sclass, al_read, al_write, short_help, extra_help, nullptr, \
1309 SST_STRING, scateg, slevel, \
1310 {.string = {value, _default, sizeof(value), func_validate, \
1312 func_action, false \
1315 #define GEN_ENUM(name, value, sclass, scateg, slevel, al_read, al_write, \
1316 short_help, extra_help, func_help, func_validate, \
1317 func_action, func_name, _default) \
1319 name, sclass, al_read, al_write, short_help, extra_help, func_help, \
1320 SST_ENUM, scateg, slevel, \
1321 {.enumerator = {&value, sizeof(value), _default, func_validate, \
1322 (val_name_func_t) func_name, 0}}, \
1323 func_action, false \
1326 #define GEN_BITWISE(name, value, sclass, scateg, slevel, al_read, al_write, \
1327 short_help, extra_help, func_validate, func_action, \
1328 func_name, _default) \
1330 name, sclass, al_read, al_write, short_help, extra_help, nullptr, \
1331 SST_BITWISE, scateg, slevel, \
1332 {.bitwise = {(unsigned *) (void *) &value, _default, func_validate, \
1334 func_action, false \
1344 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Map size definition"),
1349 N_(
"Chooses the method used to define the map size. Other options "
1350 "specify the parameters for each method.\n"
1351 "- \"Number of tiles\" (FULLSIZE): Map area (option 'size').\n"
1352 "- \"Tiles per player\" (PLAYER): Number of (land) tiles per "
1353 "player (option 'tilesperplayer').\n"
1354 "- \"Width and height\" (XYSIZE): Map width and height in tiles "
1355 "(options 'xsize' and 'ysize')."),
1361 ALLOW_NONE, ALLOW_BASIC,
N_(
"Map area (in thousands of tiles)"),
1366 N_(
"This value is used to determine the map area.\n"
1367 " size = 4 is a normal map of 4,000 tiles (default)\n"
1368 " size = 20 is a huge map of 20,000 tiles\n"
1369 "For this option to take effect, the \"Map size definition\" "
1370 "option ('mapsize') must be set to \"Number of tiles\" "
1377 SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1378 N_(
"Number of (land) tiles per player"),
1383 N_(
"This value is used to determine the map dimensions. It "
1384 "calculates the map size at game start based on the number of "
1385 "players and the value of the setting 'landmass'.\n"
1386 "For this option to take effect, the \"Map size definition\" "
1387 "option ('mapsize') must be set to \"Tiles per player\" "
1394 ALLOW_NONE, ALLOW_BASIC,
N_(
"Map width in tiles"),
1399 N_(
"Defines the map width.\n"
1400 "For this option to take effect, the \"Map size definition\" "
1401 "option ('mapsize') must be set to \"Width and height\" "
1407 ALLOW_NONE, ALLOW_BASIC,
N_(
"Map height in tiles"),
1412 N_(
"Defines the map height.\n"
1413 "For this option to take effect, the \"Map size definition\" "
1414 "option ('mapsize') must be set to \"Width and height\" "
1421 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Map topology"),
1423 N_(
"Freeciv21 maps are always two-dimensional. They may wrap at the "
1424 "north-south and east-west directions to form a flat map, a "
1425 "cylinder, or a torus (donut). Individual tiles may be "
1426 "rectangular or hexagonal, with either an overhead (\"classic\") "
1427 "or isometric alignment.\n"
1428 "To play with a particular topology, clients will need a "
1429 "matching tileset.\n"
1430 "Overhead rectangular: Isometric rectangular:\n"
1431 " _________ /\\/\\/\\/\\/\\\n"
1432 " |_|_|_|_|_| /\\/\\/\\/\\/\\/\n"
1433 " |_|_|_|_|_| \\/\\/\\/\\/\\/\\\n"
1434 " |_|_|_|_|_| /\\/\\/\\/\\/\\/\n"
1435 " \\/\\/\\/\\/\\/\n"
1437 " /\\/\\/\\/\\/\\/\\ _ _ _ _ _\n"
1438 " | | | | | | | / \\_/ \\_/ \\_/ \\_/ \\\n"
1439 " \\/\\/\\/\\/\\/\\/\\"
1440 " \\_/ \\_/ \\_/ \\_/ \\_/\n"
1441 " | | | | | | | / \\_/ \\_/ \\_/ \\_/ \\\n"
1442 " \\/\\/\\/\\/\\/\\/ \\_/ \\_/ \\_/ \\_/ \\_/\n"),
1447 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1448 N_(
"Method used to generate map"),
1454 N_(
"Specifies the algorithm used to generate the map. If the "
1455 "default value of the 'startpos' option is used, then the chosen "
1456 "generator chooses an appropriate 'startpos' setting; otherwise, "
1457 "the generated map tries to accommodate the chosen 'startpos' "
1459 "- \"Scenario map\" (SCENARIO): indicates a pre-generated map. "
1460 "By default, if the scenario does not specify start positions, "
1461 "they will be allocated depending on the size of continents.\n"
1462 "- \"Fully random height\" (RANDOM): generates maps with a "
1463 "number of equally spaced, relatively small islands. By default, "
1464 "start positions are allocated depending on continent size.\n"
1465 "- \"Pseudo-fractal height\" (FRACTAL): generates Earthlike "
1466 "worlds with one or more large continents and a scattering of "
1467 "smaller islands. By default, players are all placed on a single "
1469 "- \"Island-based\" (ISLAND): generates 'fair' maps with a "
1470 "number of similarly-sized and -shaped islands, each with "
1471 "approximately the same ratios of terrain types. By default, "
1472 "each player gets their own island.\n"
1473 "- \"Fair islands\" (FAIR): generates the exact copy of the same "
1474 "island for every player or every team.\n"
1475 "- \"Fracture map\" (FRACTURE): generates maps from a fracture "
1476 "pattern. Tends to place hills and mountains along the edges of "
1478 "If the requested generator is incompatible with other server "
1479 "settings, the server may fall back to another generator."),
1485 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1486 N_(
"Method used to choose start positions"),
1492 N_(
"The method used to choose where each player's initial units "
1493 "start on the map. (For scenarios which include pre-set start "
1494 "positions, this setting is ignored.)\n"
1495 "- \"Generator's choice\" (DEFAULT): the start position "
1496 "placement will depend on the map generator chosen. See the "
1497 "'generator' setting.\n"
1498 "- \"One player per continent\" (SINGLE): one player is placed "
1499 "on each of a set of continents of approximately equivalent "
1500 "value (if possible).\n"
1501 "- \"Two or three players per continent\" (2or3): similar to "
1502 "SINGLE except that two players will be placed on each "
1503 "continent, with three on the 'best' continent if there is an "
1504 "odd number of players.\n"
1505 "- \"All players on a single continent\" (ALL): all players will "
1506 "start on the 'best' available continent.\n"
1507 "- \"Depending on size of continents\" (VARIABLE): players will "
1508 "be placed on the 'best' available continents such that, as far "
1509 "as possible, the number of players on each continent is "
1510 "proportional to its value.\n"
1511 "If the server cannot satisfy the requested setting due to there "
1512 "being too many players for continents, it may fall back to one "
1513 "of the others. (However, map generators try to create the right "
1514 "number of continents for the choice of this 'startpos' setting "
1515 "and the number of players, so this is unlikely to occur.)"),
1520 SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1521 N_(
"Method used for placement of team mates"),
1526 N_(
"After start positions have been generated thanks to the "
1527 "'startpos' setting, this setting controls how the start "
1528 "positions will be assigned to the different players of the same "
1530 "- \"Disabled\" (DISABLED): the start positions will be randomly "
1531 "assigned to players, regardless of teams.\n"
1532 "- \"As close as possible\" (CLOSEST): players will be placed as "
1533 "close as possible, regardless of continents.\n"
1534 "- \"On the same continent\" (CONTINENT): if possible, place all "
1535 "players of the same team onto the same island/continent.\n"
1536 "- \"Horizontal placement\" (HORIZONTAL): players of the same "
1537 "team will be placed horizontally.\n"
1538 "- \"Vertical placement\" (VERTICAL): players of the same team "
1539 "will be placed vertically."),
1544 SSET_GEOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1545 N_(
"Presence of 1x1 islands"),
1546 N_(
"This setting controls whether the map generator is allowed "
1547 "to make islands of one only tile size."),
1551 SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1552 N_(
"Whether the poles are separate continents"),
1553 N_(
"If this setting is disabled, the continents may attach to "
1559 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1560 N_(
"How much the land at the poles is flattened"),
1564 N_(
"Controls how much the height of the poles is flattened during "
1565 "map generation, preventing a diversity of land terrain there. 0 "
1566 "is no flattening, 100 is maximum flattening. Only affects the "
1567 "'RANDOM' and 'FRACTAL' map generators."),
1572 SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1573 N_(
"Whether there's just one pole generated"),
1574 N_(
"If this setting is enabled, only one side of the map will "
1575 "have a pole. This setting has no effect if the map wraps "
1576 "both directions."),
1580 SSET_GEOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1581 N_(
"All the map is temperate"),
1582 N_(
"If this setting is enabled, the temperature will be "
1583 "equivalent everywhere on the map. As a result, the poles "
1584 "won't be generated."),
1588 SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1589 N_(
"Average temperature of the planet"),
1590 N_(
"Small values will give a cold map, while larger values will "
1591 "give a hotter map.\n"
1593 "100 means a very dry and hot planet with no polar arctic "
1594 "zones, only tropical and dry zones.\n"
1595 " 70 means a hot planet with little polar ice.\n"
1596 " 50 means a temperate planet with normal polar, cold, "
1597 "temperate, and tropical zones; a desert zone overlaps "
1598 "tropical and temperate zones.\n"
1599 " 30 means a cold planet with small tropical zones.\n"
1600 " 0 means a very cold planet with large polar zones and no "
1606 SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1607 N_(
"Percentage of the map that is land"),
1608 N_(
"This setting gives the approximate percentage of the map "
1609 "that will be made into land."),
1614 SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1615 N_(
"Amount of hills/mountains"),
1616 N_(
"Small values give flat maps, while higher values give a "
1617 "steeper map with more hills and mountains."),
1623 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1624 N_(
"Amount of water on landmasses"),
1625 N_(
"Small values mean lots of dry, desert-like land; higher values "
1626 "give a wetter map with more swamps, jungles, and rivers."),
1631 SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1632 N_(
"Global warming"),
1633 N_(
"If turned off, global warming will not occur as a result "
1634 "of pollution. This setting does not affect pollution."),
1638 SSET_RULES, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1639 N_(
"Global warming percent"),
1640 N_(
"This is a multiplier for the rate of accumulation of global "
1647 SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1648 N_(
"Nuclear winter"),
1649 N_(
"If turned off, nuclear winter will not occur as a result "
1654 SSET_RULES, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1655 N_(
"Nuclear winter percent"),
1656 N_(
"This is a multiplier for the rate of accumulation of "
1663 SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
1664 N_(
"Map generation random seed"),
1665 N_(
"The same seed will always produce the same map; for zero "
1666 "(the default) a seed will be chosen based on the time to "
1667 "give a random map."),
1677 SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
1678 N_(
"Game random seed"),
1679 N_(
"For zero (the default) a seed will be chosen based on the "
1685 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1686 N_(
"Amount of \"special\" resource tiles"),
1687 N_(
"Special resources improve the basic terrain type they are "
1688 "on. The server variable's scale is parts per thousand."),
1694 ALLOW_NONE, ALLOW_BASIC,
N_(
"Amount of huts (bonus extras)"),
1695 N_(
"Huts are tile extras that usually may be investigated by "
1696 "units.The server variable's scale is huts per thousand tiles."),
1701 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Amount of animals"),
1702 N_(
"Number of animals initially created on terrains defined for "
1703 "them in the ruleset (if the ruleset supports it). The "
1704 "server variable's scale is animals per thousand tiles."),
1712 SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1713 N_(
"Minimum number of players"),
1714 N_(
"There must be at least this many players (connected human "
1715 "players) before the game can start."),
1721 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Maximum number of players"),
1722 N_(
"The maximal number of human and AI players who can be in the "
1723 "game. When this number of players are connected in the pregame "
1724 "state, any new players who try to connect will be rejected.\n"
1725 "When playing a scenario which defines player start positions, "
1726 "this setting cannot be set to greater than the number of "
1727 "defined start positions."),
1732 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1733 N_(
"Limited number of AI players"),
1734 N_(
"If set to a positive value, then AI players will be "
1735 "automatically created or removed to keep the total number "
1736 "of players at this amount. As more players join, these AI "
1737 "players will be replaced. When set to zero, all AI players "
1738 "will be removed."),
1744 SSET_NETWORK, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1745 N_(
"When the Readiness of a player gets autotoggled off"),
1746 N_(
"In pre-game, usually when new players join or old ones leave, "
1747 "those who have already accepted game to start by toggling "
1748 "\"Ready\" get that autotoggled off in the changed situation. "
1749 "This setting can be used to make readiness more persistent."),
1755 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1756 N_(
"Set of nations to choose from"),
1758 N_(
"Controls the set of nations allowed in the game. The choices "
1759 "are defined by the ruleset.\n"
1760 "Only nations in the set selected here will be allowed in any "
1761 "circumstances, including new players and civil war; small sets "
1762 "may thus limit the number of players in a game.\n"
1763 "If this is left blank, the ruleset's default nation set is "
1765 "See '/list nationsets' for possible choices for the currently "
1770 SSET_INTERNAL, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1771 N_(
"Event cache for this number of turns"),
1772 N_(
"Event messages are saved for this number of turns. A value "
1773 "of 0 deactivates the event cache."),
1779 SSET_INTERNAL, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1780 N_(
"Size of the event cache"),
1781 N_(
"This defines the maximal number of events in the event cache."),
1787 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1788 N_(
"Save chat messages in the event cache"),
1789 N_(
"If turned on, chat messages will be saved in the event cache."),
1793 SSET_INTERNAL, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1794 N_(
"Print turn and time for each cached event"),
1797 N_(
"If turned on, all cached events will be marked by the turn "
1798 "and time of the event like '(T2 - 15:29:52)'."),
1806 SSET_SOCIOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1807 N_(
"List of players' initial units"),
1808 N_(
"This should be a string of characters, each of which specifies "
1809 "a unit role. The first character must be native to at least one "
1810 "\"Starter\" terrain. The characters and their meanings are:\n"
1811 " c = City founder (eg., Settlers)\n"
1812 " w = Terrain worker (eg., Engineers)\n"
1813 " x = Explorer (eg., Explorer)\n"
1814 " k = Gameloss (eg., King)\n"
1815 " s = Diplomat (eg., Diplomat)\n"
1816 " f = Ferryboat (eg., Trireme)\n"
1817 " d = Ok defense unit (eg., Warriors)\n"
1818 " D = Good defense unit (eg., Phalanx)\n"
1819 " a = Fast attack unit (eg., Horsemen)\n"
1820 " A = Strong attack unit (eg., Catapult)\n"),
1824 SSET_SOCIOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1825 N_(
"Whether player starts with a city"),
1826 N_(
"If this is set, game will start with player's first city "
1827 "already founded to starting location."),
1831 SSET_SOCIOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1832 N_(
"Area where initial units are located"),
1833 N_(
"This is the radius within which the initial units are "
1840 ALLOW_NONE, ALLOW_BASIC,
N_(
"Starting gold per player"),
1841 N_(
"At the beginning of the game, each player is given this much "
1847 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1848 N_(
"Number of initial techs per player"),
1851 N_(
"At the beginning of the game, each player is given this "
1852 "many technologies. The technologies chosen are random for "
1853 "each player. Depending on the value of tech_cost_style in "
1854 "the ruleset, a big value for 'techlevel' can make the next "
1855 "techs really expensive."),
1860 SSET_SCIENCE, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
1861 N_(
"Technology cost multiplier percentage"),
1862 N_(
"This affects how quickly players can research new "
1863 "technology. All tech costs are multiplied by this amount "
1864 "(as a percentage). The base tech costs are determined by "
1865 "the ruleset or other game settings."),
1871 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1872 N_(
"Allow researching multiple technologies"),
1873 N_(
"Allows switching to any technology without wasting old "
1874 "research. Bulbs are never transfered to new technology. "
1875 "Techpenalty options are inefective after enabling that option."),
1879 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1880 N_(
"Percentage penalty when changing tech"),
1881 N_(
"If you change your current research technology, and you "
1882 "have positive research points, you lose this percentage of "
1883 "those research points. This does not apply when you have "
1884 "just gained a technology this turn."),
1889 SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1890 N_(
"Chance to lose a technology while receiving it"),
1891 N_(
"The chance that learning a technology by treaty or theft "
1897 SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1898 N_(
"Chance to lose a technology while giving it"),
1899 N_(
"The chance that your civilization will lose a technology if "
1900 "you teach it to someone else by treaty, or if it is stolen "
1906 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
N_(
"Tech leakage percent"),
1907 N_(
"The rate of the tech leakage."),
nullptr,
nullptr,
nullptr,
1911 SSET_RULES, SSET_SCIENCE, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
1912 N_(
"Team pooled research"),
1913 N_(
"If this setting is turned on, then the team mates will "
1914 "share the science research. Else, every player of the team "
1915 "will have to make its own."),
1919 SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1920 N_(
"Penalty when getting tech from treaty"),
1921 N_(
"For each technology you gain from a diplomatic treaty, you "
1922 "lose research points equal to this percentage of the cost "
1923 "to research a new technology. If this is non-zero, you can "
1924 "end up with negative research points."),
1929 SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1930 N_(
"Penalty when getting gold from treaty"),
1931 N_(
"When transferring gold in diplomatic treaties, this "
1932 "percentage of the agreed sum is lost to both parties; it is "
1933 "deducted from the donor but not received by the recipient."),
1938 SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1939 N_(
"Probability of gold loss during inciting revolt"),
1940 N_(
"When unit trying to incite revolt is eliminated, half of "
1941 "the gold (or quarter, if unit was caught), prepared to "
1942 "bribe citizens, can be lost or captured by enemy."),
1948 "incite_gold_capt_chance",
game.
server.incite_gold_capt_chance,
1949 SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1950 N_(
"Probability of gold capture during inciting revolt"),
1951 N_(
"When unit trying to incite revolt is eliminated and lose its "
1952 "gold, there is chance that this gold would be captured by city "
1953 "defender. Transfer tax would be applied, though. This setting "
1954 "is irrevelant, if incite_gold_loss_chance is zero."),
1960 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1961 N_(
"Penalty when getting tech from conquering"),
1962 N_(
"For each technology you gain by conquering an enemy city, "
1963 "you lose research points equal to this percentage of the "
1964 "cost to research a new technology. If this is non-zero, you "
1965 "can end up with negative research points."),
1971 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1972 N_(
"Penalty when getting a free tech"),
1975 N_(
"For each technology you gain \"for free\" (other than covered "
1976 "by 'diplcost' or 'conquercost': for instance, from huts or from "
1977 "Great Library effects), you lose research points equal to this "
1978 "percentage of the cost to research a new technology. If this is "
1979 "non-zero, you can end up with negative research points."),
1984 SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1985 N_(
"Research point debt threshold for losing tech"),
1986 N_(
"When you have negative research points, and your shortfall "
1987 "is greater than this percentage of the cost of your current "
1988 "research, you forget a technology you already knew.\n"
1989 "The special value -1 prevents loss of technology regardless "
1990 "of research points."),
1996 SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
1997 N_(
"Research points restored after losing a tech"),
1998 N_(
"When you lose a technology due to a negative research balance "
1999 "(see 'techlossforgiveness'), this percentage of its research "
2000 "cost is credited to your research balance (this may not be "
2001 "sufficient to make it positive).\n"
2002 "The special value -1 means that your research balance is always "
2003 "restored to zero, regardless of your previous shortfall."),
2008 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2009 N_(
"Food required for a city to grow"),
2010 N_(
"This is the base amount of food required to grow a city. "
2011 "This value is multiplied by another factor that comes from "
2012 "the ruleset and is dependent on the size of the city."),
2017 SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2018 N_(
"Percentage food lost when city can't grow"),
2019 N_(
"If a city would expand, but it can't because it lacks some "
2020 "prerequisite (traditionally an Aqueduct or Sewer System), "
2021 "this is the base percentage of its foodbox that is lost "
2022 "each turn; the penalty may be reduced by buildings or other "
2023 "circumstances, depending on the ruleset."),
2029 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2030 N_(
"Multiplier percentage for production costs"),
2031 N_(
"This affects how quickly units and buildings can be produced. "
2032 "The base costs are multiplied by this value (as a percentage)."),
2043 SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2044 N_(
"Minimum city size to get full trade"),
2047 N_(
"There is a trade penalty in all cities smaller than this. "
2048 "The penalty is 100% (no trade at all) for sizes up to "
2049 "'notradesize', and decreases gradually to 0% (no penalty "
2050 "except the normal corruption) for size='fulltradesize'. See "
2051 "also 'notradesize'."),
2056 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2057 N_(
"Maximum size of a city without trade"),
2060 N_(
"Cities do not produce any trade at all unless their size is "
2061 "larger than this amount. The produced trade increases "
2062 "gradually for cities larger than 'notradesize' and smaller "
2063 "than 'fulltradesize'. See also 'fulltradesize'."),
2068 SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2069 N_(
"How largely trade distance is relative to world size"),
2072 N_(
"When determining trade between cities, the distance factor "
2073 "can be partly or fully relative to world size. This setting "
2074 "determines how big percentage of the bonus calculation is "
2075 "relative to world size, and how much only absolute distance "
2081 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2082 N_(
"Minimum distance between cities"),
2083 N_(
"When a player attempts to found a new city, it is prevented "
2084 "if the distance from any existing city is less than this "
2085 "setting. For example, when this setting is 3, there must be "
2086 "at least two clear tiles in any direction between all "
2087 "existing cities and the new city site. A value of 1 removes "
2088 "any such restriction on city placement."),
2093 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2094 N_(
"Technology trading"),
2095 N_(
"If turned off, trading technologies in the diplomacy "
2096 "dialog is not allowed."),
2100 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2102 N_(
"If turned off, trading gold in the diplomacy dialog is not "
2107 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2109 N_(
"If turned off, trading cities in the diplomacy dialog is "
2114 SSET_RULES, SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2115 N_(
"Caravan bonus style"),
2116 N_(
"The formula for the bonus when a caravan enters a city. "
2117 "CLASSIC bonuses are proportional to distance and trade of "
2118 "source and destination with multipliers for overseas and "
2119 "international destinations. LOGARITHMIC bonuses are "
2120 "proportional to log^2(distance + trade). LINEAR bonuses "
2121 "are similar to CLASSIC, but (like LOGARITHMIC) use the "
2122 "max trade of the city rather than current. DISTANCE "
2123 "bonuses are proportional only to distance."),
2129 SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2130 N_(
"Trade revenue style"),
2131 N_(
"The formula for the trade a city receives from a traderoute. "
2132 "CLASSIC revenues depend on distance and trade with multipliers "
2133 "for overseas and international routes. SIMPLE revenues are "
2134 "proportional to the average trade of the two cities."),
2139 SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2140 N_(
"Minimum distance for trade routes"),
2141 N_(
"In order for two cities in the same civilization to "
2142 "establish a trade route, they must be at least this far "
2143 "apart on the map. For square grids, the distance is "
2144 "calculated as \"Manhattan distance\", that is, the sum of "
2145 "the displacements along the x and y directions."),
2151 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2152 N_(
"Number of turns between rapture effect"),
2153 N_(
"Sets the number of turns between rapture growth of a city. If "
2154 "set to n a city will grow after celebrating for n+1 turns."),
2159 SSET_SOCIOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2160 N_(
"Frequency of disasters"),
2161 N_(
"Affects how often random disasters happen to cities, if any "
2162 "are defined by the ruleset. The relative frequency of "
2163 "disaster types is set by the ruleset. Zero prevents any "
2164 "random disasters from occurring."),
2169 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2170 N_(
"AI trait distribution method"),
2171 N_(
"How trait values are given to AI players."),
nullptr,
2176 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2177 N_(
"Chance for conquered building destruction"),
2178 N_(
"When a player conquers a city, each city improvement has "
2179 "this percentage chance to be destroyed."),
2184 SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2185 N_(
"Chance of moving into tile after attack"),
2186 N_(
"If set to 0, combat is Civ1/2-style (when you attack, you "
2187 "remain in place). If set to 100, attacking units will "
2188 "always move into the tile they attacked when they win the "
2189 "combat (and no enemy units remain in the tile). If set to a "
2190 "value between 0 and 100, this will be used as the percent "
2191 "chance of \"occupying\" territory."),
2197 SSET_MILITARY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2198 N_(
"Turn on/off server-side autoattack"),
2199 N_(
"If set to on, units with moves left will automatically consider "
2200 "attacking enemy units that move adjacent to them."),
2205 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2206 N_(
"Do all units in tile die with defender"),
2207 N_(
"If this is enabled, each time a defender unit loses in combat, "
2208 "and is not inside a city or suitable base, all units in the "
2209 "same tile are destroyed along with the defender. If this is "
2210 "disabled, only the defender unit is destroyed."),
2214 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2215 N_(
"Reduce city population after attack"),
2216 N_(
"This flag indicates whether a city's population is reduced "
2217 "after a successful attack by an enemy unit. If this is "
2218 "disabled, population is never reduced. Even when this is "
2219 "enabled, only some units may kill citizens."),
2224 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2225 N_(
"Slowly kill units without home cities (e.g., starting units)"),
2226 N_(
"If greater than 0, then every unit without a homecity will lose "
2227 "hitpoints each turn. The number of hitpoints lost is given by "
2228 "'killunhomed' percent of the hitpoints of the unit type. At "
2229 "least one hitpoint is lost every turn until the death of the "
2235 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2236 N_(
"National borders"),
2237 N_(
"If this is not disabled, then any land tiles around a city "
2238 "or border-claiming extra (like the classic ruleset's "
2239 "Fortress base) will be owned by that nation. SEE_INSIDE "
2240 "and EXPAND makes everything inside a player's borders "
2241 "visible at once. ENABLED will, in some rulesets, grant the "
2242 "same visibility if certain conditions are met."),
2247 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2248 N_(
"Units inside borders cause no unhappiness"),
2249 N_(
"If this is set, units will not cause unhappiness when inside "
2250 "your borders, or even allies borders, depending on value."),
2255 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2256 N_(
"Ability to do diplomacy with other players"),
2257 N_(
"This setting controls the ability to do diplomacy with "
2263 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2264 N_(
"Allowed city names"),
2269 N_(
"- \"No restrictions\" (NO_RESTRICTIONS): players can have "
2270 "multiple cities with the same names.\n"
2271 "- \"Unique to a player\" (PLAYER_UNIQUE): one player can't "
2272 "have multiple cities with the same name.\n"
2273 "- \"Globally unique\" (GLOBAL_UNIQUE): all cities in a "
2274 "game have to have different names.\n"
2275 "- \"No city name stealing\" (NO_STEALING): like \"Globally "
2276 "unique\", but a player isn't allowed to use a default city "
2277 "name of another nation unless it is a default for their "
2284 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
N_(
"How to pick player colors"),
2290 N_(
"This setting determines how player colors are chosen. Player "
2291 "colors are used in the Nations report, for national borders on "
2292 "the map, and so on.\n"
2293 "- \"Per-player, in order\" (PLR_ORDER): colors are assigned to "
2294 "individual players in order from a list defined by the "
2296 "- \"Per-player, random\" (PLR_RANDOM): colors are assigned to "
2297 "individual players randomly from the set defined by the "
2299 "- \"Set manually\" (PLR_SET): colors can be set with the "
2300 "'playercolor' command before the game starts; these are not "
2301 "restricted to the ruleset colors. Any players for which no "
2302 "color is set when the game starts get a random color from the "
2304 "- \"Per-team, in order\" (TEAM_ORDER): colors are assigned to "
2305 "teams from the list in the ruleset. Every player on the same "
2306 "team gets the same color.\n"
2307 "- \"Per-nation, in order\" (NATION_ORDER): if the ruleset "
2308 "defines a color for a player's nation, the player takes that "
2309 "color. Any players whose nations don't have associated colors "
2310 "get a random color from the list in the ruleset.\n"
2311 "Regardless of this setting, individual player colors can be "
2312 "changed after the game starts with the 'playercolor' command."),
2328 SSET_MILITARY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2329 N_(
"Barbarian appearance frequency"),
2332 N_(
"This setting controls how frequently the barbarians appear "
2333 "in the game. See also the 'onsetbarbs' setting."),
2338 SSET_MILITARY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2339 N_(
"Barbarian onset turn"),
2340 N_(
"Barbarians will not appear before this turn."),
nullptr,
2346 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2347 N_(
"Way to determine revolution length"),
2348 N_(
"Which method is used in determining how long period of anarchy "
2349 "lasts when changing government. The actual value is set with "
2350 "'revolen' setting. The 'quickening' methods depend on how many "
2351 "times any player has changed to this type of government before, "
2352 "so it becomes easier to establish a new system of government if "
2353 "it has been done before."),
2358 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2359 N_(
"Length of revolution"),
2360 N_(
"When changing governments, a period of anarchy will occur. "
2361 "Value of this setting, used the way 'revolentype' setting "
2362 "dictates, defines the length of the anarchy."),
2367 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2368 N_(
"Whether to enable fog of war"),
2369 N_(
"If this is enabled, only those units and cities within the "
2370 "vision range of your own units and cities will be revealed "
2371 "to you. You will not see new cities or terrain changes in "
2372 "tiles not observed."),
2376 SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2377 N_(
"Whether fog of war applies to border changes"),
2378 N_(
"If this setting is enabled, players will not be able to "
2379 "see changes in tile ownership if they do not have direct "
2380 "sight of the affected tiles. Otherwise, players can see "
2381 "any or all changes to borders as long as they have "
2382 "previously seen the tiles."),
2387 SSET_MILITARY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2388 N_(
"Airlifting style"),
2393 N_(
"This setting affects airlifting units between cities. It can be "
2394 "a set of the following values:\n"
2395 "- \"Allows units to be airlifted from allied cities\" "
2397 "- \"Allows units to be airlifted to allied cities\" "
2399 "- \"Unlimited units from source city\" (SRC_UNLIMITED): note "
2400 "that airlifting from a city doesn't reduce the airlifted "
2401 "counter, but still needs airlift capacity of at least 1.\n"
2402 "- \"Unlimited units to destination city\" (DEST_UNLIMITED): "
2403 "note that airlifting to a city doesn't reduce the airlifted "
2404 "counter, and doesn't need any airlift capacity."),
2410 SSET_MILITARY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2411 N_(
"Base chance for diplomats and spies to succeed"),
2412 N_(
"The base chance of a spy returning from a successful mission "
2413 "and the base chance of success for diplomats and spies."),
2419 SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2420 N_(
"What kinds of victories are possible"),
2425 N_(
"This setting controls how game can be won. One can always win "
2426 "by conquering entire planet, but other victory conditions can "
2427 "be enabled or disabled:\n"
2428 "- \"Spacerace\" (SPACERACE): Spaceship is built and travels to "
2430 "- \"Allied\" (ALLIED): After defeating enemies, all remaining "
2431 "players are allied.\n"
2432 "- \"Culture\" (CULTURE): Player meets ruleset defined cultural "
2433 "domination criteria.\n"),
2438 SSET_SCIENCE, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2439 N_(
"Should the game end if the spaceship arrives?"),
2440 N_(
"If this option is turned on, the game will end with the "
2441 "arrival of a spaceship at Alpha Centauri."),
2445 "spaceship_travel_time",
game.
server.spaceship_travel_time,
2447 ALLOW_BASIC,
N_(
"Percentage to multiply spaceship travel time by"),
2448 N_(
"This percentage is multiplied onto the time it will take for a "
2449 "spaceship to arrive at Alpha Centauri."),
2454 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2455 N_(
"Minimum number of cities for civil war"),
2456 N_(
"A civil war is triggered when a player has at least this "
2457 "many cities and the player's capital is captured. If this "
2458 "option is set to the maximum value, civil wars are turned "
2464 SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2465 N_(
"Restrict the use of the infrastructure for enemy units"),
2466 N_(
"If this option is enabled, the use of roads and rails will "
2467 "be restricted for enemy units."),
2472 ALLOW_BASIC,
N_(
"Does unreachable unit protect reachable ones"),
2473 N_(
"This option controls whether tiles with both unreachable "
2474 "and reachable units can be attacked. If disabled, any tile "
2475 "with reachable units can be attacked. If enabled, tiles "
2476 "with an unreachable unit in them cannot be attacked. Some "
2477 "units in some rulesets may override this, never protecting "
2478 "reachable units on their tile."),
2482 SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2483 N_(
"Turns until player contact is lost"),
2484 N_(
"Players may meet for diplomacy this number of turns after "
2485 "their units have last met, even when they do not have an "
2486 "embassy. If set to zero, then players cannot meet unless "
2487 "they have an embassy."),
2493 SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2494 N_(
"Rebuild palace whenever capital is conquered"),
2495 N_(
"If this is turned on, when the capital is conquered the palace "
2496 "is automatically rebuilt for free in another randomly chosen "
2497 "city. This is significant because the technology requirement "
2498 "for building a palace will be ignored. (In some rulesets, "
2499 "buildings other than the palace are affected by this setting.)"),
2504 ALLOW_BASIC,
N_(
"Give caught units a homecity"),
2508 N_(
"If unset, caught units will have no homecity and will be "
2509 "subject to the 'killunhomed' option."),
2514 ALLOW_BASIC,
N_(
"Whether to use natural city names"),
2515 N_(
"If enabled, the default city names will be determined "
2516 "based on the surrounding terrain."),
2521 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2522 N_(
"Whether to enable citizen migration"),
2525 N_(
"This is the master setting that controls whether citizen "
2526 "migration is active in the game. If enabled, citizens may "
2527 "automatically move from less desirable cities to more desirable "
2528 "ones. The \"desirability\" of a given city is calculated from a "
2529 "number of factors. In general larger cities with more income "
2530 "and improvements will be preferred. Citizens will never migrate "
2531 "out of the capital, or cause a wonder to be lost by disbanding "
2532 "a city. A number of other settings control how migration "
2534 " 'mgr_turninterval' - How often citizens try to migrate.\n"
2535 " 'mgr_foodneeded' - Whether destination food is checked.\n"
2536 " 'mgr_distance' - How far citizens will migrate.\n"
2537 " 'mgr_worldchance' - Chance for inter-nation migration.\n"
2538 " 'mgr_nationchance' - Chance for intra-nation migration."),
2544 N_(
"Number of turns between migrations from a city"),
2547 N_(
"This setting controls the number of turns between migration "
2548 "checks for a given city. The interval is calculated from "
2549 "the founding turn of the city. So for example if this "
2550 "setting is 5, citizens will look for a suitable migration "
2551 "destination every five turns from the founding of their "
2552 "current city. Migration will never occur the same turn that "
2553 "a city is built. This setting has no effect unless "
2554 "migration is enabled by the 'migration' setting."),
2560 ALLOW_BASIC,
N_(
"Whether migration is limited by food"),
2563 N_(
"If this setting is enabled, citizens will not migrate to "
2564 "cities which would not have enough food to support them. "
2565 "This setting has no effect unless migration is enabled by "
2566 "the 'migration' setting."),
2571 SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2572 N_(
"Maximum distance citizens may migrate"),
2575 N_(
"This setting controls how far citizens may look for a suitable "
2576 "migration destination when deciding which city to migrate to. "
2577 "The value is added to the candidate target city's radius and "
2578 "compared to the distance between the two cities. If the "
2579 "distance is lower or equal, migration is possible. (So with a "
2580 "setting of 0, citizens will only consider migrating if their "
2581 "city's center is within the destination city's working radius.) "
2582 "This setting has no effect unless migration is enabled by the "
2583 "'migration' setting."),
2590 N_(
"Percent probability for migration within the same nation"),
2593 N_(
"This setting controls how likely it is for citizens to "
2594 "migrate between cities owned by the same player. Zero "
2595 "indicates migration will never occur, 100 means that "
2596 "migration will always occur if the citizens find a suitable "
2597 "destination. This setting has no effect unless migration is "
2598 "activated by the 'migration' setting."),
2605 N_(
"Percent probability for migration between foreign cities"),
2608 N_(
"This setting controls how likely it is for migration to "
2609 "occur between cities owned by different players. Zero "
2610 "indicates migration will never occur, 100 means that "
2611 "citizens will always migrate if they find a suitable "
2612 "destination. This setting has no effect if migration is not "
2613 "enabled by the 'migration' setting."),
2625 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2626 N_(
"Players that users are allowed to take"),
2629 N_(
"This should be a string of characters, each of which specifies "
2630 "a type or status of a civilization (player).\n"
2631 "Clients will only be permitted to take or observe those players "
2632 "which match one of the specified letters. This only affects "
2633 "future uses of the \"take\" or \"observe\" commands; it is not "
2634 "retroactive. The characters and their meanings are:\n"
2635 " o,O = Global observer\n"
2636 " b = Barbarian players\n"
2637 " d = Dead players\n"
2638 " a,A = AI players\n"
2639 " h,H = Human players\n"
2640 "The first description on this list which matches a player is "
2641 "the one which applies. Thus 'd' does not include dead "
2642 "barbarians, 'a' does not include dead AI players, and so on. "
2643 "Upper case letters apply before the game has started, lower "
2644 "case letters afterwards.\n"
2645 "Each character above may be followed by one of the following "
2646 "numbers to allow or restrict the manner of connection:\n"
2647 "(none) = Controller allowed, observers allowed, can displace "
2648 "connections. (Displacing a connection means that you may take "
2649 "over a player, even when another user already controls that "
2651 " 1 = Controller allowed, observers allowed, can't displace "
2653 " 2 = Controller allowed, no observers allowed, can displace "
2655 " 3 = Controller allowed, no observers allowed, can't "
2656 "displace connections;\n"
2657 " 4 = No controller allowed, observers allowed"),
2661 SSET_NETWORK, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2662 N_(
"Whether AI-status toggles with connection"),
2663 N_(
"If enabled, AI status is turned off when a player "
2664 "connects, and on when a player disconnects."),
2668 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Turn the game ends"),
2669 N_(
"The game will end at the end of the given turn."),
nullptr,
2675 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"Reveal the map"),
2680 N_(
"If \"Reveal map at game start\" (START) is set, the initial "
2681 "state of the entire map will be known to all players from the "
2682 "start of the game, although it may still be fogged (depending "
2683 "on the 'fogofwar' setting). If \"Unfog map for dead players\" "
2684 "(DEAD) is set, dead players can see the entire map, if they are "
2685 "alone in their team."),
2690 ALLOW_NONE, ALLOW_BASIC,
N_(
"Maximum seconds per turn"),
2695 N_(
"If all players have not hit \"Turn Done\" before this time is "
2696 "up, then the turn ends automatically. Zero means there is no "
2697 "timeout. In servers compiled with debugging, a timeout of -1 "
2698 "sets the autogame test mode. Only connections with hack level "
2699 "access may set the timeout to fewer than 30 seconds. Use this "
2700 "with the command \"timeoutincrease\" to have a dynamic timer. "
2701 "The first turn is treated as a special case and is controlled "
2702 "by the 'first_timeout' setting."),
2708 SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
N_(
"First turn timeout"),
2711 N_(
"If greater than 0, T1 will last for 'first_timeout' seconds.\n"
2712 "If set to 0, T1 will not have a timeout.\n"
2713 "If set to -1, the special treatment of T1 will be disabled.\n"
2714 "See also 'timeout'."),
2720 SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2721 N_(
"Timeout at least n seconds when enemy moved"),
2722 N_(
"Any time a unit moves while in sight of an enemy player, "
2723 "the remaining timeout is increased to this value."),
2728 SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
2729 N_(
"Minimum time between unit actions over turn change"),
2732 N_(
"This setting gives the minimum amount of time in seconds "
2733 "between unit moves and other significant actions (such as "
2734 "building cities) after a turn change occurs. For example, "
2735 "if this setting is set to 20 and a unit moves 5 seconds "
2736 "before the turn change, it will not be able to move or act "
2737 "in the next turn for at least 15 seconds. This value is "
2738 "limited to a maximum value of 2/3 'timeout'."),
2743 "unitwaittime_style",
game.
server.unitwaittime_style,
2745 ALLOW_BASIC,
N_(
"Unitwaittime style"),
2751 N_(
"This setting affects unitwaittime:\n"
2752 "- \"Activities\" (ACTIVITIES): Units moved less than "
2753 "'unitwaittime' seconds from turn change will not complete "
2754 "activities such as pillaging and building roads during "
2755 "turn change, but during the next turn when their wait "
2761 "unitwaittime_extended",
game.
server.unitwaittime_extended,
2764 N_(
"Unitwaittime also applies to newly-built and captured/bribed "
2766 N_(
"If set, newly-built units are subject to unitwaittime so that "
2767 "the moment the city production was last touched counts as their "
2768 "last \"action\". Also, getting captured/bribed counts as action "
2769 "for the victim. "),
2776 SSET_INTERNAL, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2777 N_(
"Control of simultaneous player/team phases"),
2778 N_(
"This setting controls whether players may make moves at "
2779 "the same time during a turn. Change in setting takes "
2780 "effect next turn."),
2785 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
2786 N_(
"Max seconds for network buffers to drain"),
2787 N_(
"The server will wait for up to the value of this parameter "
2788 "in seconds, for all client connection network buffers to "
2789 "unblock. Zero means the server will not wait at all."),
2794 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
N_(
"Seconds between PINGs"),
2795 N_(
"The server will poll the clients with a PING request each "
2796 "time this period elapses."),
2801 SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
N_(
"Time to cut a client"),
2802 N_(
"If a client doesn't reply to a PING in this time the client "
2803 "is disconnected."),
2808 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2809 N_(
"Turn-blocking game play mode"),
2810 N_(
"If this is turned on, the game turn is not advanced until "
2811 "all players have finished their turn, including "
2812 "disconnected players."),
2816 SSET_INTERNAL, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2817 N_(
"Fixed-length turns play mode"),
2820 N_(
"If this is turned on the game turn will not advance until "
2821 "the timeout has expired, even after all players have "
2822 "clicked on \"Turn Done\"."),
2823 nullptr,
nullptr,
false),
2827 SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
2828 N_(
"What is in the Demographics report"),
2830 N_(
"This should be a string of characters, each of which specifies "
2831 "the inclusion of a line of information in the Demographics "
2833 "The characters and their meanings are:\n"
2834 " s = include Score\n"
2835 " z = include League Score\n"
2836 " N = include Population\n"
2837 " n = include Population in Citizen Units\n"
2838 " c = include Cities\n"
2839 " i = include Improvements\n"
2840 " w = include Wonders\n"
2841 " A = include Land Area\n"
2842 " S = include Settled Area\n"
2843 " L = include Literacy\n"
2844 " a = include Agriculture\n"
2845 " P = include Production\n"
2846 " E = include Economics\n"
2847 " g = include Gold Income\n"
2848 " R = include Research Speed\n"
2849 " M = include Military Service\n"
2850 " m = include Military Units\n"
2851 " u = include Built Units\n"
2852 " k = include Killed Units\n"
2853 " l = include Lost Units\n"
2854 " O = include Pollution\n"
2855 " C = include Culture\n"
2856 "Additionally, the following characters control whether or not "
2857 "certain columns are displayed in the report:\n"
2858 " q = display \"quantity\" column\n"
2859 " r = display \"rank\" column\n"
2860 " b = display \"best nation\" column\n"
2861 "The order of characters is not significant, but their "
2862 "capitalization is."),
2866 SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
N_(
"Turns per auto-save"),
2870 N_(
"How many turns elapse between automatic game saves. This "
2871 "setting only has an effect when the 'autosaves' setting "
2872 "includes \"New turn\"."),
2877 SSET_INTERNAL, SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
2878 N_(
"Minutes per auto-save"),
2882 N_(
"How many minutes elapse between automatic game saves. "
2883 "Unlike other save types, this save is only meant as backup "
2884 "for computer memory, and it always uses the same name, "
2885 "older saves are not kept. This setting only has an effect "
2886 "when the 'autosaves' setting includes \"Timer\"."),
2892 SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
2893 N_(
"Which savegames are generated automatically"),
2898 N_(
"This setting controls which autosave types get generated:\n"
2899 "- \"New turn\" (TURN): Save when turn begins, once every "
2900 "'saveturns' turns.\n"
2901 "- \"Game over\" (GAMEOVER): Final save when game ends.\n"
2902 "- \"No player connections\" (QUITIDLE): Save before server "
2903 "restarts due to lack of players.\n"
2904 "- \"Server interrupted\" (INTERRUPT): Save when server quits "
2905 "due to interrupt.\n"
2906 "- \"Timer\" (TIMER): Save every 'savefrequency' minutes."),
2910 SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
2911 N_(
"Whether to do saving in separate thread"),
2914 N_(
"If this is turned in, compressing and saving the actual "
2915 "file containing the game situation takes place in the "
2916 "background while game otherwise continues. This way users "
2917 "are not required to wait for the save to finish."),
2921 SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
2922 N_(
"Savegame compression algorithm"),
2923 N_(
"Compression library to use for savegames."),
nullptr,
2929 SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
2930 N_(
"Definition of the save file name"),
2935 N_(
"Within the string the following custom formats are allowed:\n"
2938 " %T = <turn-number>\n"
2939 " %Y = <game-year>\n"
2941 "Example: 'freeciv-T%04T-Y%+05Y-%R' => "
2942 "'freeciv-T0100-Y00001-manual'\n"
2944 "Be careful to use at least one of %T and %Y, else newer "
2945 "savegames will overwrite old ones. If none of the formats is "
2946 "used '-T%04T-Y%05Y-%R' is appended to the value of 'savename'."),
2951 SSET_SITUATIONAL, ALLOW_HACK, ALLOW_HACK,
2952 N_(
"Whether to log player statistics"),
2956 N_(
"If this is turned on, player statistics are appended to the "
2957 "file defined by the option 'scorefile' every turn. These "
2958 "statistics can be used to create power graphs after the game."),
2963 SSET_SITUATIONAL, ALLOW_HACK, ALLOW_HACK,
N_(
"Scorelog level"),
2964 N_(
"Whether scores are logged for all players including AIs, or "
2965 "only for human players."),
2970 SSET_SITUATIONAL, ALLOW_HACK, ALLOW_HACK,
2971 N_(
"Name for the score log file"),
2981 N_(
"The default name for the score log file is "
2982 "'freeciv-score.log'."),
2988 N_(
"Maximum number of connections to the server per host"),
2989 N_(
"New connections from a given host will be rejected if the "
2990 "total number of connections from the very same host equals "
2991 "or exceeds this value. A value of 0 means that there is no "
2992 "limit, at least up to the maximum number of connections "
2993 "supported by the server."),
2999 SSET_NETWORK, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
3000 N_(
"Time before a kicked user can reconnect"),
3003 N_(
"Gives the time in seconds before a user kicked using the "
3004 "\"kick\" command may reconnect. Changing this setting will "
3005 "affect users kicked in the past."),
3011 SSET_INTERNAL, SSET_RARE, ALLOW_CTRL, ALLOW_CTRL,
3012 N_(
"Metaserver info line"),
3013 N_(
"User defined metaserver info line. For most of the time a user "
3014 "defined metamessage will be used instead of an automatically "
3015 "generated message. Set to empty (\"\", not \"empty\") to always "
3016 "use an automatically generated meta server message."),
3045 if (0 == strcmp(
name, pset->name)) {
3082 if (!constant && pset->
help_func !=
nullptr) {
3120 size_t reject_msg_len)
3131 reject_msg, reject_msg_len,
3132 _(
"The setting '%s' can't be modified after the map is fixed."),
3168 reject_msg, reject_msg_len,
3169 _(
"The setting '%s' can't be modified after the game has started."),
3179 qCritical(
"Wrong class variant for setting %s (%d): %d.",
3193 size_t reject_msg_len)
3197 _(
"You are not allowed to change the setting '%s'."),
3205 _(
"The setting '%s' is locked by the ruleset."),
3218 enum cmdlevel plevel)
3243 size_t max_matches,
size_t *pnum_matches)
3246 size_t len = qstrlen(prefix);
3256 for (i = 0, num_matches = 0; (
name = name_fn(i)); i++) {
3258 if (strlen(
name->support) ==
len) {
3262 if (num_matches < max_matches) {
3263 matches.append(
name->support);
3266 if (0 == num_matches++) {
3272 if (1 == num_matches) {
3274 }
else if (1 < num_matches) {
3286 const char *prefix,
int *pvalue,
3287 char *reject_msg,
size_t reject_msg_len)
3290 matches.reserve(16);
3301 _(
"\"%s\" prefix is ambiguous. Candidates are: %s."),
3323 bool value,
bool pretty,
char *buf,
3344 const char *val,
int *pint_val,
3347 size_t reject_msg_len)
3351 if (SST_BOOL != pset->
stype) {
3353 _(
"This setting is not a boolean."));
3362 && (
nullptr == pset->
boolean.validate
3363 || pset->
boolean.validate(0 != *pint_val, caller, reject_msg,
3374 size_t reject_msg_len)
3384 *pset->
boolean.pvalue = (0 != int_val);
3405 size_t reject_msg_len)
3420 (
static_cast<const struct
setting *
>(data))->boolean.name(val);
3422 return (
nullptr !=
name ?
name->support :
nullptr);
3429 bool pretty,
char *buf,
size_t buf_len)
3441 return pset->
integer.min_value;
3450 return pset->
integer.max_value;
3459 size_t reject_msg_len)
3479 size_t reject_msg_len)
3481 if (SST_INT != pset->
stype) {
3483 _(
"This setting is not an integer."));
3487 if (val < pset->integer.min_value || val > pset->
integer.max_value) {
3489 _(
"Value out of range: %d (min: %d; max: %d)."), val,
3496 || pset->
integer.validate(val, caller, reject_msg, reject_msg_len));
3513 const char *value,
bool pretty,
3514 char *buf,
size_t buf_len)
3530 size_t reject_msg_len)
3550 size_t reject_msg_len)
3552 if (SST_STRING != pset->
stype) {
3554 _(
"This setting is not a string."));
3558 if (strlen(val) >= pset->
string.value_size) {
3560 _(
"String value too long (max length: %lu)."),
3561 (
unsigned long) pset->
string.value_size);
3565 return (!pset->
string.validate
3566 || pset->
string.validate(val, caller, reject_msg, reject_msg_len));
3576 return pset->
string.value;
3586 (
static_cast<const struct
setting *
>(data))->enumerator.name(val);
3588 return (
nullptr !=
name ?
name->support :
nullptr);
3602 if (
nullptr ==
name) {
3605 return _(
name->pretty);
3607 return name->support;
3638 const char *val,
int *pint_val,
3641 size_t reject_msg_len)
3645 if (SST_ENUM != pset->
stype) {
3647 _(
"This setting is not an enumerator."));
3655 reject_msg, reject_msg_len)
3657 || pset->
enumerator.validate(*pint_val, caller, reject_msg,
3668 int *to_int =
static_cast<int *
>(pset->
enumerator.pvalue);
3672 case sizeof(char): {
3673 char *to_char =
static_cast<char *
>(pset->
enumerator.pvalue);
3675 *to_char =
static_cast<char>(val);
3677 case sizeof(short): {
3678 short *to_short =
static_cast<short *
>(pset->
enumerator.pvalue);
3680 *to_short =
static_cast<short>(val);
3698 val = *(
static_cast<int *
>(pset->
enumerator.pvalue));
3701 val = *(
static_cast<char *
>(pset->
enumerator.pvalue));
3704 val = *(
static_cast<short *
>(pset->
enumerator.pvalue));
3707 qCritical(
"Illegal enum store size %d, can't read value",
3722 size_t reject_msg_len)
3736 qCritical(
"Illegal enumerator value size %d for %s",
3751 size_t reject_msg_len)
3766 (
static_cast<const struct
setting *
>(data))->bitwise.name(bit);
3768 return (
nullptr !=
name ?
name->support :
nullptr);
3782 if (
nullptr ==
name) {
3785 return _(
name->pretty);
3787 return name->support;
3795 unsigned value,
bool pretty,
3796 char *buf,
size_t buf_len)
3799 char *old_buf = buf;
3807 for (bit = 0; (
name = pset->
bitwise.name(bit)); bit++) {
3808 if ((1 << bit) & value) {
3815 if (0 == vec.count()) {
3831 for (bit = 0; (
name = pset->
bitwise.name(bit)); bit++) {
3832 if ((1 << bit) & value) {
3833 if (
'\0' != buf[0]) {
3855 unsigned *pint_val,
struct connection *caller,
3856 char *reject_msg,
size_t reject_msg_len)
3862 if (SST_BITWISE != pset->
stype) {
3864 _(
"This setting is not a bitwise."));
3872 p = strchr(val,
'|');
3881 if (
nullptr == p &&
'\0' == buf[0] && 0 == *pint_val) {
3885 reject_msg, reject_msg_len)) {
3888 *pint_val |= 1 << bit;
3890 }
while (
nullptr != p);
3892 return (
nullptr == pset->
bitwise.validate
3893 || pset->
bitwise.validate(*pint_val, caller, reject_msg,
3904 size_t reject_msg_len)
3910 reject_msg, reject_msg_len)) {
3914 *pset->
bitwise.pvalue = int_val;
3925 size_t reject_msg_len)
3930 reject_msg, reject_msg_len);
3947 char *buf,
size_t buf_len)
3953 switch (pset->
stype) {
3974 qCritical(
"%s(): Setting \"%s\" (nb %d) not handled in switch statement.",
3983 char *buf,
size_t buf_len)
3989 switch (pset->
stype) {
4010 qCritical(
"%s(): Setting \"%s\" (nb %d) not handled in switch statement.",
4020 switch (pset->
stype) {
4029 pset->
string.value_size);
4050 if (pset->
action !=
nullptr) {
4075 qDebug(
"no [%s] section for game settings in %s",
section,
4079 file,
nullptr,
"%s.set%d.name",
section, j));
4111 struct setting *pset =
nullptr;
4112 char reject_msg[256], buf[256];
4124 if (pset ==
nullptr) {
4129 switch (pset->
stype) {
4141 qCritical(
"Can't read value for setting '%s': %s",
name,
4145 if (val != *pset->
boolean.pvalue) {
4146 if (
nullptr == pset->
boolean.validate
4147 || pset->
boolean.validate(val,
nullptr, reject_msg,
4148 sizeof(reject_msg))) {
4150 qInfo(
_(
"Ruleset: '%s' has been set to %s."),
setting_name(pset),
4153 qCritical(
"%s", reject_msg);
4162 qCritical(
"Can't read value for setting '%s': %s",
name,
4164 }
else if (val != *pset->
integer.pvalue) {
4166 sizeof(reject_msg))) {
4167 qInfo(
_(
"Ruleset: '%s' has been set to %s."),
setting_name(pset),
4170 qCritical(
"%s", reject_msg);
4178 if (
nullptr == val) {
4179 qCritical(
"Can't read value for setting '%s': %s",
name,
4181 }
else if (0 != strcmp(val, pset->
string.value)) {
4183 sizeof(reject_msg))) {
4184 qInfo(
_(
"Ruleset: '%s' has been set to %s."),
setting_name(pset),
4187 qCritical(
"%s", reject_msg);
4198 qCritical(
"Can't read value for setting '%s': %s",
name,
4202 || pset->
enumerator.validate(val,
nullptr, reject_msg,
4203 sizeof(reject_msg))) {
4205 qInfo(
_(
"Ruleset: '%s' has been set to %s."),
setting_name(pset),
4208 qCritical(
"%s", reject_msg);
4218 "%s.value", path)) {
4219 qCritical(
"Can't read value for setting '%s': %s",
name,
4221 }
else if (val != *pset->
bitwise.pvalue) {
4222 if (
nullptr == pset->
bitwise.validate
4223 || pset->
bitwise.validate(
static_cast<unsigned>(val),
nullptr,
4224 reject_msg,
sizeof(reject_msg))) {
4226 qInfo(
_(
"Ruleset: '%s' has been set to %s."),
setting_name(pset),
4229 qCritical(
"%s", reject_msg);
4247 qInfo(
_(
"Ruleset: '%s' has been locked by the ruleset."),
4265 return (0 != strcmp(pset->
string.value, pset->
string.default_value));
4275 qCritical(
"%s(): Setting \"%s\" (nb %d) not handled in switch statement.",
4309 pset->
string.game_value =
new char[pset->
string.value_size]{};
4312 pset->
string.value_size);
4335 delete[] pset->
string.game_value;
4336 pset->
string.game_value =
nullptr;
4345 char reject_msg[256] =
"", buf[256];
4349 sizeof(reject_msg))) {
4360 sizeof(reject_msg)));
4365 reject_msg,
sizeof(reject_msg));
4370 sizeof(reject_msg));
4376 false, buf,
sizeof(buf))
4378 sizeof(reject_msg)));
4384 false, buf,
sizeof(buf))
4386 sizeof(reject_msg)));
4396 "Error restoring setting '%s' to the value from game start: %s",
4436 "%s.set%d.gamestart",
section, set_count);
4442 "%s.set%d.gamestart",
section, set_count);
4448 "%s.set%d.gamestart",
section, set_count);
4453 "%s.set%d.value",
section, set_count);
4456 "%s.set%d.gamestart",
section, set_count);
4461 "%s.set%d.value",
section, set_count);
4464 "%s.set%d.gamestart",
section, set_count);
4471 "%s.set%d.gamestart",
section, set_count);
4481 "%s.gamestart_valid",
section);
4490 char reject_msg[256], buf[256];
4492 int oldcitymindist =
game.
info.citymindist;
4499 qDebug(
"Can't read the number of settings in the save file.");
4505 file,
false,
"%s.gamestart_valid",
section);
4507 for (i = 0; i < set_count; i++) {
4517 switch (pset->stype) {
4522 qDebug(
"Option '%s' not defined in the savegame: %s",
name,
4527 if (val != *pset->boolean.pvalue) {
4530 && (
nullptr == pset->boolean.validate
4531 || pset->boolean.validate(val,
nullptr, reject_msg,
4532 sizeof(reject_msg)))) {
4533 *pset->boolean.pvalue = val;
4534 qInfo(
_(
"Savegame: '%s' has been set to %s."),
4538 qCritical(
"Savegame: error restoring '%s' . (%s)",
4543 _(
"Savegame: '%s' explicitly set to value same as default."),
4553 qDebug(
"Option '%s' not defined in the savegame: %s",
name,
4558 if (val != *pset->integer.pvalue) {
4561 && (
nullptr == pset->integer.validate
4562 || pset->integer.validate(val,
nullptr, reject_msg,
4563 sizeof(reject_msg)))) {
4564 *pset->integer.pvalue = val;
4565 qInfo(
_(
"Savegame: '%s' has been set to %s."),
4569 qCritical(
"Savegame: error restoring '%s' . (%s)",
4574 _(
"Savegame: '%s' explicitly set to value same as default."),
4584 if (
nullptr == val) {
4585 qDebug(
"Option '%s' not defined in the savegame: %s",
name,
4590 if (0 != strcmp(val, pset->string.value)) {
4592 sizeof(reject_msg))) {
4593 qInfo(
_(
"Savegame: '%s' has been set to %s."),
4597 qCritical(
"Savegame: error restoring '%s' . (%s)",
4602 _(
"Savegame: '%s' explicitly set to value same as default."),
4613 "%s.set%d.value",
section, i)) {
4614 qDebug(
"Option '%s' not defined in the savegame: %s",
name,
4622 && (
nullptr == pset->enumerator.validate
4623 || pset->enumerator.validate(val,
nullptr, reject_msg,
4624 sizeof(reject_msg)))) {
4626 qInfo(
_(
"Savegame: '%s' has been set to %s."),
4630 qCritical(
"Savegame: error restoring '%s' . (%s)",
4635 _(
"Savegame: '%s' explicitly set to value same as default."),
4646 "%s.set%d.value",
section, i)) {
4647 qDebug(
"Option '%s' not defined in the savegame: %s",
name,
4652 if (val != *pset->bitwise.pvalue) {
4655 && (
nullptr == pset->bitwise.validate
4656 || pset->bitwise.validate(val,
nullptr, reject_msg,
4657 sizeof(reject_msg)))) {
4658 *pset->bitwise.pvalue = val;
4659 qInfo(
_(
"Savegame: '%s' has been set to %s."),
4663 qCritical(
"Savegame: error restoring '%s' . (%s)",
4668 _(
"Savegame: '%s' explicitly set to value same as default."),
4681 switch (pset->stype) {
4684 file, *pset->boolean.pvalue,
"%s.set%d.gamestart",
section, i);
4689 file, *pset->integer.pvalue,
"%s.set%d.gamestart",
section, i);
4695 "%s.set%d.gamestart",
4697 pset->string.value_size);
4703 pset,
"%s.set%d.gamestart",
section, i);
4709 pset,
"%s.set%d.gamestart",
section, i);
4730 game.
info.citymindist = oldcitymindist;
4748 log_debug(
"No saved settings from the game start available.");
4828 #define PACKET_COMMON_INIT(packet, pset, pconn) \
4829 memset(&packet, 0, sizeof(packet)); \
4830 packet.id = setting_number(pset); \
4831 packet.is_visible = setting_is_visible(pset, pconn); \
4832 packet.is_changeable = setting_is_changeable(pset, pconn, nullptr, 0); \
4833 packet.initial_setting = game.info.is_new_game; \
4834 packet.setdef = setting_get_setdef(pset);
4838 struct packet_server_setting_bool packet;
4843 if (packet.is_visible) {
4844 packet.val = *pset->
boolean.pvalue;
4845 packet.default_val = pset->
boolean.default_value;
4847 send_packet_server_setting_bool(pconn, &packet);
4852 struct packet_server_setting_int packet;
4857 if (packet.is_visible) {
4858 packet.val = *pset->
integer.pvalue;
4859 packet.default_val = pset->
integer.default_value;
4860 packet.min_val = pset->
integer.min_value;
4861 packet.max_val = pset->
integer.max_value;
4863 send_packet_server_setting_int(pconn, &packet);
4868 struct packet_server_setting_str packet;
4873 if (packet.is_visible) {
4877 send_packet_server_setting_str(pconn, &packet);
4882 struct packet_server_setting_enum packet;
4889 if (packet.is_visible) {
4891 packet.default_val = pset->
enumerator.default_value;
4892 for (i = 0; (val_name = pset->
enumerator.name(i)); i++) {
4897 packet.values_num = i;
4901 send_packet_server_setting_enum(pconn, &packet);
4906 struct packet_server_setting_bitwise packet;
4913 if (packet.is_visible) {
4914 packet.val = *pset->
bitwise.pvalue;
4915 packet.default_val = pset->
bitwise.default_value;
4916 for (i = 0; (val_name = pset->
bitwise.name(i)); i++) {
4921 packet.bits_num = i;
4925 send_packet_server_setting_bitwise(pconn, &packet);
4953 enum cmdlevel old_level,
4954 enum cmdlevel new_level)
4956 enum cmdlevel min_level;
4957 enum cmdlevel max_level;
4959 if (old_level == new_level) {
4963 if (old_level < new_level) {
4964 min_level = old_level;
4965 max_level = new_level;
4967 min_level = new_level;
4968 max_level = old_level;
4973 if ((pset->access_level_read >= min_level
4974 && pset->access_level_read <= max_level)
4975 || (pset->access_level_write >= min_level
4976 && pset->access_level_write <= max_level)) {
4988 struct packet_server_setting_control control;
4989 struct packet_server_setting_const
setting;
4996 control.categories_num = SSET_NUM_CATEGORIES;
4997 for (i = 0; i < SSET_NUM_CATEGORIES; i++) {
5000 sset_category_name(sset_category(i)));
5004 send_packet_server_setting_control(pconn, &control);
5016 send_packet_server_setting_const(pconn, &
setting);
5032 for (i = 0; i < OLEVELS_NUM; i++) {
5044 "No setting level defined for '%s'.",
5053 case SSET_SITUATIONAL:
5054 setting_list_append(
setting_sorted.level[SSET_SITUATIONAL], pset);
5066 "Invalid setting level for '%s' (%s).",
5074 for (i = 0; i < OLEVELS_NUM; i++) {
5114 const struct setting *
const *ppset2)
5116 const struct setting *pset1 = *ppset1;
5117 const struct setting *pset2 = *ppset2;
5145 for (i = 0; i < OLEVELS_NUM; i++) {
QString strvec_to_and_list(const QVector< QString > &psv)
bool BV_ISSET(const BV &bv, int bit)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
const struct ft_color ftc_server
int generate_save_name(const char *format, char *buf, int buflen, const char *reason)
Generate a default save file name and place it in the provided buffer.
#define GAME_DEFAULT_TECHPENALTY
#define GAME_MAX_RAPTUREDELAY
#define GAME_DEFAULT_START_CITY
#define GAME_DEFAULT_KILLSTACK
#define GAME_MAX_DIPLCHANCE
#define GAME_MAX_SCIENCEBOX
#define GAME_MAX_EVENT_CACHE_MAX_SIZE
#define GAME_DEFAULT_REVOLENTYPE
#define GAME_DEFAULT_AUTO_AI_TOGGLE
#define GAME_MIN_RAZECHANCE
#define GAME_MIN_GLOBAL_WARMING_PERCENT
#define GAME_DEFAULT_CARAVAN_BONUS_STYLE
#define GAME_MAX_TECHLOSSFG
#define GAME_DEFAULT_EVENT_CACHE_INFO
#define GAME_DEFAULT_MGR_FOODNEEDED
#define GAME_DEFAULT_TECHLOST_DONOR
#define GAME_DEFAULT_ALLOWED_CITY_NAMES
#define GAME_MIN_TRADEWORLDRELPCT
#define GAME_DEFAULT_SCORELOG
#define GAME_MAX_KILLUNHOMED
#define GAME_MIN_TECHLOST_RECV
#define GAME_MIN_FREECOST
#define GAME_MAX_CONTACTTURNS
#define GAME_MIN_SPACESHIP_TRAVEL_TIME
#define GAME_MAX_TECHLOST_RECV
#define GAME_DEFAULT_OCCUPYCHANCE
#define GAME_DEFAULT_USER_META_MESSAGE
#define GAME_DEFAULT_GLOBAL_WARMING_PERCENT
#define GAME_DEFAULT_TRADING_TECH
#define GAME_MIN_SCIENCEBOX
#define GAME_MAX_PINGTIMEOUT
#define GAME_MAX_SAVEFREQUENCY
#define GAME_MIN_REVOLUTION_LENGTH
#define GAME_MAX_MGR_TURNINTERVAL
#define GAME_DEFAULT_SAVETURNS
#define GAME_DEFAULT_BORDERS
#define GAME_DEFAULT_AIRLIFTINGSTYLE
#define GAME_MAX_CONQUERCOST
#define GAME_MAX_AQUEDUCTLOSS
#define GAME_DEFAULT_KILLUNHOMED
#define GAME_DEFAULT_SCIENCEBOX
#define GAME_MIN_DIPLGOLDCOST
#define GAME_DEFAULT_MGR_WORLDCHANCE
#define GAME_MIN_PINGTIME
#define GAME_DEFAULT_ONSETBARBARIAN
#define GAME_MIN_ONSETBARBARIAN
#define GAME_MAX_TECHLOSSREST
#define GAME_DEFAULT_KILLCITIZEN
#define GAME_MIN_INCITE_GOLD_LOSS_CHANCE
#define GAME_MIN_MGR_NATIONCHANCE
#define GAME_DEFAULT_NATIONSET
#define GAME_DEFAULT_SHIELDBOX
#define GAME_MIN_NOTRADESIZE
#define GAME_MAX_OCCUPYCHANCE
#define GAME_DEFAULT_MAXCONNECTIONSPERHOST
#define GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE
#define GAME_DEFAULT_DEMOGRAPHY
#define GAME_MIN_MAXCONNECTIONSPERHOST
#define GAME_DEFAULT_FULLTRADESIZE
#define GAME_MAX_DISPERSION
#define GAME_MIN_TECHLOST_DONOR
#define GAME_DEFAULT_RAPTUREDELAY
#define GAME_MIN_MGR_TURNINTERVAL
#define GAME_DEFAULT_REVOLUTION_LENGTH
#define GAME_DEFAULT_MGR_TURNINTERVAL
#define GAME_DEFAULT_START_UNITS
#define GAME_MAX_SPACESHIP_TRAVEL_TIME
#define GAME_DEFAULT_ALLOW_TAKE
#define GAME_DEFAULT_THREADED_SAVE
#define GAME_MAX_TRADEWORLDRELPCT
#define GAME_DEFAULT_MIN_PLAYERS
#define GAME_MIN_CONQUERCOST
#define GAME_MAX_MGR_DISTANCE
#define GAME_DEFAULT_SPACESHIP_TRAVEL_TIME
#define GAME_MIN_TECHLOSSREST
#define GAME_DEFAULT_AUTOATTACK
#define GAME_DEFAULT_SAVEFREQUENCY
#define GAME_DEFAULT_REVEALMAP
#define GAME_DEFAULT_SCOREFILE
#define GAME_MAX_FIRST_TIMEOUT
#define GAME_MIN_MGR_DISTANCE
#define GAME_MIN_DISPERSION
#define GAME_DEFAULT_TEAM_POOLED_RESEARCH
#define GAME_DEFAULT_SEED
#define GAME_DEFAULT_HOMECAUGHTUNITS
#define GAME_MAX_GLOBAL_WARMING_PERCENT
#define GAME_MAX_MAXCONNECTIONSPERHOST
#define GAME_DEFAULT_NETWAIT
#define GAME_MIN_PINGTIMEOUT
#define GAME_MIN_TECHPENALTY
#define GAME_MIN_CONTACTTURNS
#define GAME_MAX_INCITE_GOLD_LOSS_CHANCE
#define GAME_DEFAULT_UNITWAITTIME_STYLE
#define GAME_DEFAULT_KICK_TIME
#define GAME_DEFAULT_PLRCOLORMODE
#define GAME_MAX_CITYMINDIST
#define GAME_DEFAULT_DIPLCHANCE
#define GAME_MAX_NUCLEAR_WINTER_PERCENT
#define GAME_MIN_END_TURN
#define GAME_DEFAULT_UNRPROTECTS
#define GAME_MIN_MGR_WORLDCHANCE
#define GAME_DEFAULT_RAZECHANCE
#define GAME_MIN_SHIELDBOX
#define GAME_MIN_FIRST_TIMEOUT
#define GAME_MAX_RAZECHANCE
#define GAME_MAX_ONSETBARBARIAN
#define GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE
#define GAME_MAX_MAX_PLAYERS
#define GAME_DEFAULT_TRADING_CITY
#define GAME_DEFAULT_FOODBOX
#define GAME_DEFAULT_COMPRESS_TYPE
#define GAME_DEFAULT_PINGTIMEOUT
#define GAME_DEFAULT_TRADE_REVENUE_STYLE
#define GAME_DEFAULT_SAVEPALACE
#define GAME_MIN_EVENT_CACHE_TURNS
#define GAME_DEFAULT_GLOBAL_WARMING
#define GAME_MAX_DIPLGOLDCOST
#define GAME_DEFAULT_TECHLOST_RECV
#define GAME_DEFAULT_NOTRADESIZE
#define GAME_MAX_TECHLOST_DONOR
#define GAME_MIN_SAVETURNS
#define GAME_MAX_UNITWAITTIME
#define GAME_DEFAULT_FIRST_TIMEOUT
#define GAME_DEFAULT_NUCLEAR_WINTER_PERCENT
#define GAME_MIN_CIVILWARSIZE
#define GAME_DEFAULT_TRADING_GOLD
#define GAME_MIN_TECHLEAK
#define GAME_DEFAULT_TRAIT_DIST_MODE
#define GAME_DEFAULT_NUCLEAR_WINTER
#define GAME_MIN_DISASTERS
#define GAME_MIN_OCCUPYCHANCE
#define GAME_DEFAULT_FREECOST
#define GAME_MIN_KICK_TIME
#define GAME_DEFAULT_MAX_PLAYERS
#define GAME_DEFAULT_CITYMINDIST
#define GAME_MIN_NUCLEAR_WINTER_PERCENT
#define GAME_DEFAULT_PHASE_MODE
#define GAME_DEFAULT_AIFILL
#define GAME_DEFAULT_TRADEWORLDRELPCT
#define GAME_DEFAULT_MULTIRESEARCH
#define GAME_DEFAULT_CONQUERCOST
#define GAME_MAX_TECHPENALTY
#define GAME_DEFAULT_TIMEOUT
#define GAME_MAX_DISASTERS
#define GAME_MIN_INCITE_GOLD_CAPT_CHANCE
#define GAME_MIN_TECHLOSSFG
#define GAME_MAX_END_TURN
#define GAME_DEFAULT_TECHLOSSREST
#define GAME_MIN_KILLUNHOMED
#define GAME_MAX_NOTRADESIZE
#define GAME_DEFAULT_CONTACTTURNS
#define GAME_DEFAULT_SCORELOGLEVEL
#define GAME_DEFAULT_TECHLOSSFG
#define GAME_DEFAULT_TECHLEVEL
#define GAME_MIN_MAX_PLAYERS
#define GAME_DEFAULT_DISASTERS
#define GAME_MAX_FREECOST
#define GAME_MAX_REVOLUTION_LENGTH
#define GAME_DEFAULT_GOLD
#define GAME_MIN_AQUEDUCTLOSS
#define GAME_MIN_DIPLBULBCOST
#define GAME_DEFAULT_MIGRATION
#define GAME_MIN_EVENT_CACHE_MAX_SIZE
#define GAME_MIN_CITYMINDIST
#define GAME_MIN_SAVEFREQUENCY
#define GAME_DEFAULT_NATURALCITYNAMES
#define GAME_DEFAULT_EVENT_CACHE_TURNS
#define GAME_DEFAULT_VICTORY_CONDITIONS
#define GAME_MIN_UNITWAITTIME
#define GAME_DEFAULT_FOGGEDBORDERS
#define GAME_DEFAULT_UNITWAITTIME
#define GAME_DEFAULT_TIMEOUTADDEMOVE
#define GAME_DEFAULT_DISPERSION
#define GAME_MAX_CIVILWARSIZE
#define GAME_DEFAULT_AUTOSAVES
#define GAME_DEFAULT_EVENT_CACHE_CHAT
#define GAME_DEFAULT_DIPLOMACY
#define GAME_DEFAULT_MGR_DISTANCE
#define GAME_MIN_DIPLCHANCE
#define GAME_DEFAULT_TURNBLOCK
#define GAME_MAX_SAVETURNS
#define GAME_MAX_PINGTIME
#define GAME_DEFAULT_PINGTIME
#define GAME_DEFAULT_UNITWAITTIME_EXTENDED
#define GAME_DEFAULT_AQUEDUCTLOSS
#define GAME_DEFAULT_TRADEMINDIST
#define GAME_DEFAULT_BARBARIANRATE
#define GAME_DEFAULT_HAPPYBORDERS
#define GAME_MAX_FULLTRADESIZE
#define GAME_MAX_TECHLEAK
#define GAME_MAX_MGR_NATIONCHANCE
#define GAME_MAX_TECHLEVEL
#define GAME_MAX_MGR_WORLDCHANCE
#define GAME_MIN_MIN_PLAYERS
#define GAME_MAX_TRADEMINDIST
#define GAME_DEFAULT_END_TURN
#define GAME_MAX_EVENT_CACHE_TURNS
#define GAME_MAX_DIPLBULBCOST
#define GAME_DEFAULT_DIPLGOLDCOST
#define GAME_MAX_SHIELDBOX
#define GAME_DEFAULT_TECHLEAK
#define GAME_MAX_MIN_PLAYERS
#define GAME_DEFAULT_END_SPACESHIP
#define GAME_MIN_RAPTUREDELAY
#define GAME_DEFAULT_EVENT_CACHE_MAX_SIZE
#define GAME_DEFAULT_SAVE_NAME
#define GAME_MIN_TRADEMINDIST
#define GAME_DEFAULT_MGR_NATIONCHANCE
#define GAME_MIN_TECHLEVEL
#define GAME_MAX_INCITE_GOLD_CAPT_CHANCE
#define GAME_DEFAULT_FOGOFWAR
#define GAME_DEFAULT_PERSISTENTREADY
#define GAME_MIN_FULLTRADESIZE
#define GAME_DEFAULT_DIPLBULBCOST
#define GAME_DEFAULT_RESTRICTINFRA
#define GAME_MAX_KICK_TIME
#define GAME_DEFAULT_CIVILWARSIZE
void send_game_info(struct conn_list *dest)
Send game_info packet; some server options and various stuff...
enum unit_role_id crole_to_role_id(char crole)
Get role_id for given role character.
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
bool map_is_empty()
Returns TRUE if we are at a stage of the game where the map has not yet been generated/loaded.
int map_startpos_count()
Is there start positions set for map.
#define MAP_MIN_STEEPNESS
#define MAP_MAX_LINEAR_SIZE
#define MAP_MAX_TILESPERPLAYER
#define MAP_MAX_FLATPOLES
#define MAP_MIN_TILESPERPLAYER
#define MAP_DEFAULT_LINEAR_SIZE
#define MAP_DEFAULT_STARTPOS
#define MAP_DEFAULT_ANIMALS
#define MAP_DEFAULT_TEAM_PLACEMENT
#define MAP_MIN_TEMPERATURE
#define MAP_DEFAULT_MAPSIZE
#define MAP_MIN_LINEAR_SIZE
#define MAP_MAX_STEEPNESS
#define MAP_DEFAULT_LANDMASS
#define MAP_MIN_FLATPOLES
#define MAP_MAX_TEMPERATURE
#define MAP_DEFAULT_SINGLE_POLE
#define MAP_DEFAULT_SEPARATE_POLES
#define MAP_DEFAULT_RICHES
#define MAP_DEFAULT_TINYISLES
#define MAP_DEFAULT_TILESPERPLAYER
#define MAP_DEFAULT_TEMPERATURE
#define MAP_DEFAULT_ALLTEMPERATE
#define MAP_DEFAULT_GENERATOR
#define MAP_DEFAULT_FLATPOLES
#define MAP_DEFAULT_WETNESS
#define MAP_DEFAULT_STEEPNESS
std::vector< nation_type > nations
const struct rgbcolor * nation_color(const struct nation_type *pnation)
Returns nation's player color preference, or nullptr if none.
struct nation_set * nation_set_by_rule_name(const char *name)
Return the nation set that has the given (untranslated) rule name.
#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,...)
See notify_conn_packet - this is just the "non-v" version, with varargs.
int player_count()
Return the number of players.
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
Set the player's nation to the given nation (may be nullptr).
#define players_iterate_end
#define players_iterate(_pplayer)
void send_nation_availability(struct conn_list *dest, bool nationset_change)
Tell clients which nations can be picked given current server settings.
void count_playable_nations()
Update the server's cached number of playable nations.
void server_player_set_color(struct player *pplayer, const struct rgbcolor *prgbcolor)
Set the player's color.
void send_player_info_c(struct player *src, struct conn_list *dest)
Send information about player slot 'src', or all valid (i.e.
int normal_player_count()
Return the number of non-barbarian players.
bool nation_is_in_current_set(const struct nation_type *pnation)
Is the nation in the currently selected nationset? If not, it's not allowed to appear in the game.
const char * secfile_error()
Returns the last error which occurred in a string.
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
Lookup a integer value in the secfile.
bool secfile_lookup_enum_data(const struct section_file *secfile, int *pvalue, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
Lookup a value saved as string in the secfile.
int secfile_lookup_enum_default_data(const struct section_file *secfile, int defval, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
Lookup a value saved as string in the secfile.
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
Lookup a string value in the secfile.
const char * secfile_name(const struct section_file *secfile)
Return the filename the section file was loaded as, or "(anonymous)" if this sectionfile was created ...
struct section * secfile_section_by_name(const struct section_file *secfile, const QString &name)
Returns the first section matching the name.
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
Lookup a boolean value in the secfile.
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
Lookup a string value in the secfile.
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
Lookup a integer value in the secfile.
bool secfile_lookup_bool(const struct section_file *secfile, bool *bval, const char *path,...)
Lookup a boolean value in the secfile.
#define secfile_insert_int(secfile, value, path,...)
#define secfile_insert_str(secfile, string, path,...)
#define secfile_insert_bool(secfile, value, path,...)
#define secfile_insert_enum_data(secfile, value, bitwise, name_fn, data, path,...)
const void * secfile_data_t
void log_civ_score_init()
Initialize score logging system.
bool is_valid_demography(const char *demography, int *error)
Verify that a given demography string is valid.
void log_civ_score_free()
Free resources allocated for score logging system.
bool setting_int_validate(const struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
static const struct sset_val_name * teamplacement_name(int team_placement)
Team placement setting names accessor.
static void metamessage_action(const struct setting *pset)
Update metaserver message string from changed user meta server message string.
void settings_init(bool act)
Initialize stuff related to this code module.
static enum m_pre_result setting_match_prefix_base(const val_name_func_t name_fn, const char *prefix, int *ind_result, QVector< QString > &matches, size_t max_matches, size_t *pnum_matches)
Convert the string prefix to an integer representation.
static const char * setting_int_to_str(const struct setting *pset, int value, bool pretty, char *buf, size_t buf_len)
Compute the string representation of the value for this integer setting.
static bool savename_validate(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify the selected savename definition.
#define PACKET_COMMON_INIT(packet, pset, pconn)
static bool endturn_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify that a given endturn is valid.
void setting_action(const struct setting *pset)
Execute the action callback if needed.
void settings_reset()
Reset all settings iff they are changeable.
static const struct sset_val_name * trait_dist_name(int trait_dist)
Trait distribution setting names accessor.
bool(* bitwise_validate_func_t)(unsigned value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
#define GEN_BOOL(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, _default)
static const char * setting_bool_secfile_str(secfile_data_t data, int val)
Convert the integer to the long support string representation of a boolean setting.
int setting_int_get(struct setting *pset)
Get value of integer setting.
static const struct sset_val_name * scoreloglevel_name(enum scoreQtMsgType sl_level)
Scorelog level names accessor.
static void nationset_action(const struct setting *pset)
Restrict to the selected nation set.
void settings_game_start()
Save setting values at the start of the game.
bool setting_enum_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
static const struct sset_val_name * bool_name(int enable)
Names accessor for boolean settings (disable/enable).
void setting_set_to_default(struct setting *pset)
Update the setting to the default value.
static void timeout_action(const struct setting *pset)
Enact a change in the 'timeout' server setting immediately, if the game is afoot.
void settings_game_load(struct section_file *file, const char *section)
Restore all settings from a savegame.
static bool setting_match_prefix(const val_name_func_t name_fn, const char *prefix, int *pvalue, char *reject_msg, size_t reject_msg_len)
Convert the string prefix to an integer representation.
void settings_free()
Deinitialize stuff related to this code module.
int setting_number(const struct setting *pset)
Returns the id to the given setting.
bool setting_int_set(struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
enum sset_category setting_category(const struct setting *pset)
Access function for the setting category.
int settings_list_cmp(const struct setting *const *pset1, const struct setting *const *pset2)
Update sorted settings (changed and locked values).
static const struct sset_val_name * mapsize_name(int mapsize)
Map size definition setting names accessor.
static const struct sset_val_name * unitwaittime_name(int bit)
Unitwaittime style names accessor.
bool setting_is_visible(const struct setting *pset, struct connection *caller)
Returns whether the specified server setting (option) can be seen by the caller.
static bool first_timeout_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Validate the 'first_timeout' server setting.
bool setting_locked(const struct setting *pset)
Returns if the setting is locked by the ruleset.
bool setting_non_default(const struct setting *pset)
Returns whether the setting has non-default value.
static bool xsize_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
xsize setting validation callback.
static const char * setting_enum_to_str(const struct setting *pset, int value, bool pretty, char *buf, size_t buf_len)
Compute the string representation of the value for this enumerator setting.
static const struct sset_val_name * borders_name(int borders)
Borders setting names accessor.
static const struct sset_val_name * victory_conditions_name(int condition_bit)
Victory conditions setting names accessor.
enum sset_type setting_type(const struct setting *pset)
Access function for the setting type.
static const char * setting_bool_to_str(const struct setting *pset, bool value, bool pretty, char *buf, size_t buf_len)
Compute the string representation of the value for this boolean setting.
static const struct sset_val_name * autosaves_name(int autosaves_bit)
Autosaves setting names accessor.
bool setting_str_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
#define GEN_STRING(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, _default)
struct setting * setting_by_number(int id)
Returns the setting to the given id.
int setting_int_max(const struct setting *pset)
Returns the maximal integer value for this setting.
void setting_lock_set(struct setting *pset, bool lock)
Set the value for the lock of a setting.
bool settings_game_reset()
Reset all settings to the values at game start.
enum sset_level setting_level(const struct setting *pset)
Access function for the setting level (used by the /show command).
static struct setting settings[]
const char * setting_enum_val(const struct setting *pset, int val, bool pretty)
Convert the integer to the string representation of an enumerator.
static void first_timeout_action(const struct setting *pset)
Enact a change in the 'first_timeout' server setting immediately, if the game is afoot.
static bool allowtake_callback(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify that a given allowtake string is valid.
struct setting_list * settings_list_get(enum sset_level level)
Get a settings list of a certain level.
static const struct sset_val_name * airliftingstyle_name(int bit)
Airlifting style setting names accessor.
static bool setting_ruleset_one(struct section_file *file, const char *name, const char *path)
Set one setting from the game.ruleset file.
static const struct sset_val_name * citynames_name(int citynames)
City names setting names accessor.
bool setting_bitwise_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
static void topology_action(const struct setting *pset)
Topology setting changed.
void settings_game_save(struct section_file *file, const char *section)
Save game settings.
bool setting_str_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
bool(* string_validate_func_t)(const char *value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
#define NAME_CASE(_val, _support, _pretty)
bool settings_ruleset(struct section_file *file, const char *section, bool act)
Load game settings from ruleset file 'game.ruleset'.
static bool setting_is_free_to_change(const struct setting *pset, char *reject_msg, size_t reject_msg_len)
Returns whether the specified server setting (option) can currently be changed without breaking data ...
static const struct sset_val_name * persistentready_name(int persistent_ready)
Persistentready setting names accessor.
static const struct sset_val_name * traderevenuestyle_name(int revenue_style)
Trade revenue style setting names accessor.
struct setting * setting_by_name(const char *name)
Returns the setting to the given name.
struct setting_list * level[OLEVELS_NUM]
static const struct sset_val_name * plrcol_name(int plrcol)
Player colors configuration setting names accessor.
static bool compresstype_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Warn about deprecated compresstype selection.
void setting_changed(struct setting *pset)
Mark setting changed.
#define GEN_ENUM(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_help, func_validate, func_action, func_name, _default)
static bool startunits_callback(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify that a given startunits string is valid.
static void huts_action(const struct setting *pset)
Clean out absolute number of huts when relative setting set.
const char * setting_name(const struct setting *pset)
Access function for the setting name.
static const struct sset_val_name * barbarians_name(int barbarians)
Barbarian setting names accessor.
static bool nationset_callback(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Validate the 'nationset' server setting.
enum setting_default_level setting_get_setdef(const struct setting *pset)
Is the setting in changed state, or the default.
static bool mapsize_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Mapsize setting validation callback.
static const struct sset_val_name * caravanbonusstyle_name(int caravanbonus)
Caravan bonus style setting names accessor.
static void settings_list_free()
Free sorted settings.
const char * setting_value_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
Compute the name of the current value of the setting.
static const struct sset_val_name * revolentype_name(int revolentype)
Revolution length type setting names accessor.
static bool setting_bool_validate_base(const struct setting *pset, const char *val, int *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
static const struct sset_val_name * compresstype_name(enum compress_type compresstype)
Savegame compress type names accessor.
static bool demography_callback(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify that a given demography string is valid.
static const char * setting_str_to_str(const struct setting *pset, const char *value, bool pretty, char *buf, size_t buf_len)
Compute the string representation of the value for this string setting.
static const struct sset_val_name * topology_name(int topology_bit)
Topology setting names accessor.
void settings_turn()
Update stuff every turn that is related to this code module.
bool(* enum_validate_func_t)(int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
bool setting_enum_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
void send_server_setting_control(struct connection *pconn)
Tell the client about all server settings.
static bool plrcol_validate(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Validate that the player color mode can be used.
static struct @108 setting_sorted
const char * setting_bitwise_secfile_str(secfile_data_t data, int bit)
Convert the integer to the long support string representation of an enumerator.
static bool autosaves_callback(unsigned value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Autosaves setting callback.
static bool maxplayers_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify that a given maxplayers is valid.
int setting_int_min(const struct setting *pset)
Returns the minimal integer value for this setting.
bool(* bool_validate_func_t)(bool value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
static bool setting_enum_validate_base(const struct setting *pset, const char *val, int *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
static void autotoggle_action(const struct setting *pset)
Toggle player AI status.
bool setting_bitwise_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
const char * setting_short_help(const struct setting *pset)
Access function for the short help (not translated yet) of the setting.
static const char * huts_help(const struct setting *pset)
Help about huts setting.
const char * setting_extra_help(const struct setting *pset, bool constant)
Access function for the long (extra) help of the setting.
static const struct sset_val_name * happyborders_name(int happyborders)
Happyborders setting names accessor.
#define GEN_INT(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_help, func_validate, func_action, _min, _max, _default)
static const struct sset_val_name * startpos_name(int startpos)
Start position setting names accessor.
bool setting_bool_validate(const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
void settings_list_update()
Update sorted settings (changed and locked values).
bool setting_is_changeable(const struct setting *pset, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns whether the specified server setting (option) can currently be changed by the caller.
const struct sset_val_name *(* val_name_func_t)(int value)
static bool setting_bitwise_validate_base(const struct setting *pset, const char *val, unsigned *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Returns TRUE if 'val' is a valid value for this setting.
char * setting_str_get(struct setting *pset)
Get value of string setting.
static void settings_list_init()
Initialise sorted settings.
static const char * phasemode_help(const struct setting *pset)
Help about phasemode setting.
static const int SETTINGS_NUM
static bool ysize_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
ysize setting validation callback.
static void scorelog_action(const struct setting *pset)
(De)initialze the score log.
const char * setting_bitwise_bit(const struct setting *pset, int bit, bool pretty)
Convert the bit number to its string representation.
int setting_bitwise_get(struct setting *pset)
Get value of bitwise setting.
static bool timeout_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Validate the 'timeout' server setting.
int settings_number()
Returns the total number of settings.
static bool generator_validate(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify the value of the generator option (notably the MAPGEN_SCENARIO case).
const char * setting_default_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
Compute the name of the default value of the setting.
void(* action_callback_func_t)(const struct setting *pset)
static const char * setting_bitwise_to_str(const struct setting *pset, unsigned value, bool pretty, char *buf, size_t buf_len)
Compute the string representation of the value for this bitwise setting.
#define settings_snprintf(_buf, _buf_len, format,...)
bool setting_bool_get(struct setting *pset)
Get value of boolean setting.
static bool set_enum_value(struct setting *pset, int val)
Helper function to write value to enumerator setting.
static void setting_game_set(struct setting *pset, bool init)
Save the setting value of the current game.
static void setting_game_free(struct setting *pset)
Free the memory used for the settings at game start.
static bool scorefile_validate(const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Verify the name for the score log file.
static const struct sset_val_name * diplomacy_name(int diplomacy)
Diplomacy setting names accessor.
static void aifill_action(const struct setting *pset)
Create the selected number of AI's.
bool setting_is_visible_at_level(const struct setting *pset, enum cmdlevel plevel)
Returns whether the specified server setting (option) can be seen by a caller with the specified acce...
bool setting_bool_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
void send_server_setting(struct conn_list *dest, const struct setting *pset)
Tell the client about just one server setting.
void send_server_settings(struct conn_list *dest)
Tell the client about all server settings.
#define GEN_BITWISE(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, func_name, _default)
static void plrcol_action(const struct setting *pset)
Clear any user-set player colors in modes other than PLRCOL_PLR_SET.
const char *(* help_callback_func_t)(const struct setting *pset)
void send_server_access_level_settings(struct conn_list *dest, enum cmdlevel old_level, enum cmdlevel new_level)
Send the server settings that got a different visibility or changability after a connection access le...
static const struct sset_val_name * revealmap_name(int bit)
Revealmap setting names accessor.
static void setting_game_restore(struct setting *pset)
Restore the setting to the value used at the start of the current game.
int read_enum_value(const struct setting *pset)
Helper function to read value from enumerator setting.
static const struct sset_val_name * phasemode_name(int phasemode)
Phase mode names accessor.
bool(* int_validate_func_t)(int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
static bool unitwaittime_callback(int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Check 'timeout' setting if 'unitwaittime' is changed.
static bool topology_callback(unsigned value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Topology setting validation callback.
static const struct sset_val_name * generator_name(int generator)
Generator setting names accessor.
const char * setting_enum_secfile_str(secfile_data_t data, int val)
Convert the integer to the long support string representation of an enumerator.
#define settings_iterate(_level, _pset)
#define settings_iterate_end
bool is_safe_filename(const QString &name)
Check if the name is safe security-wise.
void remove_leading_trailing_spaces(char *s)
Removes leading and trailing spaces in string pointed to by 's'.
const char * aifill(int amount)
Fill or remove players to meet the given aifill.
bool game_was_started()
Returns iff the game was started once upon a time.
enum server_states server_state()
Return current server state.
void toggle_ai_player_direct(struct connection *caller, struct player *pplayer)
Handle ai player ai toggling.
struct civ_game::@28::@32 server
struct conn_list * est_connections
struct packet_game_info info
struct packet_scenario_info scenario
struct packet_timeout_info tinfo
struct civ_map::@39::@41 server
enum cmdlevel access_level
struct setting::@109::@113 string
enum cmdlevel access_level_read
enum setting_default_level setdef
const char *const default_value
const int_validate_func_t validate
enum cmdlevel access_level_write
const val_name_func_t name
struct setting::@109::@111 boolean
const help_callback_func_t help_func
const enum_validate_func_t validate
struct setting::@109::@115 bitwise
struct setting::@109::@112 integer
const action_callback_func_t action
const bool_validate_func_t validate
const string_validate_func_t validate
const bitwise_validate_func_t validate
const unsigned default_value
struct setting::@109::@114 enumerator
enum sset_category scategory
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
size_t fc_strlcpy(char *dest, const char *src, size_t n)
fc_strlcpy() provides utf-8 version of (non-standard) function strlcpy() It is intended as more user-...
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
size_t fc_strlcat(char *dest, const char *src, size_t n)
fc_strlcat() provides utf-8 version of (non-standard) function strlcat() It is intended as more user-...
int fc_strncasecmp(const char *str0, const char *str1, size_t n)
Compare strings like strncmp(), but ignoring case.
#define sz_strlcpy(dest, src)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
#define terrain_has_flag(terr, flag)
void timer_destroy(civtimer *t)
Deletes timer.
void timer_start(civtimer *t)
Start timing, adding to previous accumulated time if timer has not been cleared.
civtimer * timer_renew(civtimer *t, enum timer_timetype type, enum timer_use use)
Allocate a new timer, or reuse t, with specified "type" and "use".
void timer_stop(civtimer *t)
Stop timing, and accumulate time so far.
struct unit_type * get_role_unit(int role, int role_index)
Return index-th unit with specified role/flag.
#define uclass_index(_c_)