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)) {
131 _(
"Failed saving game."));
146 char *
dot, *filename;
156 stdata->filepath[0] =
'\0';
157 filename =
stdata->filepath;
163 filename =
stdata->filepath;
167 for (
dot = filename;
'.' == *
dot;
dot++) {
176 ".sav",
".gz",
".bz2",
".xz",
".zst",
nullptr };
195 if (filename[0] ==
'\0') {
198 sizeof(
stdata->filepath) +
stdata->filepath - filename,
"manual");
219 if (
stdata->save_compress_level > 0) {
220 switch (
stdata->save_compress_type) {
221#ifdef FREECIV_HAVE_LIBZ
227#ifdef FREECIV_HAVE_LIBLZMA
233#ifdef FREECIV_HAVE_LIBZSTD
242 log_error(
_(
"Unsupported compression type %d."),
243 stdata->save_compress_type);
245 _(
"Unsupported compression type %d."),
246 stdata->save_compress_type);
258 log_error(
_(
"Can't create saves directory %s!"),
262 _(
"Can't create saves directory!"));
276 log_error(
_(
"Can't create scenario saves directory %s!"),
280 _(
"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
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 int const struct action *paction struct unit struct city * pcity
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, int mode)
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::@32::@36 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