57 log_error(
"Missing savefile options. Can not load the savegame.");
67 log_verbose(
"loading savefile in 2.3 - 2.6 format ...");
70 log_error(
"Too old savegame format not supported any more.");
127 stdata->save_compress_type)) {
145 char *
dot, *filename;
155 stdata->filepath[0] =
'\0';
156 filename =
stdata->filepath;
162 filename =
stdata->filepath;
166 for (
dot = filename;
'.' == *
dot;
dot++) {
175 ".sav",
".gz",
".bz2",
".xz",
".zst",
NULL };
194 if (filename[0] ==
'\0') {
197 sizeof(
stdata->filepath) +
stdata->filepath - filename,
"manual");
218 if (
stdata->save_compress_level > 0) {
219 switch (
stdata->save_compress_type) {
220#ifdef FREECIV_HAVE_LIBZ
226#ifdef FREECIV_HAVE_LIBLZMA
232#ifdef FREECIV_HAVE_LIBZSTD
241 log_error(
_(
"Unsupported compression type %d."),
242 stdata->save_compress_type);
244 _(
"Unsupported compression type %d."),
245 stdata->save_compress_type);
257 log_error(
_(
"Can't create saves directory %s!"),
261 _(
"Can't create saves directory!"));
275 log_error(
_(
"Can't create scenario saves directory %s!"),
279 _(
"Can't create scenario saves directory!"));
#define CALL_FUNC_EACH_AI(_func,...)
#define CALL_PLR_AI_FUNC(_func, _player,...)
bool has_capabilities(const char *us, const char *them)
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
void con_write(enum rfc_status rfc_status, const char *message,...)
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
int fc_thread_start(fc_thread *thread, void(*function)(void *arg), void *arg)
void fc_thread_wait(fc_thread *thread)
const struct ft_color ftc_warning
int generate_save_name(const char *format, char *buf, int buflen, const char *reason)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define log_debug(message,...)
#define log_error(message,...)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
#define players_iterate_end
#define players_iterate(_pplayer)
struct section_file * secfile_new(bool allow_duplicates)
const char * secfile_error(void)
void secfile_destroy(struct section_file *secfile)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
bool secfile_save(const struct section_file *secfile, const char *filename, int compression_level, enum fz_method compression_method)
void savegame2_load(struct section_file *file)
void savegame3_save(struct section_file *sfile, const char *save_reason, bool scenario)
void savegame3_load(struct section_file *file)
void savegame_load(struct section_file *sfile)
void savegame_save(struct section_file *sfile, const char *save_reason, bool scenario)
void save_system_close(void)
static void save_thread_run(void *arg)
static void save_thread_data_free(struct save_thread_data *stdata)
void save_game(const char *orig_filename, const char *save_reason, bool scenario)
static fc_thread * save_thread
bool make_dir(const char *pathname)
bool path_is_absolute(const char *filename)
struct server_arguments srvarg
char save_name[MAX_LEN_NAME]
enum fz_method save_compress_type
struct civ_game::@31::@35 server
enum fz_method save_compress_type
struct section_file * sfile
char * scenarios_pathname
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
void timer_destroy(struct timer *t)
void timer_start(struct timer *t)
void timer_stop(struct timer *t)
struct timer * timer_new(enum timer_timetype type, enum timer_use use, const char *name)
double timer_read_seconds(struct timer *t)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end