diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-26 20:02:27 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-04-27 20:18:53 +0200 |
commit | b3003dd163ab6b7902da33fa6cfaa29e45556db1 (patch) | |
tree | 545a4f7fbbacb9da797ed6948dd614424607851d /src/network/core/tcp_game.h | |
parent | 84c75a7b9a8aeb60506454260f9c98454ffb8ab5 (diff) | |
download | openttd-b3003dd163ab6b7902da33fa6cfaa29e45556db1.tar.xz |
Add: ability to retrieve game info from server over TCP
Diffstat (limited to 'src/network/core/tcp_game.h')
-rw-r--r-- | src/network/core/tcp_game.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 95b5f8c6c..6dcc0bd01 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -24,7 +24,7 @@ */ enum PacketGameType { /* - * These first three pair of packets (thus six in + * These first four pair of packets (thus eight in * total) must remain in this order for backward * and forward compatibility between clients that * are trying to join directly. @@ -42,6 +42,10 @@ enum PacketGameType { PACKET_CLIENT_COMPANY_INFO, ///< Request information about all companies. PACKET_SERVER_COMPANY_INFO, ///< Information about a single company. + /* Packets used to get the game info. */ + PACKET_CLIENT_GAME_INFO, ///< Request information about the server. + PACKET_SERVER_GAME_INFO, ///< Information about the server. + /* * Packets after here assume that the client * and server are running the same version. As @@ -184,6 +188,19 @@ protected: virtual NetworkRecvStatus Receive_SERVER_ERROR(Packet *p); /** + * Request game information. + * @param p The packet that was just received. + */ + virtual NetworkRecvStatus Receive_CLIENT_GAME_INFO(Packet *p); + + /** + * Sends information about the game. + * Serialized NetworkGameInfo. See game_info.h for details. + * @param p The packet that was just received. + */ + virtual NetworkRecvStatus Receive_SERVER_GAME_INFO(Packet *p); + + /** * Request company information (in detail). * @param p The packet that was just received. */ |