|
Freeciv-3.2
|
#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 "ruleset.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 821 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 872 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 759 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 708 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 1225 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 788 of file savegame3.c.
Referenced by sg_save_player_cities(), and sg_save_player_units().
Free resources allocated for loaddata item.
Definition at line 621 of file savegame3.c.
Referenced by savegame3_load().
|
static |
Create new loaddata item for given section file.
Definition at line 582 of file savegame3.c.
Referenced by savegame3_load().
|
static |
Returns a character identifier for an order. See also char2order.
Definition at line 735 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 895 of file savegame3.c.
Referenced by sg_save_player_attributes().
Free resources allocated for savedata item
Definition at line 696 of file savegame3.c.
Referenced by savegame3_save_real().
|
static |
Create new savedata item for given file.
Definition at line 677 of file savegame3.c.
Referenced by savegame3_save_real().
| void savegame3_load | ( | struct section_file * | file | ) |
Really loading the savegame.
Definition at line 456 of file savegame3.c.
Referenced by savegame_load().
Main entry point for saving a game in savegame3 format.
Definition at line 429 of file savegame3.c.
Referenced by savegame_save().
|
static |
Really save the game to a file.
Definition at line 525 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 1196 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 1163 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 1131 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 1098 of file savegame3.c.
Referenced by sg_load_player_vision().
Load tile owner information
Definition at line 3169 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 3027 of file savegame3.c.
Referenced by sg_load_map().
Load worked tiles information
Definition at line 3416 of file savegame3.c.
Referenced by sg_load_map().
Load player (client) attributes data
Definition at line 6874 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 5071 of file savegame3.c.
Referenced by sg_load_player_cities().
|
static |
Load nationality data for one city.
Definition at line 5520 of file savegame3.c.
Referenced by sg_load_player_cities().
Main player data loading function
Definition at line 4136 of file savegame3.c.
Referenced by sg_load_players().
|
static |
Load one unit. sg_save_player_unit() is not defined.
Definition at line 6041 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 6561 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 7239 of file savegame3.c.
Referenced by sg_load_player_vision().
Load '[player]' (basic data).
Definition at line 3619 of file savegame3.c.
Referenced by savegame3_load().
Sanity check for loaded game.
Definition at line 7952 of file savegame3.c.
Referenced by savegame3_load().
Save '[event_cache]'.
Definition at line 7695 of file savegame3.c.
Referenced by savegame3_save_real().
Save tile known status for whole map and all players
Definition at line 3556 of file savegame3.c.
Referenced by sg_save_map().
Save tile owner information
Definition at line 3290 of file savegame3.c.
Referenced by sg_save_map().
Save the map start positions.
Definition at line 3114 of file savegame3.c.
Referenced by sg_save_map().
Save information about extras on map
Definition at line 3001 of file savegame3.c.
Referenced by sg_save_map().
Save worked tiles information
Definition at line 3460 of file savegame3.c.
Referenced by sg_save_map().
Save player (client) attributes data.
Definition at line 6954 of file savegame3.c.
Referenced by sg_save_players().
Main player data saving function.
Definition at line 4626 of file savegame3.c.
Referenced by sg_save_players().
Save '[research]'.
Definition at line 7620 of file savegame3.c.
Referenced by savegame3_save_real().
Save '[ruledata]'.
Definition at line 2238 of file savegame3.c.
Referenced by savegame3_save_real().
Sanity check for saved game.
Definition at line 8126 of file savegame3.c.
Referenced by savegame3_save_real().
Save '[savefile]'.
Definition at line 1772 of file savegame3.c.
Referenced by savegame3_save_real().
Save options for this savegame. sg_load_savefile_options() is not defined.
Definition at line 2038 of file savegame3.c.
Referenced by sg_save_savefile().
Save '[scenario]'.
Definition at line 2581 of file savegame3.c.
Referenced by savegame3_save_real().
Save all treaties.
Definition at line 7825 of file savegame3.c.
Referenced by savegame3_save_real().
|
static |
Load technology from path + "_name".
Definition at line 1260 of file savegame3.c.
Referenced by sg_load_researches().
|
static |
Save technology in secfile entry called path_name.
Definition at line 1296 of file savegame3.c.
Referenced by sg_save_researches().
References the terrain character. See terrains[].identifier example: terrain2char(T_ARCTIC) => 'a'
Definition at line 1248 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 1077 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 1048 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 916 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 964 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 1010 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 34 of file savecompat.c.
Referenced by savegame3_load(), savegame3_save_real(), and sg_load_savefile().