Exemplo n.º 1
0
void savegame::finish_save_game(const config_writer &out)
{
	try {
		if(!out.good()) {
			throw game::save_game_failed(_("Could not write to file"));
		}
		save_index_manager.remove(gamestate_.classification().label);
	} catch(filesystem::io_exception& e) {
		throw game::save_game_failed(e.what());
	}
}
Exemplo n.º 2
0
void savegame::finish_save_game(const config_writer &out)
{
	std::string name = gamestate_.classification().label;
	replace_space2underbar(name);
	std::string fname(get_saves_dir() + "/" + name);

	try {
		if(!out.good()) {
			throw game::save_game_failed(_("Could not write to file"));
		}

		config& summary = save_index::save_summary(gamestate_.classification().label);
		extract_summary_data_from_save(summary);
		const int mod_time = static_cast<int>(file_create_time(fname));
		summary["mod_time"] = str_cast(mod_time);
		save_index::write_save_index();
	} catch(io_exception& e) {
		throw game::save_game_failed(e.what());
	}
}