File diff r25385:ad6834a4b5cc → r25386:b146841c350c
src/network/core/game_info.cpp
Show inline comments
 
@@ -119,16 +119,16 @@ void CheckGameCompatibility(NetworkGameI
 
	for (const GRFConfig *c = ngi.grfconfig; c != nullptr; c = c->next) {
 
		if (c->status == GCS_NOT_FOUND) ngi.compatible = false;
 
	}
 
}
 

	
 
/**
 
 * Get the NetworkServerGameInfo structure with the latest information of the server.
 
 * @return The current NetworkServerGameInfo.
 
 * Fill a NetworkServerGameInfo structure with the static content, or things
 
 * that are so static they can be updated on request from a settings change.
 
 */
 
const NetworkServerGameInfo *GetCurrentNetworkServerGameInfo()
 
void FillStaticNetworkServerGameInfo()
 
{
 
	_network_game_info.use_password   = !StrEmpty(_settings_client.network.server_password);
 
	_network_game_info.start_date     = ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1);
 
	_network_game_info.clients_max    = _settings_client.network.max_clients;
 
	_network_game_info.companies_max  = _settings_client.network.max_companies;
 
	_network_game_info.spectators_max = _settings_client.network.max_spectators;
 
@@ -137,13 +137,20 @@ const NetworkServerGameInfo *GetCurrentN
 
	_network_game_info.landscape      = _settings_game.game_creation.landscape;
 
	_network_game_info.dedicated      = _network_dedicated;
 
	_network_game_info.grfconfig      = _grfconfig;
 

	
 
	strecpy(_network_game_info.server_name, _settings_client.network.server_name, lastof(_network_game_info.server_name));
 
	strecpy(_network_game_info.server_revision, GetNetworkRevisionString(), lastof(_network_game_info.server_revision));
 
}
 

	
 
/**
 
 * Get the NetworkServerGameInfo structure with the latest information of the server.
 
 * @return The current NetworkServerGameInfo.
 
 */
 
const NetworkServerGameInfo *GetCurrentNetworkServerGameInfo()
 
{
 
	/* Client_on is used as global variable to keep track on the number of clients. */
 
	_network_game_info.companies_on  = (byte)Company::GetNumItems();
 
	_network_game_info.spectators_on = NetworkSpectatorCount();
 
	_network_game_info.game_date     = _date;
 
	return &_network_game_info;
 
}