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 "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 "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 "savegame2.h"
Go to the source code of this file.
Macros | |
#define | ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1) |
#define | ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2) |
#define | ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1) |
#define | ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1) |
#define | ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 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 | halfbyte_iterate_special(s, num_specials_types) |
#define | halfbyte_iterate_special_end |
#define | halfbyte_iterate_bases(b, num_bases_types) |
#define | halfbyte_iterate_bases_end |
#define | halfbyte_iterate_roads(r, num_roads_types) |
#define | halfbyte_iterate_roads_end |
#define | TOKEN_SIZE 10 |
#define | ORDER_OLD_BUILD_CITY (-1) |
#define | ORDER_OLD_DISBAND (-2) |
#define | ORDER_OLD_BUILD_WONDER (-3) |
#define | ORDER_OLD_TRADE_ROUTE (-4) |
#define | ORDER_OLD_HOMECITY (-5) |
Variables | |
bool | sg_success |
#define ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 1) |
Definition at line 147 of file savegame2.c.
#define ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1) |
Definition at line 146 of file savegame2.c.
#define ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1) |
Definition at line 145 of file savegame2.c.
#define ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2) |
Definition at line 144 of file savegame2.c.
#define ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1) |
Definition at line 143 of file savegame2.c.
#define halfbyte_iterate_bases | ( | b, | |
num_bases_types | |||
) |
Definition at line 265 of file savegame2.c.
#define halfbyte_iterate_bases_end |
Definition at line 270 of file savegame2.c.
#define halfbyte_iterate_extras | ( | e, | |
num_extras_types | |||
) |
Definition at line 245 of file savegame2.c.
#define halfbyte_iterate_extras_end |
Definition at line 250 of file savegame2.c.
#define halfbyte_iterate_roads | ( | r, | |
num_roads_types | |||
) |
Definition at line 275 of file savegame2.c.
#define halfbyte_iterate_roads_end |
Definition at line 280 of file savegame2.c.
#define halfbyte_iterate_special | ( | s, | |
num_specials_types | |||
) |
Definition at line 255 of file savegame2.c.
#define halfbyte_iterate_special_end |
Definition at line 260 of file savegame2.c.
#define LOAD_MAP_CHAR | ( | ch, | |
ptile, | |||
SET_XY_CHAR, | |||
secfile, | |||
secpath, | |||
... | |||
) |
Definition at line 209 of file savegame2.c.
#define ORDER_OLD_BUILD_CITY (-1) |
Definition at line 286 of file savegame2.c.
#define ORDER_OLD_BUILD_WONDER (-3) |
Definition at line 288 of file savegame2.c.
#define ORDER_OLD_DISBAND (-2) |
Definition at line 287 of file savegame2.c.
#define ORDER_OLD_HOMECITY (-5) |
Definition at line 290 of file savegame2.c.
#define ORDER_OLD_TRADE_ROUTE (-4) |
Definition at line 289 of file savegame2.c.
#define SAVE_MAP_CHAR | ( | ptile, | |
GET_XY_CHAR, | |||
secfile, | |||
secpath, | |||
... | |||
) |
Definition at line 162 of file savegame2.c.
#define TOKEN_SIZE 10 |
Definition at line 284 of file savegame2.c.
Returns a character identifier for an activity. See also char2activity().
Definition at line 665 of file savegame2.c.
Referenced by char2activity().
Returns an activity for a character identifier. See also activity2char().
Definition at line 719 of file savegame2.c.
Referenced by sg_load_player_unit().
|
static |
Returns a direction for a character identifier.
Definition at line 636 of file savegame2.c.
Referenced by sg_load_player_unit().
|
static |
Returns an order for a character identifier.
Definition at line 597 of file savegame2.c.
Referenced by sg_load_player_unit().
|
static |
Return the resource for the given identifier.
Definition at line 1316 of file savegame2.c.
Referenced by sg_load_map_tiles_resources(), and sg_load_player_vision().
Dereferences the terrain character. See terrains[].identifier example: char2terrain('a') => T_ARCTIC
Definition at line 1331 of file savegame2.c.
Referenced by sg_load_map_tiles(), sg_load_player_vision(), and fc_client::slot_selection_changed().
Free resources allocated for loaddata item.
Definition at line 512 of file savegame2.c.
Referenced by savegame2_load().
|
static |
Create new loaddata item for given section file.
Definition at line 471 of file savegame2.c.
Referenced by savegame2_load().
void savegame2_load | ( | struct section_file * | file | ) |
Really loading the savegame.
Definition at line 402 of file savegame2.c.
Referenced by savegame_load().
|
static |
Assign a new base building task to unit
Definition at line 573 of file savegame2.c.
Referenced by sg_load_player_unit().
|
static |
Assign a new road building task to unit
Definition at line 583 of file savegame2.c.
Referenced by sg_load_player_unit().
Helper function for loading bases from a savegame.
'ch' gives the character loaded from the savegame. Bases are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.
Definition at line 1227 of file savegame2.c.
Referenced by sg_load_map_tiles_bases().
Helper function for loading bases from a savegame.
'ch' gives the character loaded from the savegame. Bases are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.
Definition at line 1195 of file savegame2.c.
Referenced by sg_load_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 888 of file savegame2.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 855 of file savegame2.c.
Referenced by sg_load_player_vision().
Load tile owner information
Definition at line 2492 of file savegame2.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 2405 of file savegame2.c.
Referenced by sg_load_map().
Load information about resources on map.
Definition at line 2378 of file savegame2.c.
Referenced by sg_load_map().
Load information about specials on map
Definition at line 2347 of file savegame2.c.
Referenced by sg_load_map().
Load worked tiles information
Definition at line 2579 of file savegame2.c.
Referenced by sg_load_map().
Load player (client) attributes data
Definition at line 4855 of file savegame2.c.
Referenced by sg_load_players().
|
static |
Load data for one city.
Definition at line 3758 of file savegame2.c.
Referenced by sg_load_player_cities().
|
static |
Load nationality data for one city.
Definition at line 4042 of file savegame2.c.
Referenced by sg_load_player_cities().
Main player data loading function
Definition at line 3136 of file savegame2.c.
Referenced by sg_load_players().
|
static |
Load the transport status of all units. This is separated from the other code as all units must be known.
Definition at line 4802 of file savegame2.c.
Referenced by sg_load_players().
|
static |
Load data for one seen city.
Definition at line 5156 of file savegame2.c.
Referenced by sg_load_player_vision().
Load '[player]' (basic data).
Definition at line 2687 of file savegame2.c.
Referenced by savegame2_load().
Set up correct ruleset for the savegame
Definition at line 1394 of file savegame2.c.
Referenced by savegame2_load().
Sanity check for loaded game.
Definition at line 5532 of file savegame2.c.
Referenced by savegame2_load().
Returns the action id corresponding to the specified order id. If no corresponding action is found ACTION_NONE is returned.
Relevant tile content information must be loaded before this function is called. Tile content information is relevant if it determines what action an old order result in. Example: a 2.6 ORDER_BUILD_CITY would result in Join City inside a domestic city and in Found City on a tile without a city. That makes domestic cities relevant tile content information.
Definition at line 4168 of file savegame2.c.
Referenced by sg_load_player_unit().
Helper function for loading roads from a savegame.
'ch' gives the character loaded from the savegame. Roads are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> road bit.
Definition at line 1289 of file savegame2.c.
Referenced by sg_load_map_tiles_roads().
Helper function for loading roads from a savegame.
'ch' gives the character loaded from the savegame. Roads are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> road bit.
Definition at line 1258 of file savegame2.c.
Referenced by sg_load_player_vision().
|
static |
Complicated helper function for loading specials from a savegame.
'ch' gives the character loaded from the savegame. Specials are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> special bit. S_LAST is used to mark unused savegame bits.
Definition at line 1058 of file savegame2.c.
Referenced by sg_load_map_tiles_specials().
|
static |
Complicated helper function for loading specials from a savegame.
'ch' gives the character loaded from the savegame. Specials are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> special bit. S_LAST is used to mark unused savegame bits.
Definition at line 921 of file savegame2.c.
Referenced by sg_load_player_vision().
|
static |
Load technology from path_name and if doesn't exist (because savegame is too old) load from path.
Definition at line 1354 of file savegame2.c.
Referenced by sg_load_researches().
For each city and tile, sort unit lists according to ord_city and ord_map values.
Definition at line 834 of file savegame2.c.
Referenced by sg_load_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 740 of file savegame2.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 788 of file savegame2.c.
Referenced by sg_load_player_city().
|
extern |
Definition at line 34 of file savecompat.c.
Referenced by savegame2_load().