Changeset - r25387:bf3342b9f35a
[Not reviewed]
master
0 2 0
Rubidium - 3 years ago 2021-05-05 18:38:18
rubidium@openttd.org
Cleanup: [Network] Remove variable from NetworkGameInfo that is only used during deserialisation
2 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/network/core/game_info.cpp
Show inline comments
 
@@ -252,7 +252,7 @@ void DeserializeNetworkGameInfo(Packet *
 
{
 
	static const Date MAX_DATE = ConvertYMDToDate(MAX_YEAR, 11, 31); // December is month 11
 

	
 
	info->game_info_version = p->Recv_uint8();
 
	byte game_info_version = p->Recv_uint8();
 

	
 
	/*
 
	 *              Please observe the order.
 
@@ -262,7 +262,7 @@ void DeserializeNetworkGameInfo(Packet *
 
	/* Update the documentation in game_info.h on changes
 
	 * to the NetworkGameInfo wire-protocol! */
 

	
 
	switch (info->game_info_version) {
 
	switch (game_info_version) {
 
		case 4: {
 
			GRFConfig **dst = &info->grfconfig;
 
			uint i;
 
@@ -302,7 +302,7 @@ void DeserializeNetworkGameInfo(Packet *
 
			info->clients_max    = p->Recv_uint8 ();
 
			info->clients_on     = p->Recv_uint8 ();
 
			info->spectators_on  = p->Recv_uint8 ();
 
			if (info->game_info_version < 3) { // 16 bits dates got scrapped and are read earlier
 
			if (game_info_version < 3) { // 16 bits dates got scrapped and are read earlier
 
				info->game_date    = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR;
 
				info->start_date   = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR;
 
			}
src/network/core/game_info.h
Show inline comments
 
@@ -85,7 +85,6 @@ struct NetworkServerGameInfo {
 
struct NetworkGameInfo : NetworkServerGameInfo {
 
	bool version_compatible;                        ///< Can we connect to this server or not? (based on server_revision)
 
	bool compatible;                                ///< Can we connect to this server or not? (based on server_revision _and_ grf_match
 
	byte game_info_version;                         ///< Version of the game info
 
};
 

	
 
extern NetworkServerGameInfo _network_game_info;
0 comments (0 inline, 0 general)