OpenTTD Source  1.11.2
game_info.h File Reference
#include "config.h"
#include "core.h"
#include "../../newgrf_config.h"
#include "../../date_type.h"

Go to the source code of this file.

Data Structures

struct  NetworkServerGameInfo
 The game information that is not generated on-the-fly and has to be sent to the clients. More...
 
struct  NetworkGameInfo
 The game information that is sent from the server to the clients. More...
 

Functions

const char * GetNetworkRevisionString ()
 Get the network version string used by this build. More...
 
bool IsNetworkCompatibleVersion (const char *other)
 Checks whether the given version string is compatible with our version. More...
 
void FillNetworkGameInfo (NetworkGameInfo &ngi)
 Fill a NetworkGameInfo structure with the latest information of the server. More...
 
void DeserializeGRFIdentifier (Packet *p, GRFIdentifier *grf)
 Deserializes the GRFIdentifier (GRF ID and MD5 checksum) from the packet. More...
 
void SerializeGRFIdentifier (Packet *p, const GRFIdentifier *grf)
 Serializes the GRFIdentifier (GRF ID and MD5 checksum) to the packet. More...
 
void DeserializeNetworkGameInfo (Packet *p, NetworkGameInfo *info)
 Deserializes the NetworkGameInfo struct from the packet. More...
 
void SerializeNetworkGameInfo (Packet *p, const NetworkGameInfo *info)
 Serializes the NetworkGameInfo struct to the packet. More...
 

Variables

NetworkServerGameInfo _network_game_info
 Information about our game.
 

Detailed Description

Convert NetworkGameInfo to Packet and back.

Definition in file game_info.h.

Function Documentation

◆ DeserializeGRFIdentifier()

void DeserializeGRFIdentifier ( Packet p,
GRFIdentifier grf 
)

◆ DeserializeNetworkGameInfo()

◆ FillNetworkGameInfo()

◆ GetNetworkRevisionString()

const char* GetNetworkRevisionString ( )

Get the network version string used by this build.

The returned string is guaranteed to be at most NETWORK_REVISON_LENGTH bytes.

Definition at line 41 of file game_info.cpp.

References stredup().

Referenced by IsNetworkCompatibleVersion(), NetworkHTTPSocketHandler::NetworkHTTPSocketHandler(), and ServerNetworkAdminSocketHandler::SendWelcome().

◆ IsNetworkCompatibleVersion()

bool IsNetworkCompatibleVersion ( const char *  other)

Checks whether the given version string is compatible with our version.

First tries to match the full string, if that fails, attempts to compare just git hashes.

Parameters
otherthe version string to compare to

Definition at line 95 of file game_info.cpp.

References GetNetworkRevisionString(), and NETWORK_REVISION_LENGTH.

Referenced by ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE().

◆ SerializeGRFIdentifier()

void SerializeGRFIdentifier ( Packet p,
const GRFIdentifier grf 
)

◆ SerializeNetworkGameInfo()