Project

General

Profile

Feature #2261 ยป 0067-Add-server-settings-armisticelength-and-ceasefirelen.patch

Marko Lindqvist, 09/20/2026 11:24 AM

View differences:

common/game.h
#define GAME_MIN_REVOLUTION_LENGTH 1
#define GAME_MAX_REVOLUTION_LENGTH 20
#define GAME_DEFAULT_ARMISTICE_LENGTH 16
#define GAME_MIN_ARMISTICE_LENGTH 1
#define GAME_MAX_ARMISTICE_LENGTH 100
#define GAME_DEFAULT_CEASEFIRE_LENGTH 16
#define GAME_MIN_CEASEFIRE_LENGTH 1
#define GAME_MAX_CEASEFIRE_LENGTH 100
#define GAME_DEFAULT_START_YEAR -4000
#define GAME_DEFAULT_AIRLIFTINGSTYLE AIRLIFTING_CLASSICAL
common/networking/packets.def
BOOL airlift_from_always_enabled;
BOOL airlift_to_always_enabled;
UINT8 angrycitizen;
UINT8 armistice_length;
SINT16 base_pollution;
UINT16 base_tech_cost;
UINT16 min_tech_cost;
......
BORDERS_MODE borders;
UINT32 base_bribe_cost;
CARAVAN_BONUS_STYLE caravan_bonus_style;
UINT8 ceasefire_length;
UINT32 culture_vic_points;
UINT16 culture_vic_lead;
UINT16 culture_migration_pml;
server/diplhand.c
#include "diplhand.h"
/* FIXME: Should this be put in a ruleset somewhere? */
#define TURNS_LEFT 16
/**********************************************************************//**
Calls treaty_evaluate function if such is set for AI player.
**************************************************************************/
......
pdest_seen_units = get_units_seen_via_ally(pdest, pgiver);
}
set_diplstate_type(ds_giverdest, ds_destgiver, DS_CEASEFIRE);
ds_giverdest->turns_left = TURNS_LEFT;
ds_destgiver->turns_left = TURNS_LEFT;
ds_giverdest->turns_left = game.info.ceasefire_length;
ds_destgiver->turns_left = game.info.ceasefire_length;
notify_player(pgiver, NULL, E_TREATY_CEASEFIRE, ftc_server,
_("You agree on a cease-fire with %s."),
player_name(pdest));
......
pdest_seen_units = get_units_seen_via_ally(pdest, pgiver);
}
set_diplstate_type(ds_giverdest, ds_destgiver, DS_ARMISTICE);
ds_giverdest->turns_left = TURNS_LEFT;
ds_destgiver->turns_left = TURNS_LEFT;
ds_giverdest->turns_left = game.info.armistice_length;
ds_destgiver->turns_left = game.info.armistice_length;
notify_player(pgiver, NULL, E_TREATY_PEACE, ftc_server,
/* TRANS: ... the Poles ... Polish territory */
PL_("You agree on an armistice with the %s. In %d turn, "
......
"it will become a peace treaty. Move any "
"military units out of %s territory to avoid them "
"being disbanded.",
TURNS_LEFT),
game.info.armistice_length),
nation_plural_for_player(pdest),
TURNS_LEFT,
game.info.armistice_length,
nation_adjective_for_player(pdest));
notify_player(pdest, NULL, E_TREATY_PEACE, ftc_server,
/* TRANS: ... the Poles ... Polish territory */
......
"it will become a peace treaty. Move any "
"military units out of %s territory to avoid them "
"being disbanded.",
TURNS_LEFT),
game.info.armistice_length),
nation_plural_for_player(pgiver),
TURNS_LEFT,
game.info.armistice_length,
nation_adjective_for_player(pgiver));
if (old_diplstate == DS_ALLIANCE) {
update_players_after_alliance_breakup(pgiver, pdest,
server/settings.c
GAME_MIN_REVOLUTION_LENGTH, GAME_MAX_REVOLUTION_LENGTH,
GAME_DEFAULT_REVOLUTION_LENGTH)
GEN_INT("armisticelength", game.info.armistice_length,
SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_RARE,
ALLOW_NONE, ALLOW_BASIC,
N_("Length of armistice"),
N_("Timee before an armistice turns in to a peace treaty."),
nullptr, nullptr, nullptr,
GAME_MIN_ARMISTICE_LENGTH, GAME_MAX_ARMISTICE_LENGTH,
GAME_DEFAULT_ARMISTICE_LENGTH)
GEN_INT("ceasefirelength", game.info.ceasefire_length,
SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_RARE,
ALLOW_NONE, ALLOW_BASIC,
N_("Length of cease-fire"),
N_("Time before a cease-fire reverts back to full war."),
nullptr, nullptr, nullptr,
GAME_MIN_CEASEFIRE_LENGTH, GAME_MAX_CEASEFIRE_LENGTH,
GAME_DEFAULT_CEASEFIRE_LENGTH)
GEN_BOOL("fogofwar", game.info.fogofwar,
SSET_RULES, SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
N_("Whether to enable fog of war"),
    (1-1/1)