Freeciv-3.3: /fast/freeciv/nightly/main/common/game.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
game.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "fcintl.h"
20#include "ioz.h"
21#include "log.h"
22#include "mem.h"
23#include "shared.h"
24#include "support.h"
25
26/* aicore */
27#include "cm.h"
28
29/* common */
30#include "ai.h"
31#include "achievements.h"
32#include "actions.h"
33#include "actres.h"
34#include "city.h"
35#include "connection.h"
36#include "counters.h"
37#include "diptreaty.h"
38#include "disaster.h"
39#include "extras.h"
40#include "government.h"
41#include "idex.h"
42#include "map.h"
43#include "multipliers.h"
44#include "nation.h"
45#include "packets.h"
46#include "player.h"
47#include "research.h"
48#include "rgbcolor.h"
49#include "spaceship.h"
50#include "specialist.h"
51#include "style.h"
52#include "tech.h"
53#include "terrain.h"
54#include "traderoutes.h"
55#include "unit.h"
56#include "unitlist.h"
57#include "victory.h"
58
59#include "game.h"
60
61 struct civ_game game;
62 struct world wld;
63
64 bool am_i_server = FALSE;
65
66 bool _ruleset_compat_mode = FALSE;
67
68static void game_defaults(bool keep_ruleset_value);
69
70/**********************************************************************/
73 int civ_population(const struct player *pplayer)
74{
75 int ppl = 0;
76
77 city_list_iterate(pplayer->cities, pcity) {
78 ppl += city_population(pcity);
79 } city_list_iterate_end;
80
81 return ppl;
82}
83
84/**********************************************************************/
87 struct city *game_city_by_name(const char *name)
88{
89 players_iterate(pplayer) {
90 struct city *pcity = city_list_find_name(pplayer->cities, name);
91
92 if (pcity) {
93 return pcity;
94 }
95 } players_iterate_end;
96
97 return NULL;
98}
99
100
101/**********************************************************************/
106 struct city *game_city_by_number(int id)
107{
108 return idex_lookup_city(&wld, id);
109}
110
111/**********************************************************************/
115 struct unit *game_unit_by_number(int id)
116{
117 return idex_lookup_unit(&wld, id);
118}
119
120/**********************************************************************/
123 void game_remove_unit(struct world *gworld, struct unit *punit)
124{
125 struct city *pcity;
126 struct player *owner;
127
128 /* It's possible that during city transfer homecity/unit owner
129 * information is inconsistent, and client then tries to remove
130 * now unseen unit so that homecity is not in the list of cities
131 * of the player (seemingly) owning the unit.
132 * Thus cannot use player_city_by_number() here, but have to
133 * consider cities of all players. */
134 pcity = game_city_by_number(punit->homecity);
135
136 if (pcity != nullptr) {
137 unit_list_remove(pcity->units_supported, punit);
138
139 log_debug("game_remove_unit()"
140 " at (%d,%d) unit %d, %s %s home (%d,%d) city %d, %s %s",
141 TILE_XY(unit_tile(punit)),
142 punit->id,
143 nation_rule_name(nation_of_unit(punit)),
144 unit_rule_name(punit),
145 TILE_XY(pcity->tile),
146 punit->homecity,
147 nation_rule_name(nation_of_city(pcity)),
148 city_name_get(pcity));
149 } else if (IDENTITY_NUMBER_ZERO == punit->homecity) {
150 log_debug("game_remove_unit() at (%d,%d) unit %d, %s %s home %d",
151 TILE_XY(unit_tile(punit)),
152 punit->id,
153 nation_rule_name(nation_of_unit(punit)),
154 unit_rule_name(punit),
155 punit->homecity);
156 } else {
157 log_error("game_remove_unit() at (%d,%d) unit %d, %s %s home %d invalid",
158 TILE_XY(unit_tile(punit)),
159 punit->id,
160 nation_rule_name(nation_of_unit(punit)),
161 unit_rule_name(punit),
162 punit->homecity);
163 }
164
165 unit_list_remove(unit_tile(punit)->units, punit);
166
167 owner = unit_owner(punit);
168 if (owner != nullptr) {
169 unit_list_remove(owner->units, punit);
170 }
171
172 idex_unregister_unit(gworld, punit);
173
174 if (game.callbacks.unit_deallocate) {
175 (game.callbacks.unit_deallocate)(punit->id);
176 }
177
178 unit_virtual_destroy(punit);
179}
180
181/**********************************************************************/
184 void game_remove_city(struct world *gworld, struct city *pcity)
185{
186 struct tile *pcenter = city_tile(pcity);
187 struct player *powner = city_owner(pcity);
188 const struct civ_map *nmap = &(wld.map);
189
190 if (NULL != powner) {
191 /* Always unlink before clearing data */
192 city_list_remove(powner->cities, pcity);
193 }
194
195 if (NULL == pcenter) {
196 log_debug("game_remove_city() virtual city %d, %s",
197 pcity->id,
198 city_name_get(pcity));
199 } else {
200 log_debug("game_remove_city() at (%d,%d) city %d, %s %s",
201 TILE_XY(pcenter),
202 pcity->id,
203 nation_rule_name(nation_of_player(powner)),
204 city_name_get(pcity));
205
206 city_tile_iterate(nmap, city_map_radius_sq_get(pcity), pcenter, ptile) {
207 if (tile_worked(ptile) == pcity) {
208 tile_set_worked(ptile, NULL);
209 }
210 } city_tile_iterate_end;
211 }
212
213 idex_unregister_city(gworld, pcity);
214 destroy_city_virtual(pcity);
215}
216
217/**********************************************************************/
220 static void game_defaults(bool keep_ruleset_value)
221{
222 int i;
223
224 /* The control packet. */
225 game.control.government_count = 0;
226 game.control.nation_count = 0;
227 game.control.num_base_types = 0;
228 game.control.num_road_types = 0;
229 game.control.num_resource_types = 0;
230 game.control.num_impr_types = 0;
231 game.control.num_specialist_types = 0;
232 game.control.num_tech_types = 0;
233 game.control.num_unit_classes = 0;
234 game.control.num_unit_types = 0;
235 game.control.num_disaster_types = 0;
236 game.control.num_achievement_types = 0;
237 game.control.num_styles = 0;
238 game.control.num_music_styles = 0;
239 game.control.num_nation_groups = 0;
240 game.control.num_nation_sets = 0;
241 game.control.preferred_tileset[0] = '\0';
242 game.control.preferred_soundset[0] = '\0';
243 game.control.preferred_musicset[0] = '\0';
244 game.control.num_city_styles = 0;
245 game.control.terrain_count = 0;
246
247 game.ruleset_summary = NULL;
248 game.ruleset_description = NULL;
249 game.ruleset_capabilities = NULL;
250
251 /* The info packet. */
252 game.info.aifill = GAME_DEFAULT_AIFILL;
253 game.info.airlifting_style = GAME_DEFAULT_AIRLIFTINGSTYLE;
254 game.info.angrycitizen = GAME_DEFAULT_ANGRYCITIZEN;
255 game.info.borders = GAME_DEFAULT_BORDERS;
256 game.calendar.calendar_skip_0 = FALSE;
257 game.info.caravan_bonus_style = GAME_DEFAULT_CARAVAN_BONUS_STYLE;
258 game.info.celebratesize = GAME_DEFAULT_CELEBRATESIZE;
259 game.info.citymindist = GAME_DEFAULT_CITYMINDIST;
260 game.info.cooling = 0;
261 game.info.coolinglevel = 0; /* set later */
262 game.info.diplomacy = GAME_DEFAULT_DIPLOMACY;
263 game.info.fogofwar = GAME_DEFAULT_FOGOFWAR;
264 game.info.foodbox = GAME_DEFAULT_FOODBOX;
265 game.info.fulltradesize = GAME_DEFAULT_FULLTRADESIZE;
266 game.info.global_advance_count = 0;
267 for (i = 0; i < A_LAST; i++) {
268 /* game.num_tech_types = 0 here */
269 game.info.global_advances[i] = FALSE;
270 }
271 for (i = 0; i < B_LAST; i++) {
272 /* game.num_impr_types = 0 here */
273 game.info.great_wonder_owners[i] = WONDER_NOT_OWNED;
274 }
275 game.info.globalwarming = 0;
276 game.info.global_warming = GAME_DEFAULT_GLOBAL_WARMING;
277 game.info.gold = GAME_DEFAULT_GOLD;
278 game.info.infrapoints = GAME_DEFAULT_INFRA;
279 game.info.revolentype = GAME_DEFAULT_REVOLENTYPE;
280 game.info.default_government_id = G_LAST;
281 game.info.government_during_revolution_id = G_LAST;
282 game.info.happyborders = GAME_DEFAULT_HAPPYBORDERS;
283 game.info.heating = 0;
284 game.info.is_edit_mode = FALSE;
285 game.info.is_new_game = TRUE;
286 game.info.killstack = GAME_DEFAULT_KILLSTACK;
287 game.info.killcitizen = GAME_DEFAULT_KILLCITIZEN;
288 game.calendar.negative_year_label[0] = '\0';
289 game.info.notradesize = GAME_DEFAULT_NOTRADESIZE;
290 game.info.nuclearwinter = 0;
291 game.info.nuclear_winter = GAME_DEFAULT_NUCLEAR_WINTER;
292 game.calendar.positive_year_label[0] = '\0';
293 game.info.rapturedelay = GAME_DEFAULT_RAPTUREDELAY;
294 game.info.disasters = GAME_DEFAULT_DISASTERS;
295 game.info.restrictinfra = GAME_DEFAULT_RESTRICTINFRA;
296 game.info.sciencebox = GAME_DEFAULT_SCIENCEBOX;
297 game.info.shieldbox = GAME_DEFAULT_SHIELDBOX;
298 game.info.skill_level = GAME_DEFAULT_SKILL_LEVEL;
299 game.info.victory_conditions = GAME_DEFAULT_VICTORY_CONDITIONS;
300 game.info.team_pooled_research = GAME_DEFAULT_TEAM_POOLED_RESEARCH;
301 game.info.tech = GAME_DEFAULT_TECHLEVEL;
302 game.info.timeout = GAME_DEFAULT_TIMEOUT;
303 game.info.trademindist = GAME_DEFAULT_TRADEMINDIST;
304 game.info.trade_revenue_style = GAME_DEFAULT_TRADE_REVENUE_STYLE;
305 game.info.trading_city = GAME_DEFAULT_TRADING_CITY;
306 game.info.trading_gold = GAME_DEFAULT_TRADING_GOLD;
307 game.info.trading_tech = GAME_DEFAULT_TRADING_TECH;
308 game.info.turn = 0;
309 game.info.warminglevel = 0; /* Set later */
310 game.info.year_0_hack = FALSE;
311 game.info.year = GAME_DEFAULT_START_YEAR;
312 game.info.top_cities_count = GAME_DEFAULT_TOP_CITIES_COUNT;
313 BV_CLR_ALL(game.info.diplchance_initial_odds);
314
315 /* The scenario packets. */
316 game.scenario.is_scenario = FALSE;
317 game.scenario.name[0] = '\0';
318 game.scenario.authors[0] = '\0';
319 game.scenario.players = TRUE;
320 game.scenario.startpos_nations = FALSE;
321 game.scenario.handmade = FALSE;
322 game.scenario.prevent_new_cities = FALSE;
323 game.scenario.lake_flooding = TRUE;
324 game.scenario.have_resources = TRUE;
325 game.scenario.ruleset_locked = TRUE;
326 game.scenario.save_random = FALSE;
327 game.scenario.allow_ai_type_fallback = FALSE;
328
329 game.scenario_desc.description[0] = '\0';
330
331 /* Veteran system. */
332 game.veteran = NULL;
333
334 /* player colors */
335 game.plr_bg_color = NULL;
336
337 if (is_server()) {
338 /* All settings only used by the server (./server/ and ./ai/ */
339 sz_strlcpy(game.server.allow_take, GAME_DEFAULT_ALLOW_TAKE);
340 game.server.allowed_city_names = GAME_DEFAULT_ALLOWED_CITY_NAMES;
341 game.server.aqueductloss = GAME_DEFAULT_AQUEDUCTLOSS;
342 game.server.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
343 game.server.autoattack = GAME_DEFAULT_AUTOATTACK;
344 game.server.barbarianrate = GAME_DEFAULT_BARBARIANRATE;
345 game.server.civilwarsize = GAME_DEFAULT_CIVILWARSIZE;
346 game.server.connectmsg[0] = '\0';
347 game.server.conquercost = GAME_DEFAULT_CONQUERCOST;
348 game.server.contactturns = GAME_DEFAULT_CONTACTTURNS;
349 for (i = 0; i < DEBUG_LAST; i++) {
350 game.server.debug[i] = FALSE;
351 }
352 sz_strlcpy(game.server.demography, GAME_DEFAULT_DEMOGRAPHY);
353 game.server.diplchance = GAME_DEFAULT_DIPLCHANCE;
354 game.server.diplbulbcost = GAME_DEFAULT_DIPLBULBCOST;
355 game.server.diplgoldcost = GAME_DEFAULT_DIPLGOLDCOST;
356 game.server.incite_gold_loss_chance = GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE;
357 game.server.incite_gold_capt_chance = GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE;
358 game.server.dispersion = GAME_DEFAULT_DISPERSION;
359 game.server.endspaceship = GAME_DEFAULT_END_SPACESHIP;
360 game.server.end_turn = GAME_DEFAULT_END_TURN;
361 game.server.event_cache.chat = GAME_DEFAULT_EVENT_CACHE_CHAT;
362 game.server.event_cache.info = GAME_DEFAULT_EVENT_CACHE_INFO;
363 game.server.event_cache.max_size = GAME_DEFAULT_EVENT_CACHE_MAX_SIZE;
364 game.server.event_cache.turns = GAME_DEFAULT_EVENT_CACHE_TURNS;
365 game.server.foggedborders = GAME_DEFAULT_FOGGEDBORDERS;
366 game.server.fogofwar_old = game.info.fogofwar;
367 game.server.last_updated_year = FALSE;
368 game.server.freecost = GAME_DEFAULT_FREECOST;
369 game.server.global_warming_percent = GAME_DEFAULT_GLOBAL_WARMING_PERCENT;
370 game.server.homecaughtunits = GAME_DEFAULT_HOMECAUGHTUNITS;
371 game.server.kick_time = GAME_DEFAULT_KICK_TIME;
372 game.server.killunhomed = GAME_DEFAULT_KILLUNHOMED;
373 game.server.maxconnectionsperhost = GAME_DEFAULT_MAXCONNECTIONSPERHOST;
374 game.server.last_ping = 0;
375 game.server.max_players = GAME_DEFAULT_MAX_PLAYERS;
376 game.server.meta_info.user_message[0] = '\0';
377 /* Do not clear meta_info.type here as it's already set to correct value */
378 game.server.mgr_distance = GAME_DEFAULT_MGR_DISTANCE;
379 game.server.mgr_foodneeded = GAME_DEFAULT_MGR_FOODNEEDED;
380 game.server.mgr_nationchance = GAME_DEFAULT_MGR_NATIONCHANCE;
381 game.server.mgr_turninterval = GAME_DEFAULT_MGR_TURNINTERVAL;
382 game.server.mgr_worldchance = GAME_DEFAULT_MGR_WORLDCHANCE;
383 game.server.multiresearch = GAME_DEFAULT_MULTIRESEARCH;
384 game.server.migration = GAME_DEFAULT_MIGRATION;
385 game.server.trait_dist = GAME_DEFAULT_TRAIT_DIST_MODE;
386 game.server.min_players = GAME_DEFAULT_MIN_PLAYERS;
387 game.server.natural_city_names = GAME_DEFAULT_NATURALCITYNAMES;
388 game.server.nuclear_winter_percent = GAME_DEFAULT_NUCLEAR_WINTER_PERCENT;
389 game.server.plrcolormode = GAME_DEFAULT_PLRCOLORMODE;
390 game.server.netwait = GAME_DEFAULT_NETWAIT;
391 game.server.occupychance = GAME_DEFAULT_OCCUPYCHANCE;
392 game.server.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
393 game.server.additional_phase_seconds = 0;
394 game.server.phase_mode_stored = GAME_DEFAULT_PHASE_MODE;
395 game.server.pingtime = GAME_DEFAULT_PINGTIME;
396 game.server.pingtimeout = GAME_DEFAULT_PINGTIMEOUT;
397 game.server.razechance = GAME_DEFAULT_RAZECHANCE;
398 game.server.revealmap = GAME_DEFAULT_REVEALMAP;
399 game.server.revolution_length = GAME_DEFAULT_REVOLUTION_LENGTH;
400 if (!keep_ruleset_value) {
401 sz_strlcpy(game.server.rulesetdir, GAME_DEFAULT_RULESETDIR);
402 }
403 game.server.save_compress_level = GAME_DEFAULT_COMPRESS_LEVEL;
404 game.server.save_compress_type = GAME_DEFAULT_COMPRESS_TYPE;
405 sz_strlcpy(game.server.save_name, GAME_DEFAULT_SAVE_NAME);
406 game.server.save_nturns = GAME_DEFAULT_SAVETURNS;
407 game.server.save_options.save_known = TRUE;
408 game.server.save_options.save_private_map = TRUE;
409 game.server.save_options.save_starts = TRUE;
410 game.server.savepalace = GAME_DEFAULT_SAVEPALACE;
411 game.server.scorelog = GAME_DEFAULT_SCORELOG;
412 game.server.scoreloglevel = GAME_DEFAULT_SCORELOGLEVEL;
413 game.server.scoreturn = GAME_DEFAULT_SCORETURN - 1;
414 game.server.seed = GAME_DEFAULT_SEED;
415 sz_strlcpy(game.server.start_units, GAME_DEFAULT_START_UNITS);
416 game.server.spaceship_travel_pct = GAME_DEFAULT_SPACESHIP_TRAVEL_PCT;
417 game.server.start_year = GAME_DEFAULT_START_YEAR;
418 game.server.tcptimeout = GAME_DEFAULT_TCPTIMEOUT;
419 game.server.techlost_donor = GAME_DEFAULT_TECHLOST_DONOR;
420 game.server.techlost_recv = GAME_DEFAULT_TECHLOST_RECV;
421 game.server.techpenalty = GAME_DEFAULT_TECHPENALTY;
422 game.server.timeoutaddenemymove = GAME_DEFAULT_TIMEOUTADDEMOVE;
423 game.server.timeoutcounter = GAME_DEFAULT_TIMEOUTCOUNTER;
424 game.server.timeoutinc = GAME_DEFAULT_TIMEOUTINC;
425 game.server.timeoutincmult = GAME_DEFAULT_TIMEOUTINCMULT;
426 game.server.timeoutint = GAME_DEFAULT_TIMEOUTINT;
427 game.server.timeoutintinc = GAME_DEFAULT_TIMEOUTINTINC;
428 game.server.turnblock = GAME_DEFAULT_TURNBLOCK;
429 game.server.unitwaittime = GAME_DEFAULT_UNITWAITTIME;
430 game.server.plr_colors = NULL;
431 game.server.random_move_time = NULL;
432 game.server.world_peace_start = 0;
433 } else {
434 /* Client side takes care of itself in client_main() */
435 }
436}
437
438/**********************************************************************/
443 void game_init(bool keep_ruleset_value)
444{
445 game_defaults(keep_ruleset_value);
446 player_slots_init();
447 map_init(&wld.map, is_server());
448 team_slots_init();
449 game_ruleset_init();
450 idex_init(&wld);
451 cm_init();
452 researches_init();
453 universal_found_functions_init();
454 treaties_init();
455}
456
457/**********************************************************************/
461 void game_map_init(void)
462{
463 /* FIXME: it's not clear where these values should be initialized. It
464 * can't be done in game_init because the map isn't created yet. Maybe it
465 * should be done in the mapgen code or in the maphand code. It should
466 * surely be called when the map is generated. */
467 game.info.warminglevel = (map_num_tiles() + 499) / 500;
468 game.info.coolinglevel = (map_num_tiles() + 499) / 500;
469}
470
471/**********************************************************************/
474 void game_free(void)
475{
476 treaties_free();
477 player_slots_free();
478 main_map_free();
479 free_city_map_index();
480 idex_free(&wld);
481 team_slots_free();
482 game_ruleset_free();
483 researches_free();
484 cm_free();
485}
486
487/**********************************************************************/
491 void game_reset(void)
492{
493 if (is_server()) {
494 game_free();
495 game_init(FALSE);
496 } else {
497 /* Reset the players infos. */
498 players_iterate(pplayer) {
499 player_clear(pplayer, FALSE);
500 } players_iterate_end;
501
502 main_map_free();
503 free_city_map_index();
504 idex_free(&wld);
505
506 map_init(&wld.map, FALSE);
507 idex_init(&wld);
508 researches_init();
509 }
510}
511
512/**********************************************************************/
515 void game_ruleset_init(void)
516{
517 nation_sets_groups_init();
518 ruleset_cache_init();
519 disaster_types_init();
520 achievements_init();
521 actres_init();
522 actions_init();
523 trade_route_types_init();
524 terrains_init();
525 extras_init();
526 goods_init();
527 improvements_init();
528 techs_init();
529 unit_classes_init();
530 unit_types_init();
531 specialists_init();
532 user_unit_class_flags_init();
533 user_unit_type_flags_init();
534 user_terrain_flags_init();
535 user_extra_flags_init();
536 user_impr_flags_init();
537 tech_classes_init();
538 user_tech_flags_init();
539 multipliers_init();
540 clause_infos_init();
541 counters_init();
542
543 if (is_server()) {
544 game.server.luadata = NULL;
545 game.server.dbid = -1;
546 game.server.ruledit.nationlist = NULL;
547 game.server.ruledit.embedded_nations = NULL;
548 game.server.ruledit.embedded_nations_count = 0;
549 game.server.ruledit.allowed_govs = NULL;
550 game.server.ruledit.allowed_terrains = NULL;
551 game.server.ruledit.allowed_styles = NULL;
552 game.server.ruledit.nc_agovs = NULL;
553 game.server.ruledit.nc_aterrs = NULL;
554 game.server.ruledit.nc_astyles = NULL;
555 game.server.ruledit.ag_count = 0;
556 game.server.ruledit.at_count = 0;
557 game.server.ruledit.as_count = 0;
558 }
559}
560
561/**********************************************************************/
564 void game_ruleset_free(void)
565{
566 int i;
567
568 CALL_FUNC_EACH_AI(units_ruleset_close);
569
570 /* Clear main structures which can points to the ruleset dependent
571 * structures. */
572 players_iterate(pplayer) {
573 player_ruleset_close(pplayer);
574 } players_iterate_end;
575 game.government_during_revolution = NULL;
576
577 specialists_free();
578 unit_classes_free();
579 techs_free();
580 governments_free();
581 nations_free();
582 unit_types_free();
583 unit_type_flags_free();
584 unit_class_flags_free();
585 role_unit_precalcs_free();
586 improvements_free();
587 goods_free();
588 extras_free();
589 music_styles_free();
590 city_styles_free();
591 styles_free();
592 actions_free();
593 actres_free();
594 achievements_free();
595 disaster_types_free();
596 terrains_free();
597 user_tech_flags_free();
598 extra_flags_free();
599 impr_flags_free();
600 user_terrain_flags_free();
601 ruleset_cache_free();
602 nation_sets_groups_free();
603 multipliers_free();
604 clause_infos_free();
605 counters_free();
606
607 /* Destroy the default veteran system. */
608 veteran_system_destroy(game.veteran);
609 game.veteran = NULL;
610
611 /* Player colors. */
612 if (game.plr_bg_color != NULL) {
613 rgbcolor_destroy(game.plr_bg_color);
614 game.plr_bg_color = NULL;
615 }
616
617 if (is_server()) {
618 if (game.server.luadata != NULL) {
619 secfile_destroy(game.server.luadata);
620 }
621 if (game.server.ruledit.description_file != NULL) {
622 free(game.server.ruledit.description_file);
623 game.server.ruledit.description_file = NULL;
624 }
625 if (game.server.ruledit.nationlist != NULL) {
626 free(game.server.ruledit.nationlist);
627 game.server.ruledit.nationlist = NULL;
628 }
629 if (game.server.ruledit.embedded_nations != NULL) {
630 for (i = 0; i < game.server.ruledit.embedded_nations_count; i++) {
631 free(game.server.ruledit.embedded_nations[i]);
632 }
633 free(game.server.ruledit.embedded_nations);
634 game.server.ruledit.embedded_nations = NULL;
635 game.server.ruledit.embedded_nations_count = 0;
636 if (game.server.ruledit.allowed_govs != NULL) {
637 for (i = 0; i < game.server.ruledit.ag_count; i++) {
638 free(game.server.ruledit.nc_agovs[i]);
639 }
640 free(game.server.ruledit.allowed_govs);
641 game.server.ruledit.allowed_govs = NULL;
642 game.server.ruledit.nc_agovs = NULL;
643 }
644 if (game.server.ruledit.allowed_terrains != NULL) {
645 for (i = 0; i < game.server.ruledit.at_count; i++) {
646 free(game.server.ruledit.nc_aterrs[i]);
647 }
648 free(game.server.ruledit.allowed_terrains);
649 game.server.ruledit.allowed_terrains = NULL;
650 game.server.ruledit.nc_aterrs = NULL;
651 }
652 if (game.server.ruledit.allowed_styles != NULL) {
653 for (i = 0; i < game.server.ruledit.as_count; i++) {
654 free(game.server.ruledit.nc_astyles[i]);
655 }
656 free(game.server.ruledit.allowed_styles);
657 game.server.ruledit.allowed_styles = NULL;
658 game.server.ruledit.nc_astyles = NULL;
659 }
660 }
661 }
662
663 for (i = 0; i < MAX_CALENDAR_FRAGMENTS; i++) {
664 game.calendar.calendar_fragment_name[i][0] = '\0';
665 }
666
667 if (game.ruleset_summary != NULL) {
668 free(game.ruleset_summary);
669 game.ruleset_summary = NULL;
670 }
671
672 if (game.ruleset_description != NULL) {
673 free(game.ruleset_description);
674 game.ruleset_description = NULL;
675 }
676
677 if (game.ruleset_capabilities != NULL) {
678 free(game.ruleset_capabilities);
679 game.ruleset_capabilities = NULL;
680 }
681}
682
683/**********************************************************************/
686 void initialize_globals(void)
687{
688 players_iterate(pplayer) {
689 city_list_iterate(pplayer->cities, pcity) {
690 city_built_iterate(pcity, pimprove) {
691 if (is_wonder(pimprove)) {
692 if (is_great_wonder(pimprove)) {
693 game.info.great_wonder_owners[improvement_index(pimprove)] =
694 player_number(pplayer);
695 }
696 pplayer->wonders[improvement_index(pimprove)] = pcity->id;
697 }
698 } city_built_iterate_end;
699 } city_list_iterate_end;
700 } players_iterate_end;
701}
702
703/**********************************************************************/
710 bool is_player_phase(const struct player *pplayer, int phase)
711{
712 switch (game.info.phase_mode) {
713 case PMT_CONCURRENT:
714 return TRUE;
715 break;
716 case PMT_PLAYERS_ALTERNATE:
717 return player_number(pplayer) == phase;
718 break;
719 case PMT_TEAMS_ALTERNATE:
720 fc_assert_ret_val(NULL != pplayer->team, FALSE);
721 return team_number(pplayer->team) == phase;
722 break;
723 default:
724 break;
725 }
726
727 fc_assert_msg(FALSE, "Unrecognized phase mode %d in is_player_phase().",
728 phase);
729 return TRUE;
730}
731
732/**********************************************************************/
737 const char *population_to_text(int thousand_citizen)
738{
739 /* big_int_to_text can't handle negative values, and in any case we'd
740 * better not have a negative population. */
741 fc_assert_ret_val(thousand_citizen >= 0, NULL);
742 return big_int_to_text(thousand_citizen, game.info.pop_report_zeroes - 1);
743}
744
745/**********************************************************************/
748 static char *year_suffix(void)
749{
750 static char buf[MAX_LEN_NAME];
751 const char *suffix;
752 char safe_year_suffix[MAX_LEN_NAME];
753 const char *max = safe_year_suffix + MAX_LEN_NAME - 1;
754 char *c = safe_year_suffix;
755
756 if (game.info.year < 0) {
757 suffix = game.calendar.negative_year_label;
758 } else {
759 suffix = game.calendar.positive_year_label;
760 }
761
762 /* Remove all non alphanumeric characters from the year suffix. */
763 for (; '\0' != *suffix && c < max; suffix++) {
764 if (fc_isalnum(*suffix)) {
765 *c++ = *suffix;
766 }
767 }
768 *c = '\0';
769
770 fc_snprintf(buf, sizeof(buf), "%s", safe_year_suffix);
771
772 return buf;
773}
774
775/**********************************************************************/
794 int generate_save_name(const char *format, char *buf, int buflen,
795 const char *reason)
796{
797 struct cf_sequence sequences[5] = {
798 cf_str_seq('R', (reason == NULL) ? "auto" : reason),
799 cf_str_seq('S', year_suffix()),
800 { 0 }, { 0 }, /* Works for both gcc and tcc */
801 cf_end()
802 };
803
804 cf_int_seq('T', game.info.turn, &sequences[2]);
805 cf_int_seq('Y', game.info.year, &sequences[3]);
806
807 fc_vsnprintcf(buf, buflen, format, sequences, -1);
808
809 if (0 == strcmp(format, buf)) {
810 /* Use the default savename if 'format' does not contain
811 * printf information. */
812 char savename[512];
813
814 fc_snprintf(savename, sizeof(savename), "%s-T%%04T-Y%%05Y-%%R",
815 format);
816 fc_vsnprintcf(buf, buflen, savename, sequences, -1);
817 }
818
819 log_debug("save name generated from '%s': %s", format, buf);
820
821 return strlen(buf);
822}
823
824/**********************************************************************/
827 void user_flag_init(struct user_flag *flag)
828{
829 flag->name = NULL;
830 flag->helptxt = NULL;
831}
832
833/**********************************************************************/
836 void user_flag_free(struct user_flag *flag)
837{
838 if (flag->name != NULL) {
839 FC_FREE(flag->name);
840 flag->name = NULL;
841 }
842 if (flag->helptxt != NULL) {
843 FC_FREE(flag->helptxt);
844 flag->helptxt = NULL;
845 }
846}
847
848/**********************************************************************/
851 int current_turn_timeout(void)
852{
853 if (game.info.turn == 1 && game.info.first_timeout != -1) {
854 return game.info.first_timeout;
855 } else {
856 return game.info.timeout;
857 }
858}
achievements_free
void achievements_free(void)
Definition achievements.c:59
achievements_init
void achievements_init(void)
Definition achievements.c:40
achievements.h
actions_free
void actions_free(void)
Definition actions.c:889
actions_init
void actions_init(void)
Definition actions.c:830
actions.h
actres_free
void actres_free(void)
Definition actres.c:250
actres_init
void actres_init(void)
Definition actres.c:243
actres.h
ai.h
CALL_FUNC_EACH_AI
#define CALL_FUNC_EACH_AI(_func,...)
Definition ai.h:387
BV_CLR_ALL
#define BV_CLR_ALL(bv)
Definition bitvector.h:95
city_styles_free
void city_styles_free(void)
Definition city.c:3407
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1133
city_population
int city_population(const struct city *pcity)
Definition city.c:1187
free_city_map_index
void free_city_map_index(void)
Definition city.c:609
city_map_radius_sq_get
int city_map_radius_sq_get(const struct city *pcity)
Definition city.c:137
destroy_city_virtual
void destroy_city_virtual(struct city *pcity)
Definition city.c:3512
city_list_find_name
struct city * city_list_find_name(struct city_list *This, const char *name)
Definition city.c:1691
city.h
city_list_iterate
#define city_list_iterate(citylist, pcity)
Definition city.h:508
city_tile
#define city_tile(_pcity_)
Definition city.h:564
city_owner
#define city_owner(_pcity_)
Definition city.h:563
city_list_iterate_end
#define city_list_iterate_end
Definition city.h:510
city_tile_iterate
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
Definition city.h:230
city_tile_iterate_end
#define city_tile_iterate_end
Definition city.h:238
city_built_iterate
#define city_built_iterate(_pcity, _p)
Definition city.h:825
city_built_iterate_end
#define city_built_iterate_end
Definition city.h:831
cm_init
void cm_init(void)
Definition cm.c:293
cm_free
void cm_free(void)
Definition cm.c:330
cm.h
incite_cost
char * incite_cost
Definition comments.c:74
connection.h
counters_init
void counters_init(void)
Definition counters.c:40
counters_free
void counters_free(void)
Definition counters.c:51
counters.h
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
clause_infos_init
void clause_infos_init(void)
Definition diptreaty.c:262
clause_infos_free
void clause_infos_free(void)
Definition diptreaty.c:278
treaties_init
void treaties_init(void)
Definition diptreaty.c:329
treaties_free
void treaties_free(void)
Definition diptreaty.c:337
diptreaty.h
disaster_types_init
void disaster_types_init(void)
Definition disaster.c:33
disaster_types_free
void disaster_types_free(void)
Definition disaster.c:46
disaster.h
ruleset_cache_free
void ruleset_cache_free(void)
Definition effects.c:329
ruleset_cache_init
void ruleset_cache_init(void)
Definition effects.c:297
user_extra_flags_init
void user_extra_flags_init(void)
Definition extras.c:923
extras_free
void extras_free(void)
Definition extras.c:84
extra_flags_free
void extra_flags_free(void)
Definition extras.c:935
extras_init
void extras_init(void)
Definition extras.c:45
extras.h
is_server
static bool is_server(void)
Definition fc_interface.h:69
MAX_CALENDAR_FRAGMENTS
#define MAX_CALENDAR_FRAGMENTS
Definition fc_types.h:62
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
IDENTITY_NUMBER_ZERO
#define IDENTITY_NUMBER_ZERO
Definition fc_types.h:92
fcintl.h
population_to_text
const char * population_to_text(int thousand_citizen)
Definition game.c:737
game_reset
void game_reset(void)
Definition game.c:491
user_flag_init
void user_flag_init(struct user_flag *flag)
Definition game.c:827
user_flag_free
void user_flag_free(struct user_flag *flag)
Definition game.c:836
game
struct civ_game game
Definition game.c:61
game_ruleset_init
void game_ruleset_init(void)
Definition game.c:515
is_player_phase
bool is_player_phase(const struct player *pplayer, int phase)
Definition game.c:710
game_defaults
static void game_defaults(bool keep_ruleset_value)
Definition game.c:220
year_suffix
static char * year_suffix(void)
Definition game.c:748
current_turn_timeout
int current_turn_timeout(void)
Definition game.c:851
game_city_by_name
struct city * game_city_by_name(const char *name)
Definition game.c:87
game_ruleset_free
void game_ruleset_free(void)
Definition game.c:564
game_init
void game_init(bool keep_ruleset_value)
Definition game.c:443
wld
struct world wld
Definition game.c:62
_ruleset_compat_mode
bool _ruleset_compat_mode
Definition game.c:66
game_remove_unit
void game_remove_unit(struct world *gworld, struct unit *punit)
Definition game.c:123
game_unit_by_number
struct unit * game_unit_by_number(int id)
Definition game.c:115
civ_population
int civ_population(const struct player *pplayer)
Definition game.c:73
game_remove_city
void game_remove_city(struct world *gworld, struct city *pcity)
Definition game.c:184
game_free
void game_free(void)
Definition game.c:474
game_map_init
void game_map_init(void)
Definition game.c:461
initialize_globals
void initialize_globals(void)
Definition game.c:686
generate_save_name
int generate_save_name(const char *format, char *buf, int buflen, const char *reason)
Definition game.c:794
am_i_server
bool am_i_server
Definition game.c:64
game_city_by_number
struct city * game_city_by_number(int id)
Definition game.c:106
game.h
GAME_DEFAULT_TECHPENALTY
#define GAME_DEFAULT_TECHPENALTY
Definition game.h:551
GAME_DEFAULT_SKILL_LEVEL
#define GAME_DEFAULT_SKILL_LEVEL
Definition game.h:694
GAME_DEFAULT_KILLSTACK
#define GAME_DEFAULT_KILLSTACK
Definition game.h:544
GAME_DEFAULT_INFRA
#define GAME_DEFAULT_INFRA
Definition game.h:375
GAME_DEFAULT_REVOLENTYPE
#define GAME_DEFAULT_REVOLENTYPE
Definition game.h:735
GAME_DEFAULT_AUTO_AI_TOGGLE
#define GAME_DEFAULT_AUTO_AI_TOGGLE
Definition game.h:590
GAME_DEFAULT_CARAVAN_BONUS_STYLE
#define GAME_DEFAULT_CARAVAN_BONUS_STYLE
Definition game.h:650
GAME_DEFAULT_TIMEOUTINTINC
#define GAME_DEFAULT_TIMEOUTINTINC
Definition game.h:595
GAME_DEFAULT_SCORETURN
#define GAME_DEFAULT_SCORETURN
Definition game.h:579
GAME_DEFAULT_TCPTIMEOUT
#define GAME_DEFAULT_TCPTIMEOUT
Definition game.h:616
GAME_DEFAULT_EVENT_CACHE_INFO
#define GAME_DEFAULT_EVENT_CACHE_INFO
Definition game.h:715
GAME_DEFAULT_MGR_FOODNEEDED
#define GAME_DEFAULT_MGR_FOODNEEDED
Definition game.h:523
GAME_DEFAULT_TECHLOST_DONOR
#define GAME_DEFAULT_TECHLOST_DONOR
Definition game.h:559
GAME_DEFAULT_TIMEOUTINT
#define GAME_DEFAULT_TIMEOUTINT
Definition game.h:594
GAME_DEFAULT_ALLOWED_CITY_NAMES
#define GAME_DEFAULT_ALLOWED_CITY_NAMES
Definition game.h:731
GAME_DEFAULT_SCORELOG
#define GAME_DEFAULT_SCORELOG
Definition game.h:572
GAME_DEFAULT_OCCUPYCHANCE
#define GAME_DEFAULT_OCCUPYCHANCE
Definition game.h:664
GAME_DEFAULT_GLOBAL_WARMING_PERCENT
#define GAME_DEFAULT_GLOBAL_WARMING_PERCENT
Definition game.h:444
GAME_DEFAULT_TRADING_TECH
#define GAME_DEFAULT_TRADING_TECH
Definition game.h:646
GAME_DEFAULT_SAVETURNS
#define GAME_DEFAULT_SAVETURNS
Definition game.h:677
GAME_DEFAULT_BORDERS
#define GAME_DEFAULT_BORDERS
Definition game.h:454
GAME_DEFAULT_AIRLIFTINGSTYLE
#define GAME_DEFAULT_AIRLIFTINGSTYLE
Definition game.h:742
GAME_DEFAULT_SPACESHIP_TRAVEL_PCT
#define GAME_DEFAULT_SPACESHIP_TRAVEL_PCT
Definition game.h:584
GAME_DEFAULT_TOP_CITIES_COUNT
#define GAME_DEFAULT_TOP_CITIES_COUNT
Definition game.h:698
GAME_DEFAULT_KILLUNHOMED
#define GAME_DEFAULT_KILLUNHOMED
Definition game.h:547
GAME_DEFAULT_SCIENCEBOX
#define GAME_DEFAULT_SCIENCEBOX
Definition game.h:418
GAME_DEFAULT_MGR_WORLDCHANCE
#define GAME_DEFAULT_MGR_WORLDCHANCE
Definition game.h:536
GAME_DEFAULT_ONSETBARBARIAN
#define GAME_DEFAULT_ONSETBARBARIAN
Definition game.h:660
GAME_DEFAULT_KILLCITIZEN
#define GAME_DEFAULT_KILLCITIZEN
Definition game.h:545
GAME_DEFAULT_SHIELDBOX
#define GAME_DEFAULT_SHIELDBOX
Definition game.h:414
DEBUG_LAST
@ DEBUG_LAST
Definition game.h:41
GAME_DEFAULT_MAXCONNECTIONSPERHOST
#define GAME_DEFAULT_MAXCONNECTIONSPERHOST
Definition game.h:601
GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE
#define GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE
Definition game.h:434
GAME_DEFAULT_DEMOGRAPHY
#define GAME_DEFAULT_DEMOGRAPHY
Definition game.h:702
GAME_DEFAULT_FULLTRADESIZE
#define GAME_DEFAULT_FULLTRADESIZE
Definition game.h:642
GAME_DEFAULT_TIMEOUTINCMULT
#define GAME_DEFAULT_TIMEOUTINCMULT
Definition game.h:597
GAME_DEFAULT_CELEBRATESIZE
#define GAME_DEFAULT_CELEBRATESIZE
Definition game.h:499
GAME_DEFAULT_RAPTUREDELAY
#define GAME_DEFAULT_RAPTUREDELAY
Definition game.h:501
GAME_DEFAULT_REVOLUTION_LENGTH
#define GAME_DEFAULT_REVOLUTION_LENGTH
Definition game.h:736
GAME_DEFAULT_MGR_TURNINTERVAL
#define GAME_DEFAULT_MGR_TURNINTERVAL
Definition game.h:519
GAME_DEFAULT_TIMEOUTINC
#define GAME_DEFAULT_TIMEOUTINC
Definition game.h:596
GAME_DEFAULT_START_UNITS
#define GAME_DEFAULT_START_UNITS
Definition game.h:379
GAME_DEFAULT_ALLOW_TAKE
#define GAME_DEFAULT_ALLOW_TAKE
Definition game.h:703
GAME_DEFAULT_MIN_PLAYERS
#define GAME_DEFAULT_MIN_PLAYERS
Definition game.h:396
GAME_DEFAULT_RULESETDIR
#define GAME_DEFAULT_RULESETDIR
Definition game.h:673
GAME_DEFAULT_AUTOATTACK
#define GAME_DEFAULT_AUTOATTACK
Definition game.h:668
GAME_DEFAULT_REVEALMAP
#define GAME_DEFAULT_REVEALMAP
Definition game.h:570
GAME_DEFAULT_TEAM_POOLED_RESEARCH
#define GAME_DEFAULT_TEAM_POOLED_RESEARCH
Definition game.h:563
GAME_DEFAULT_SEED
#define GAME_DEFAULT_SEED
Definition game.h:367
GAME_DEFAULT_HOMECAUGHTUNITS
#define GAME_DEFAULT_HOMECAUGHTUNITS
Definition game.h:513
GAME_DEFAULT_NETWAIT
#define GAME_DEFAULT_NETWAIT
Definition game.h:620
GAME_DEFAULT_KICK_TIME
#define GAME_DEFAULT_KICK_TIME
Definition game.h:747
GAME_DEFAULT_PLRCOLORMODE
#define GAME_DEFAULT_PLRCOLORMODE
Definition game.h:733
GAME_DEFAULT_DIPLCHANCE
#define GAME_DEFAULT_DIPLCHANCE
Definition game.h:460
GAME_DEFAULT_RAZECHANCE
#define GAME_DEFAULT_RAZECHANCE
Definition game.h:566
GAME_DEFAULT_START_YEAR
#define GAME_DEFAULT_START_YEAR
Definition game.h:740
GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE
#define GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE
Definition game.h:430
GAME_DEFAULT_TIMEOUTCOUNTER
#define GAME_DEFAULT_TIMEOUTCOUNTER
Definition game.h:599
GAME_DEFAULT_TRADING_CITY
#define GAME_DEFAULT_TRADING_CITY
Definition game.h:648
GAME_DEFAULT_FOODBOX
#define GAME_DEFAULT_FOODBOX
Definition game.h:410
GAME_DEFAULT_COMPRESS_TYPE
#define GAME_DEFAULT_COMPRESS_TYPE
Definition game.h:728
GAME_DEFAULT_PINGTIMEOUT
#define GAME_DEFAULT_PINGTIMEOUT
Definition game.h:628
GAME_DEFAULT_TRADE_REVENUE_STYLE
#define GAME_DEFAULT_TRADE_REVENUE_STYLE
Definition game.h:656
GAME_DEFAULT_SAVEPALACE
#define GAME_DEFAULT_SAVEPALACE
Definition game.h:511
GAME_DEFAULT_GLOBAL_WARMING
#define GAME_DEFAULT_GLOBAL_WARMING
Definition game.h:442
GAME_DEFAULT_TECHLOST_RECV
#define GAME_DEFAULT_TECHLOST_RECV
Definition game.h:555
GAME_DEFAULT_NOTRADESIZE
#define GAME_DEFAULT_NOTRADESIZE
Definition game.h:634
GAME_DEFAULT_COMPRESS_LEVEL
#define GAME_DEFAULT_COMPRESS_LEVEL
Definition game.h:717
GAME_DEFAULT_NUCLEAR_WINTER_PERCENT
#define GAME_DEFAULT_NUCLEAR_WINTER_PERCENT
Definition game.h:450
GAME_DEFAULT_TRADING_GOLD
#define GAME_DEFAULT_TRADING_GOLD
Definition game.h:647
GAME_DEFAULT_TRAIT_DIST_MODE
#define GAME_DEFAULT_TRAIT_DIST_MODE
Definition game.h:509
GAME_DEFAULT_NUCLEAR_WINTER
#define GAME_DEFAULT_NUCLEAR_WINTER
Definition game.h:448
GAME_DEFAULT_FREECOST
#define GAME_DEFAULT_FREECOST
Definition game.h:464
GAME_DEFAULT_MAX_PLAYERS
#define GAME_DEFAULT_MAX_PLAYERS
Definition game.h:400
GAME_DEFAULT_CITYMINDIST
#define GAME_DEFAULT_CITYMINDIST
Definition game.h:484
GAME_DEFAULT_PHASE_MODE
#define GAME_DEFAULT_PHASE_MODE
Definition game.h:614
GAME_DEFAULT_AIFILL
#define GAME_DEFAULT_AIFILL
Definition game.h:404
GAME_DEFAULT_MULTIRESEARCH
#define GAME_DEFAULT_MULTIRESEARCH
Definition game.h:564
GAME_DEFAULT_CONQUERCOST
#define GAME_DEFAULT_CONQUERCOST
Definition game.h:468
GAME_DEFAULT_TIMEOUT
#define GAME_DEFAULT_TIMEOUT
Definition game.h:592
GAME_DEFAULT_CONTACTTURNS
#define GAME_DEFAULT_CONTACTTURNS
Definition game.h:495
GAME_DEFAULT_SCORELOGLEVEL
#define GAME_DEFAULT_SCORELOGLEVEL
Definition game.h:573
GAME_DEFAULT_TECHLEVEL
#define GAME_DEFAULT_TECHLEVEL
Definition game.h:386
GAME_DEFAULT_DISASTERS
#define GAME_DEFAULT_DISASTERS
Definition game.h:505
GAME_DEFAULT_GOLD
#define GAME_DEFAULT_GOLD
Definition game.h:371
GAME_DEFAULT_MIGRATION
#define GAME_DEFAULT_MIGRATION
Definition game.h:517
GAME_DEFAULT_NATURALCITYNAMES
#define GAME_DEFAULT_NATURALCITYNAMES
Definition game.h:515
GAME_DEFAULT_EVENT_CACHE_TURNS
#define GAME_DEFAULT_EVENT_CACHE_TURNS
Definition game.h:705
GAME_DEFAULT_VICTORY_CONDITIONS
#define GAME_DEFAULT_VICTORY_CONDITIONS
Definition game.h:581
GAME_DEFAULT_FOGGEDBORDERS
#define GAME_DEFAULT_FOGGEDBORDERS
Definition game.h:440
GAME_DEFAULT_UNITWAITTIME
#define GAME_DEFAULT_UNITWAITTIME
Definition game.h:612
GAME_DEFAULT_TIMEOUTADDEMOVE
#define GAME_DEFAULT_TIMEOUTADDEMOVE
Definition game.h:598
GAME_DEFAULT_DISPERSION
#define GAME_DEFAULT_DISPERSION
Definition game.h:382
GAME_DEFAULT_EVENT_CACHE_CHAT
#define GAME_DEFAULT_EVENT_CACHE_CHAT
Definition game.h:713
GAME_DEFAULT_DIPLOMACY
#define GAME_DEFAULT_DIPLOMACY
Definition game.h:458
GAME_DEFAULT_MGR_DISTANCE
#define GAME_DEFAULT_MGR_DISTANCE
Definition game.h:528
GAME_DEFAULT_TURNBLOCK
#define GAME_DEFAULT_TURNBLOCK
Definition game.h:588
GAME_DEFAULT_PINGTIME
#define GAME_DEFAULT_PINGTIME
Definition game.h:624
GAME_DEFAULT_AQUEDUCTLOSS
#define GAME_DEFAULT_AQUEDUCTLOSS
Definition game.h:540
GAME_DEFAULT_TRADEMINDIST
#define GAME_DEFAULT_TRADEMINDIST
Definition game.h:652
GAME_DEFAULT_ANGRYCITIZEN
#define GAME_DEFAULT_ANGRYCITIZEN
Definition game.h:390
GAME_DEFAULT_BARBARIANRATE
#define GAME_DEFAULT_BARBARIANRATE
Definition game.h:658
GAME_DEFAULT_HAPPYBORDERS
#define GAME_DEFAULT_HAPPYBORDERS
Definition game.h:456
GAME_DEFAULT_END_TURN
#define GAME_DEFAULT_END_TURN
Definition game.h:392
GAME_DEFAULT_DIPLGOLDCOST
#define GAME_DEFAULT_DIPLGOLDCOST
Definition game.h:426
GAME_DEFAULT_END_SPACESHIP
#define GAME_DEFAULT_END_SPACESHIP
Definition game.h:582
GAME_DEFAULT_EVENT_CACHE_MAX_SIZE
#define GAME_DEFAULT_EVENT_CACHE_MAX_SIZE
Definition game.h:709
GAME_DEFAULT_SAVE_NAME
#define GAME_DEFAULT_SAVE_NAME
Definition game.h:676
GAME_DEFAULT_MGR_NATIONCHANCE
#define GAME_DEFAULT_MGR_NATIONCHANCE
Definition game.h:532
GAME_DEFAULT_FOGOFWAR
#define GAME_DEFAULT_FOGOFWAR
Definition game.h:438
GAME_DEFAULT_DIPLBULBCOST
#define GAME_DEFAULT_DIPLBULBCOST
Definition game.h:422
GAME_DEFAULT_RESTRICTINFRA
#define GAME_DEFAULT_RESTRICTINFRA
Definition game.h:492
GAME_DEFAULT_CIVILWARSIZE
#define GAME_DEFAULT_CIVILWARSIZE
Definition game.h:488
governments_free
void governments_free(void)
Definition government.c:544
government.h
G_LAST
#define G_LAST
Definition government.h:48
owner
struct city * owner
Definition citydlg.c:226
idex_free
void idex_free(struct world *iworld)
Definition idex.c:54
idex_lookup_city
struct city * idex_lookup_city(struct world *iworld, int id)
Definition idex.c:133
idex_unregister_city
void idex_unregister_city(struct world *iworld, struct city *pcity)
Definition idex.c:97
idex_init
void idex_init(struct world *iworld)
Definition idex.c:45
idex_lookup_unit
struct unit * idex_lookup_unit(struct world *iworld, int id)
Definition idex.c:146
idex_unregister_unit
void idex_unregister_unit(struct world *iworld, struct unit *punit)
Definition idex.c:115
idex.h
improvements_init
void improvements_init(void)
Definition improvement.c:48
user_impr_flags_init
void user_impr_flags_init(void)
Definition improvement.c:1160
improvement_index
Impr_type_id improvement_index(const struct impr_type *pimprove)
Definition improvement.c:175
is_wonder
bool is_wonder(const struct impr_type *pimprove)
Definition improvement.c:343
is_great_wonder
bool is_great_wonder(const struct impr_type *pimprove)
Definition improvement.c:772
impr_flags_free
void impr_flags_free(void)
Definition improvement.c:1172
improvements_free
void improvements_free(void)
Definition improvement.c:82
WONDER_NOT_OWNED
#define WONDER_NOT_OWNED
Definition improvement.h:140
B_LAST
#define B_LAST
Definition improvement.h:42
name
const char * name
Definition inputfile.c:127
ioz.h
log.h
fc_assert_msg
#define fc_assert_msg(condition, message,...)
Definition log.h:181
fc_assert_ret_val
#define fc_assert_ret_val(condition, val)
Definition log.h:194
log_debug
#define log_debug(message,...)
Definition log.h:115
log_error
#define log_error(message,...)
Definition log.h:103
main_map_free
void main_map_free(void)
Definition map.c:560
map_num_tiles
int map_num_tiles(void)
Definition map.c:1026
map_init
void map_init(struct civ_map *imap, bool server_side)
Definition map.c:156
map.h
mem.h
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
multipliers_free
void multipliers_free(void)
Definition multipliers.c:43
multipliers_init
void multipliers_init(void)
Definition multipliers.c:28
multipliers.h
nations_free
void nations_free(void)
Definition nation.c:637
nation_rule_name
const char * nation_rule_name(const struct nation_type *pnation)
Definition nation.c:138
nation_of_unit
struct nation_type * nation_of_unit(const struct unit *punit)
Definition nation.c:463
nation_of_player
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:444
nation_of_city
struct nation_type * nation_of_city(const struct city *pcity)
Definition nation.c:454
nation_sets_groups_free
void nation_sets_groups_free(void)
Definition nation.c:1178
nation_sets_groups_init
void nation_sets_groups_init(void)
Definition nation.c:1170
nation.h
packets.h
player_number
int player_number(const struct player *pplayer)
Definition player.c:837
player_slots_free
void player_slots_free(void)
Definition player.c:386
player_ruleset_close
void player_ruleset_close(struct player *pplayer)
Definition player.c:745
player_clear
void player_clear(struct player *pplayer, bool full)
Definition player.c:669
player_slots_init
void player_slots_init(void)
Definition player.c:360
player.h
players_iterate_end
#define players_iterate_end
Definition player.h:539
players_iterate
#define players_iterate(_pplayer)
Definition player.h:534
secfile_destroy
void secfile_destroy(struct section_file *secfile)
Definition section_file.c:95
universal_found_functions_init
void universal_found_functions_init(void)
Definition requirements.c:7968
researches_init
void researches_init(void)
Definition research.c:64
researches_free
void researches_free(void)
Definition research.c:100
research.h
rgbcolor_destroy
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
Definition rgbcolor.c:74
rgbcolor.h
fc_vsnprintcf
int fc_vsnprintcf(char *buf, size_t buf_len, const char *format, const struct cf_sequence *sequences, size_t sequences_num)
Definition shared.c:2202
big_int_to_text
const char * big_int_to_text(unsigned int mantissa, unsigned int exponent)
Definition shared.c:162
shared.h
cf_end
static struct cf_sequence cf_end(void)
Definition shared.h:433
cf_int_seq
static void cf_int_seq(char letter, int value, struct cf_sequence *out)
Definition shared.h:367
cf_str_seq
static struct cf_sequence cf_str_seq(char letter, const char *value)
Definition shared.h:419
spaceship.h
specialists_free
void specialists_free(void)
Definition specialist.c:53
specialists_init
void specialists_init(void)
Definition specialist.c:36
specialist.h
cf_sequence
Definition shared.h:308
city
Definition city.h:320
city::id
int id
Definition city.h:326
city::tile
struct tile * tile
Definition city.h:322
city::units_supported
struct unit_list * units_supported
Definition city.h:406
civ_game
Definition game.h:82
civ_game::diplgoldcost
int diplgoldcost
Definition game.h:140
civ_game::contactturns
int contactturns
Definition game.h:137
civ_game::allowed_city_names
enum city_names_mode allowed_city_names
Definition game.h:127
civ_game::unitwaittime
int unitwaittime
Definition game.h:198
civ_game::multiresearch
bool multiresearch
Definition game.h:163
civ_game::incite_gold_capt_chance
int incite_gold_capt_chance
Definition game.h:142
civ_game::nationlist
char * nationlist
Definition game.h:282
civ_game::as_count
size_t as_count
Definition game.h:293
civ_game::mgr_worldchance
int mgr_worldchance
Definition game.h:162
civ_game::plr_colors
struct rgbcolor_list * plr_colors
Definition game.h:245
civ_game::kick_time
int kick_time
Definition game.h:153
civ_game::allowed_govs
const char ** allowed_govs
Definition game.h:285
civ_game::chat
bool chat
Definition game.h:253
civ_game::unit_deallocate
void(* unit_deallocate)(int unit_id)
Definition game.h:301
civ_game::barbarianrate
enum barbarians_rate barbarianrate
Definition game.h:133
civ_game::last_updated_year
bool last_updated_year
Definition game.h:236
civ_game::dispersion
int dispersion
Definition game.h:143
civ_game::max_size
int max_size
Definition game.h:252
civ_game::world_peace_start
int world_peace_start
Definition game.h:238
civ_game::save_compress_level
int save_compress_level
Definition game.h:181
civ_game::plr_bg_color
struct rgbcolor * plr_bg_color
Definition game.h:103
civ_game::tcptimeout
int tcptimeout
Definition game.h:195
civ_game::start_units
char start_units[MAX_LEN_STARTUNIT]
Definition game.h:189
civ_game::event_cache
struct civ_game::@31::@35::@36 event_cache
civ_game::save_nturns
int save_nturns
Definition game.h:183
civ_game::debug
bool debug[DEBUG_LAST]
Definition game.h:202
civ_game::scenario_desc
struct packet_scenario_description scenario_desc
Definition game.h:88
civ_game::description_file
char * description_file
Definition game.h:281
civ_game::mgr_nationchance
int mgr_nationchance
Definition game.h:160
civ_game::connectmsg
char connectmsg[MAX_LEN_MSG]
Definition game.h:219
civ_game::spaceship_travel_pct
int spaceship_travel_pct
Definition game.h:179
civ_game::save_private_map
bool save_private_map
Definition game.h:262
civ_game::techlost_recv
int techlost_recv
Definition game.h:194
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
civ_game::ruleset_summary
char * ruleset_summary
Definition game.h:84
civ_game::mgr_foodneeded
bool mgr_foodneeded
Definition game.h:159
civ_game::diplchance
int diplchance
Definition game.h:138
civ_game::netwait
int netwait
Definition game.h:168
civ_game::random_move_time
struct player * random_move_time
Definition game.h:276
civ_game::nc_agovs
char ** nc_agovs
Definition game.h:286
civ_game::fogofwar_old
bool fogofwar_old
Definition game.h:234
civ_game::incite_gold_loss_chance
int incite_gold_loss_chance
Definition game.h:141
civ_game::end_turn
int end_turn
Definition game.h:144
civ_game::save_options
struct civ_game::@31::@35::@37 save_options
civ_game::plrcolormode
enum plrcolor_mode plrcolormode
Definition game.h:128
civ_game::onsetbarbarian
int onsetbarbarian
Definition game.h:171
civ_game::demography
char demography[MAX_LEN_DEMOGRAPHY]
Definition game.h:240
civ_game::info
struct packet_game_info info
Definition game.h:89
civ_game::mgr_turninterval
int mgr_turninterval
Definition game.h:161
civ_game::user_message
char user_message[256]
Definition game.h:266
civ_game::min_players
int min_players
Definition game.h:166
civ_game::timeoutcounter
int timeoutcounter
Definition game.h:207
civ_game::endspaceship
bool endspaceship
Definition game.h:145
civ_game::last_ping
time_t last_ping
Definition game.h:210
civ_game::scoreloglevel
enum scorelog_level scoreloglevel
Definition game.h:223
civ_game::rulesetdir
char rulesetdir[MAX_LEN_NAME]
Definition game.h:239
civ_game::start_year
int start_year
Definition game.h:191
civ_game::migration
bool migration
Definition game.h:164
civ_game::additional_phase_seconds
int additional_phase_seconds
Definition game.h:212
civ_game::luadata
struct section_file * luadata
Definition game.h:247
civ_game::diplbulbcost
int diplbulbcost
Definition game.h:139
civ_game::scoreturn
int scoreturn
Definition game.h:225
civ_game::seed
randseed seed
Definition game.h:227
civ_game::natural_city_names
bool natural_city_names
Definition game.h:167
civ_game::dbid
int dbid
Definition game.h:248
civ_game::embedded_nations
char ** embedded_nations
Definition game.h:283
civ_game::maxconnectionsperhost
int maxconnectionsperhost
Definition game.h:155
civ_game::scenario
struct packet_scenario_info scenario
Definition game.h:87
civ_game::timeoutint
int timeoutint
Definition game.h:203
civ_game::pingtimeout
int pingtimeout
Definition game.h:173
civ_game::nc_astyles
char ** nc_astyles
Definition game.h:292
civ_game::occupychance
int occupychance
Definition game.h:170
civ_game::killunhomed
int killunhomed
Definition game.h:154
civ_game::nuclear_winter_percent
int nuclear_winter_percent
Definition game.h:232
civ_game::conquercost
int conquercost
Definition game.h:136
civ_game::revealmap
unsigned revealmap
Definition game.h:177
civ_game::pingtime
int pingtime
Definition game.h:172
civ_game::allowed_terrains
const char ** allowed_terrains
Definition game.h:288
civ_game::ruledit
struct civ_game::@31::@35::@40 ruledit
civ_game::callbacks
struct civ_game::@33 callbacks
civ_game::ruleset_description
char * ruleset_description
Definition game.h:85
civ_game::civilwarsize
int civilwarsize
Definition game.h:135
civ_game::save_known
bool save_known
Definition game.h:259
civ_game::ag_count
size_t ag_count
Definition game.h:287
civ_game::savepalace
bool savepalace
Definition game.h:187
civ_game::freecost
int freecost
Definition game.h:148
civ_game::allowed_styles
const char ** allowed_styles
Definition game.h:291
civ_game::aqueductloss
int aqueductloss
Definition game.h:129
civ_game::save_name
char save_name[MAX_LEN_NAME]
Definition game.h:220
civ_game::save_compress_type
enum fz_method save_compress_type
Definition game.h:182
civ_game::trait_dist
enum trait_dist_mode trait_dist
Definition game.h:165
civ_game::foggedborders
bool foggedborders
Definition game.h:147
civ_game::server
struct civ_game::@31::@35 server
civ_game::nc_aterrs
char ** nc_aterrs
Definition game.h:289
civ_game::embedded_nations_count
size_t embedded_nations_count
Definition game.h:284
civ_game::ruleset_capabilities
char * ruleset_capabilities
Definition game.h:86
civ_game::timeoutincmult
int timeoutincmult
Definition game.h:205
civ_game::homecaughtunits
bool homecaughtunits
Definition game.h:188
civ_game::at_count
size_t at_count
Definition game.h:290
civ_game::meta_info
struct civ_game::@31::@35::@38 meta_info
civ_game::timeoutinc
int timeoutinc
Definition game.h:204
civ_game::allow_take
char allow_take[MAX_LEN_ALLOW_TAKE]
Definition game.h:241
civ_game::autoattack
bool autoattack
Definition game.h:131
civ_game::phase_mode_stored
int phase_mode_stored
Definition game.h:216
civ_game::max_players
int max_players
Definition game.h:156
civ_game::revolution_length
int revolution_length
Definition game.h:178
civ_game::turns
int turns
Definition game.h:251
civ_game::save_starts
bool save_starts
Definition game.h:261
civ_game::auto_ai_toggle
bool auto_ai_toggle
Definition game.h:130
civ_game::veteran
struct veteran_system * veteran
Definition game.h:101
civ_game::mgr_distance
int mgr_distance
Definition game.h:158
civ_game::global_warming_percent
int global_warming_percent
Definition game.h:230
civ_game::calendar
struct packet_calendar_info calendar
Definition game.h:90
civ_game::government_during_revolution
struct government * government_during_revolution
Definition game.h:94
civ_game::timeoutintinc
int timeoutintinc
Definition game.h:206
civ_game::techlost_donor
int techlost_donor
Definition game.h:193
civ_game::timeoutaddenemymove
int timeoutaddenemymove
Definition game.h:208
civ_game::scorelog
bool scorelog
Definition game.h:222
civ_game::techpenalty
int techpenalty
Definition game.h:196
civ_game::razechance
int razechance
Definition game.h:176
civ_game::turnblock
bool turnblock
Definition game.h:197
civ_map
Definition map_types.h:71
packet_calendar_info::positive_year_label
char positive_year_label[MAX_LEN_NAME]
Definition packets_gen.h:259
packet_calendar_info::calendar_skip_0
bool calendar_skip_0
Definition packets_gen.h:263
packet_calendar_info::negative_year_label
char negative_year_label[MAX_LEN_NAME]
Definition packets_gen.h:260
packet_calendar_info::calendar_fragment_name
char calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME]
Definition packets_gen.h:262
packet_game_info::coolinglevel
int coolinglevel
Definition packets_gen.h:151
packet_game_info::shieldbox
int shieldbox
Definition packets_gen.h:225
packet_game_info::fulltradesize
int fulltradesize
Definition packets_gen.h:160
packet_game_info::restrictinfra
bool restrictinfra
Definition packets_gen.h:222
packet_game_info::celebratesize
int celebratesize
Definition packets_gen.h:141
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:133
packet_game_info::team_pooled_research
bool team_pooled_research
Definition packets_gen.h:228
packet_game_info::aifill
int aifill
Definition packets_gen.h:120
packet_game_info::happyborders
enum happyborders_type happyborders
Definition packets_gen.h:181
packet_game_info::disasters
int disasters
Definition packets_gen.h:221
packet_game_info::trading_city
bool trading_city
Definition packets_gen.h:242
packet_game_info::government_during_revolution_id
Government_type_id government_during_revolution_id
Definition packets_gen.h:175
packet_game_info::first_timeout
int first_timeout
Definition packets_gen.h:238
packet_game_info::globalwarming
int globalwarming
Definition packets_gen.h:168
packet_game_info::pop_report_zeroes
int pop_report_zeroes
Definition packets_gen.h:143
packet_game_info::nuclearwinter
int nuclearwinter
Definition packets_gen.h:209
packet_game_info::killstack
bool killstack
Definition packets_gen.h:192
packet_game_info::angrycitizen
int angrycitizen
Definition packets_gen.h:125
packet_game_info::notradesize
int notradesize
Definition packets_gen.h:207
packet_game_info::diplomacy
enum diplomacy_mode diplomacy
Definition packets_gen.h:153
packet_game_info::trading_gold
bool trading_gold
Definition packets_gen.h:243
packet_game_info::rapturedelay
int rapturedelay
Definition packets_gen.h:220
packet_game_info::trade_revenue_style
enum trade_revenue_style trade_revenue_style
Definition packets_gen.h:241
packet_game_info::year_0_hack
bool year_0_hack
Definition packets_gen.h:248
packet_game_info::great_wonder_owners
int great_wonder_owners[B_LAST]
Definition packets_gen.h:179
packet_game_info::cooling
int cooling
Definition packets_gen.h:150
packet_game_info::is_edit_mode
bool is_edit_mode
Definition packets_gen.h:189
packet_game_info::trading_tech
bool trading_tech
Definition packets_gen.h:244
packet_game_info::global_advances
bool global_advances[A_LAST]
Definition packets_gen.h:166
packet_game_info::is_new_game
bool is_new_game
Definition packets_gen.h:190
packet_game_info::infrapoints
int infrapoints
Definition packets_gen.h:172
packet_game_info::warminglevel
int warminglevel
Definition packets_gen.h:246
packet_game_info::airlifting_style
enum airlifting_style airlifting_style
Definition packets_gen.h:122
packet_game_info::skill_level
enum ai_level skill_level
Definition packets_gen.h:226
packet_game_info::revolentype
enum revolen_type revolentype
Definition packets_gen.h:173
packet_game_info::gold
int gold
Definition packets_gen.h:169
packet_game_info::phase_mode
enum phase_mode_type phase_mode
Definition packets_gen.h:211
packet_game_info::caravan_bonus_style
enum caravan_bonus_style caravan_bonus_style
Definition packets_gen.h:135
packet_game_info::tech
int tech
Definition packets_gen.h:229
packet_game_info::diplchance_initial_odds
bv_actions diplchance_initial_odds
Definition packets_gen.h:152
packet_game_info::heating
int heating
Definition packets_gen.h:182
packet_game_info::turn
int turn
Definition packets_gen.h:245
packet_game_info::year
int year
Definition packets_gen.h:247
packet_game_info::sciencebox
int sciencebox
Definition packets_gen.h:224
packet_game_info::top_cities_count
int top_cities_count
Definition packets_gen.h:249
packet_game_info::trademindist
int trademindist
Definition packets_gen.h:240
packet_game_info::nuclear_winter
bool nuclear_winter
Definition packets_gen.h:208
packet_game_info::fogofwar
bool fogofwar
Definition packets_gen.h:154
packet_game_info::foodbox
int foodbox
Definition packets_gen.h:156
packet_game_info::victory_conditions
enum victory_condition_type victory_conditions
Definition packets_gen.h:227
packet_game_info::global_warming
bool global_warming
Definition packets_gen.h:167
packet_game_info::citymindist
int citymindist
Definition packets_gen.h:149
packet_game_info::default_government_id
Government_type_id default_government_id
Definition packets_gen.h:174
packet_game_info::global_advance_count
int global_advance_count
Definition packets_gen.h:165
packet_game_info::killcitizen
bool killcitizen
Definition packets_gen.h:191
packet_game_info::timeout
int timeout
Definition packets_gen.h:237
packet_ruleset_control::preferred_soundset
char preferred_soundset[MAX_LEN_NAME]
Definition packets_gen.h:1460
packet_ruleset_control::num_styles
int num_styles
Definition packets_gen.h:1450
packet_ruleset_control::num_unit_types
int num_unit_types
Definition packets_gen.h:1438
packet_ruleset_control::num_impr_types
int num_impr_types
Definition packets_gen.h:1439
packet_ruleset_control::nation_count
int nation_count
Definition packets_gen.h:1453
packet_ruleset_control::num_road_types
int num_road_types
Definition packets_gen.h:1444
packet_ruleset_control::terrain_count
int terrain_count
Definition packets_gen.h:1455
packet_ruleset_control::preferred_tileset
char preferred_tileset[MAX_LEN_NAME]
Definition packets_gen.h:1459
packet_ruleset_control::num_music_styles
int num_music_styles
Definition packets_gen.h:1451
packet_ruleset_control::num_tech_types
int num_tech_types
Definition packets_gen.h:1441
packet_ruleset_control::government_count
int government_count
Definition packets_gen.h:1452
packet_ruleset_control::num_disaster_types
int num_disaster_types
Definition packets_gen.h:1447
packet_ruleset_control::num_achievement_types
int num_achievement_types
Definition packets_gen.h:1448
packet_ruleset_control::num_specialist_types
int num_specialist_types
Definition packets_gen.h:1456
packet_ruleset_control::preferred_musicset
char preferred_musicset[MAX_LEN_NAME]
Definition packets_gen.h:1461
packet_ruleset_control::num_unit_classes
int num_unit_classes
Definition packets_gen.h:1437
packet_ruleset_control::num_city_styles
int num_city_styles
Definition packets_gen.h:1454
packet_ruleset_control::num_resource_types
int num_resource_types
Definition packets_gen.h:1445
packet_ruleset_control::num_nation_sets
int num_nation_sets
Definition packets_gen.h:1458
packet_ruleset_control::num_nation_groups
int num_nation_groups
Definition packets_gen.h:1457
packet_ruleset_control::num_base_types
int num_base_types
Definition packets_gen.h:1443
packet_scenario_description::description
char description[MAX_LEN_CONTENT]
Definition packets_gen.h:1608
packet_scenario_info::lake_flooding
bool lake_flooding
Definition packets_gen.h:1598
packet_scenario_info::have_resources
bool have_resources
Definition packets_gen.h:1603
packet_scenario_info::is_scenario
bool is_scenario
Definition packets_gen.h:1591
packet_scenario_info::ruleset_locked
bool ruleset_locked
Definition packets_gen.h:1601
packet_scenario_info::allow_ai_type_fallback
bool allow_ai_type_fallback
Definition packets_gen.h:1600
packet_scenario_info::players
bool players
Definition packets_gen.h:1594
packet_scenario_info::authors
char authors[MAX_LEN_PACKET/3]
Definition packets_gen.h:1593
packet_scenario_info::name
char name[256]
Definition packets_gen.h:1592
packet_scenario_info::prevent_new_cities
bool prevent_new_cities
Definition packets_gen.h:1597
packet_scenario_info::handmade
bool handmade
Definition packets_gen.h:1599
packet_scenario_info::startpos_nations
bool startpos_nations
Definition packets_gen.h:1595
packet_scenario_info::save_random
bool save_random
Definition packets_gen.h:1596
player
Definition player.h:249
player::cities
struct city_list * cities
Definition player.h:281
player::team
struct team * team
Definition player.h:261
player::units
struct unit_list * units
Definition player.h:282
tile
Definition tile.h:50
unit
Definition unit.h:140
unit::id
int id
Definition unit.h:147
unit::homecity
int homecity
Definition unit.h:148
user_flag
Definition game.h:73
user_flag::name
char * name
Definition game.h:74
user_flag::helptxt
char * helptxt
Definition game.h:75
world
Definition world_object.h:37
world::map
struct civ_map map
Definition world_object.h:38
styles_free
void styles_free(void)
Definition style.c:51
music_styles_free
void music_styles_free(void)
Definition style.c:148
style.h
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
fc_isalnum
bool fc_isalnum(char c)
Definition support.c:1196
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:189
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
team_slots_free
void team_slots_free(void)
Definition team.c:85
team_number
int team_number(const struct team *pteam)
Definition team.c:391
team_slots_init
void team_slots_init(void)
Definition team.c:53
tech_classes_init
void tech_classes_init(void)
Definition tech.c:317
techs_init
void techs_init(void)
Definition tech.c:469
techs_free
void techs_free(void)
Definition tech.c:520
user_tech_flags_init
void user_tech_flags_init(void)
Definition tech.c:380
user_tech_flags_free
void user_tech_flags_free(void)
Definition tech.c:392
tech.h
A_LAST
#define A_LAST
Definition tech.h:45
user_terrain_flags_init
void user_terrain_flags_init(void)
Definition terrain.c:764
terrains_free
void terrains_free(void)
Definition terrain.c:65
terrains_init
void terrains_init(void)
Definition terrain.c:42
user_terrain_flags_free
void user_terrain_flags_free(void)
Definition terrain.c:776
terrain.h
tile_set_worked
void tile_set_worked(struct tile *ptile, struct city *pcity)
Definition tile.c:106
tile_worked
#define tile_worked(_tile)
Definition tile.h:115
TILE_XY
#define TILE_XY(ptile)
Definition tile.h:43
trade_route_types_init
void trade_route_types_init(void)
Definition traderoutes.c:134
goods_init
void goods_init(void)
Definition traderoutes.c:564
goods_free
void goods_free(void)
Definition traderoutes.c:580
traderoutes.h
unit_virtual_destroy
void unit_virtual_destroy(struct unit *punit)
Definition unit.c:1767
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:397
unit_owner
#define unit_owner(_pu)
Definition unit.h:396
unitlist.h
unit_types_init
void unit_types_init(void)
Definition unittype.c:2346
user_unit_type_flags_init
void user_unit_type_flags_init(void)
Definition unittype.c:1864
unit_class_flags_free
void unit_class_flags_free(void)
Definition unittype.c:2411
unit_rule_name
const char * unit_rule_name(const struct unit *punit)
Definition unittype.c:1587
unit_types_free
void unit_types_free(void)
Definition unittype.c:2385
veteran_system_destroy
void veteran_system_destroy(struct veteran_system *vsystem)
Definition unittype.c:2658
unit_classes_free
void unit_classes_free(void)
Definition unittype.c:2528
unit_type_flags_free
void unit_type_flags_free(void)
Definition unittype.c:2399
user_unit_class_flags_init
void user_unit_class_flags_init(void)
Definition unittype.c:1800
unit_classes_init
void unit_classes_init(void)
Definition unittype.c:2506
role_unit_precalcs_free
void role_unit_precalcs_free(void)
Definition unittype.c:2160
victory.h