Exemple #1
0
void tmp_side_wait::start_game()
{
/*
	if (const config &stats = level_.child("statistics")) {
		statistics::fresh_stats();
		statistics::read_stats(stats);
	}
*/
	/**
	 * @todo Instead of using level_to_gamestate reinit the state_,
	 * this needs more testing -- Mordante
	 * It seems level_to_gamestate is needed for the start of game
	 * download, but downloads of later scenarios miss certain info
	 * and add a players section. Use players to decide between old
	 * and new way. (Of course it would be nice to unify the data
	 * stored.)
	 */
	if (!level_.child("player")) {
		level_to_gamestate(level_, replay_data_, state_);
	} else {

		state_ = game_state(level_, replay_data_);

		// When we observe and don't have the addon installed we still need
		// the old way, no clue why however. Code is a copy paste of
		// playcampaign.cpp:576 which shows an 'Unknown scenario: '$scenario|'
		// error. This seems to work and have no side effects....
		if(!state_.classification().scenario.empty() && state_.classification().scenario != "null") {
			// DBG_NW << "Falling back to loading the old way.\n";
			level_to_gamestate(level_, replay_data_, state_);
		}
	}

	// LOG_NW << "starting game\n";
}
void tmp_side_wait::start_game()
{
/*
	if (const config &stats = level_.child("statistics")) {
		statistics::fresh_stats();
		statistics::read_stats(stats);
	}
*/
	/**
	 * @todo Instead of using level_to_gamestate reinit the state_,
	 * this needs more testing -- Mordante
	 * It seems level_to_gamestate is needed for the start of game
	 * download, but downloads of later scenarios miss certain info
	 * and add a players section. Use players to decide between old
	 * and new way. (Of course it would be nice to unify the data
	 * stored.)
	 */
	state_.classification().mode = mode_tag::rfind(mode_tag::SCENARIO);
	level_to_gamestate(level_, replay_data_, state_);

	if (runtime_groups::gs.empty()) {
		// heros_ is generated automaticly, it is necessary to keep same at start.
		heros_start_ = heros_;
		users_2_groups(users_, member_users_);
	}
}