|
Freeciv-3.3
|
#include <ctype.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "bitvector.h"#include "fcintl.h"#include "idex.h"#include "log.h"#include "mem.h"#include "rand.h"#include "registry.h"#include "shared.h"#include "support.h"#include "timing.h"#include "achievements.h"#include "ai.h"#include "capability.h"#include "citizens.h"#include "city.h"#include "counters.h"#include "game.h"#include "government.h"#include "map.h"#include "mapimg.h"#include "movement.h"#include "multipliers.h"#include "packets.h"#include "research.h"#include "rgbcolor.h"#include "sex.h"#include "specialist.h"#include "unit.h"#include "unitlist.h"#include "version.h"#include "barbarian.h"#include "citizenshand.h"#include "citytools.h"#include "cityturn.h"#include "diplhand.h"#include "maphand.h"#include "meta.h"#include "notify.h"#include "plrhand.h"#include "report.h"#include "ruleload.h"#include "sanitycheck.h"#include "savecompat.h"#include "score.h"#include "settings.h"#include "spacerace.h"#include "srv_main.h"#include "stdinhand.h"#include "techtools.h"#include "unittools.h"#include "advdata.h"#include "advbuilding.h"#include "infracache.h"#include "mapgen.h"#include "mapgen_utils.h"#include "script_server.h"#include "aitraits.h"#include "difficulty.h"#include "savegame3.h"Go to the source code of this file.
Data Structures | |
| struct | savedata |
| struct | treaty_cb_data |
Macros | |
| #define | ACTIVITY_OLD_POLLUTION_SG3 (ACTIVITY_LAST + 1) |
| #define | ACTIVITY_OLD_FALLOUT_SG3 (ACTIVITY_OLD_POLLUTION_SG3 + 1) |
| #define | ACTIVITY_LAST_SAVEGAME3 (ACTIVITY_OLD_FALLOUT_SG3 + 1) |
| #define | SAVE_MAP_CHAR(ptile, GET_XY_CHAR, secfile, secpath, ...) |
| #define | LOAD_MAP_CHAR(ch, ptile, SET_XY_CHAR, secfile, secpath, ...) |
| #define | halfbyte_iterate_extras(e, num_extras_types) |
| #define | halfbyte_iterate_extras_end |
| #define | TOKEN_SIZE 10 |
| #define | PART_SIZE (3*256) |
| #define | PART_ADJUST (3) |
Variables | |
| bool | sg_success |
| static const char | savefile_options_default [] |
| #define ACTIVITY_LAST_SAVEGAME3 (ACTIVITY_OLD_FALLOUT_SG3 + 1) |
Definition at line 153 of file savegame3.c.
| #define ACTIVITY_OLD_FALLOUT_SG3 (ACTIVITY_OLD_POLLUTION_SG3 + 1) |
Definition at line 152 of file savegame3.c.
| #define ACTIVITY_OLD_POLLUTION_SG3 (ACTIVITY_LAST + 1) |
Definition at line 151 of file savegame3.c.
| #define halfbyte_iterate_extras | ( | e, | |
| num_extras_types | |||
| ) |
Definition at line 255 of file savegame3.c.
| #define halfbyte_iterate_extras_end |
Definition at line 260 of file savegame3.c.
| #define LOAD_MAP_CHAR | ( | ch, | |
| ptile, | |||
| SET_XY_CHAR, | |||
| secfile, | |||
| secpath, | |||
| ... | |||
| ) |
Definition at line 219 of file savegame3.c.
| #define PART_ADJUST (3) |
| #define PART_SIZE (3*256) |
| #define SAVE_MAP_CHAR | ( | ptile, | |
| GET_XY_CHAR, | |||
| secfile, | |||
| secpath, | |||
| ... | |||
| ) |
Definition at line 172 of file savegame3.c.
| #define TOKEN_SIZE 10 |
Definition at line 276 of file savegame3.c.
Returns a character identifier for an activity. See also char2activity().
activity type is 'int', and not 'enum_activity' for supporting deprecated values (..._OLD_...)
Definition at line 823 of file savegame3.c.
Referenced by char2activity(), sg_save_player_cities(), and sg_save_player_units().
|
static |
Returns an activity for a character identifier. See also activity2char().
Definition at line 874 of file savegame3.c.
Referenced by sg_load_player_city(), and sg_load_player_unit().
|
static |
Returns a direction for a character identifier. See also dir2char.
Definition at line 761 of file savegame3.c.
Referenced by sg_load_player_city(), and sg_load_player_unit().
|
static |
Returns an order for a character identifier. See also order2char.
Definition at line 710 of file savegame3.c.
Referenced by sg_load_player_city(), and sg_load_player_unit().
Dereferences the terrain character. See terrains[].identifier example: char2terrain('a') => T_ARCTIC
Definition at line 1227 of file savegame3.c.
Referenced by sg_load_map_tiles(), and sg_load_player_vision().
|
static |
Returns a character identifier for a direction. See also char2dir.
Definition at line 790 of file savegame3.c.
Referenced by sg_save_player_cities(), and sg_save_player_units().
Free resources allocated for loaddata item.
Definition at line 623 of file savegame3.c.
Referenced by savegame3_load().
|
static |
Create new loaddata item for given section file.
Definition at line 584 of file savegame3.c.
Referenced by savegame3_load().
|
static |
Returns a character identifier for an order. See also char2order.
Definition at line 737 of file savegame3.c.
Referenced by sg_save_player_cities(), and sg_save_player_units().
Quote the memory block denoted by data and length so it consists only of " a-f0-9:". The returned string has to be freed by the caller using free().
Definition at line 897 of file savegame3.c.
Referenced by sg_save_player_attributes().
Free resources allocated for savedata item
Definition at line 698 of file savegame3.c.
Referenced by savegame3_save_real().
|
static |
Create new savedata item for given file.
Definition at line 679 of file savegame3.c.
Referenced by savegame3_save_real().
| void savegame3_load | ( | struct section_file * | file | ) |
Really loading the savegame.
Definition at line 458 of file savegame3.c.
Referenced by savegame_load().
Main entry point for saving a game in savegame3 format.
Definition at line 431 of file savegame3.c.
Referenced by savegame_save().
|
static |
Really save the game to a file.
Definition at line 527 of file savegame3.c.
Referenced by savegame3_save().
|
static |
Helper function for saving extras into a savegame.
Extras are packed in four to a character in hex notation. 'index' specifies which set of extras are included in this character.
Definition at line 1198 of file savegame3.c.
Referenced by sg_save_map_tiles_extras().
|
static |
Helper function for saving extras into a savegame.
Extras are packed in four to a character in hex notation. 'index' specifies which set of extras are included in this character.
Definition at line 1165 of file savegame3.c.
Referenced by sg_save_player_vision().
Helper function for loading extras from a savegame.
'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.
Definition at line 1133 of file savegame3.c.
Referenced by sg_load_map_tiles_extras().
Helper function for loading extras from a savegame.
'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.
Definition at line 1100 of file savegame3.c.
Referenced by sg_load_player_vision().
Load tile owner information
Definition at line 3251 of file savegame3.c.
Referenced by sg_load_map().
Load starting positions for the players from a savegame file. There should be at least enough for every player.
Definition at line 3109 of file savegame3.c.
Referenced by sg_load_map().
Load worked tiles information
Definition at line 3509 of file savegame3.c.
Referenced by sg_load_map().
Load player (client) attributes data
Definition at line 7005 of file savegame3.c.
Referenced by sg_load_players().
|
static |
Load data for one city. sg_save_player_city() is not defined.
Definition at line 5164 of file savegame3.c.
Referenced by sg_load_player_cities().
|
static |
Load nationality data for one city.
Definition at line 5627 of file savegame3.c.
Referenced by sg_load_player_cities().
Main player data loading function
Definition at line 4229 of file savegame3.c.
Referenced by sg_load_players().
|
static |
Load one unit. sg_save_player_unit() is not defined.
Definition at line 6153 of file savegame3.c.
Referenced by sg_load_player_units().
|
static |
Load the transport status of all units. This is separated from the other code as all units must be known.
Definition at line 6686 of file savegame3.c.
Referenced by sg_load_players().
|
static |
Load data for one seen city. sg_save_player_vision_city() is not defined.
Definition at line 7370 of file savegame3.c.
Referenced by sg_load_player_vision().
Load '[player]' (basic data).
Definition at line 3712 of file savegame3.c.
Referenced by savegame3_load().
Sanity check for loaded game.
Definition at line 8094 of file savegame3.c.
Referenced by savegame3_load().
Save '[event_cache]'.
Definition at line 7837 of file savegame3.c.
Referenced by savegame3_save_real().
Save tile known status for whole map and all players
Definition at line 3649 of file savegame3.c.
Referenced by sg_save_map().
Save tile owner information
Definition at line 3373 of file savegame3.c.
Referenced by sg_save_map().
Save the map start positions.
Definition at line 3196 of file savegame3.c.
Referenced by sg_save_map().
Save information about extras on map
Definition at line 3083 of file savegame3.c.
Referenced by sg_save_map().
Save worked tiles information
Definition at line 3553 of file savegame3.c.
Referenced by sg_save_map().
Save player (client) attributes data.
Definition at line 7085 of file savegame3.c.
Referenced by sg_save_players().
Main player data saving function.
Definition at line 4719 of file savegame3.c.
Referenced by sg_save_players().
Save '[research]'.
Definition at line 7764 of file savegame3.c.
Referenced by savegame3_save_real().
Save '[ruledata]'.
Definition at line 2242 of file savegame3.c.
Referenced by savegame3_save_real().
Sanity check for saved game.
Definition at line 8259 of file savegame3.c.
Referenced by savegame3_save_real().
Save '[savefile]'.
Definition at line 1774 of file savegame3.c.
Referenced by savegame3_save_real().
Save options for this savegame. sg_load_savefile_options() is not defined.
Definition at line 2040 of file savegame3.c.
Referenced by sg_save_savefile().
Save '[scenario]'.
Definition at line 2586 of file savegame3.c.
Referenced by savegame3_save_real().
Save all treaties.
Definition at line 7967 of file savegame3.c.
Referenced by savegame3_save_real().
|
static |
Load technology from path + "_name".
Definition at line 1262 of file savegame3.c.
Referenced by sg_load_researches().
|
static |
Save technology in secfile entry called path_name.
Definition at line 1298 of file savegame3.c.
Referenced by sg_save_researches().
References the terrain character. See terrains[].identifier example: terrain2char(T_ARCTIC) => 'a'
Definition at line 1250 of file savegame3.c.
Referenced by sg_save_map_tiles(), and sg_save_player_vision().
For each city and tile, sort unit lists according to ord_city and ord_map values.
Definition at line 1079 of file savegame3.c.
Referenced by sg_load_players().
Assign values to ord_city and ord_map for each unit, so the values can be saved.
Definition at line 1050 of file savegame3.c.
Referenced by sg_save_players().
Unquote a string. The unquoted data is written into dest. If the unquoted data will be larger than dest_length the function aborts. It returns the actual length of the unquoted block.
Definition at line 918 of file savegame3.c.
Referenced by sg_load_player_attributes().
|
static |
Load the worklist elements specified by path to the worklist pointed to by 'pwl'. 'pwl' should be a pointer to an existing worklist.
Definition at line 966 of file savegame3.c.
Referenced by sg_load_player_city().
|
static |
Save the worklist elements specified by path from the worklist pointed to by 'pwl'. 'pwl' should be a pointer to an existing worklist.
Definition at line 1012 of file savegame3.c.
Referenced by sg_save_player_cities().
Definition at line 278 of file savegame3.c.
Referenced by sg_save_savefile().
|
extern |
Definition at line 35 of file savecompat.c.
Referenced by savegame3_load(), savegame3_save_real(), and sg_load_savefile().