summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_coordinator.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-07-03 11:12:28 +0200
committerPatric Stout <github@truebrain.nl>2021-07-10 20:17:07 +0200
commitaa93d76223f0411b54f5150adbe2c83c33fd61af (patch)
tree481a29b60241d08b549b2477e836c3b186276c4d /src/network/core/tcp_coordinator.h
parentb1280fd17ebaf9e4df086b63074d0bd8b8c9155d (diff)
downloadopenttd-aa93d76223f0411b54f5150adbe2c83c33fd61af.tar.xz
Add: use Game Coordinator to get latest public server listing
Diffstat (limited to 'src/network/core/tcp_coordinator.h')
-rw-r--r--src/network/core/tcp_coordinator.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/network/core/tcp_coordinator.h b/src/network/core/tcp_coordinator.h
index a438f07aa..e95916816 100644
--- a/src/network/core/tcp_coordinator.h
+++ b/src/network/core/tcp_coordinator.h
@@ -29,6 +29,8 @@ enum PacketCoordinatorType {
PACKET_COORDINATOR_SERVER_REGISTER, ///< Server registration.
PACKET_COORDINATOR_GC_REGISTER_ACK, ///< Game Coordinator accepts the registration.
PACKET_COORDINATOR_SERVER_UPDATE, ///< Server sends an set intervals an update of the server.
+ PACKET_COORDINATOR_CLIENT_LISTING, ///< Client is requesting a listing of all public servers.
+ PACKET_COORDINATOR_GC_LISTING, ///< Game Coordinator returns a listing of all public servers.
PACKET_COORDINATOR_END, ///< Must ALWAYS be on the end of this list!! (period).
};
@@ -101,6 +103,33 @@ protected:
*/
virtual bool Receive_SERVER_UPDATE(Packet *p);
+ /**
+ * Client requests a list of all public servers.
+ *
+ * uint8 Game Coordinator protocol version.
+ * uint8 Game-info version used by this client.
+ * string Revision of the client.
+ *
+ * @param p The packet that was just received.
+ * @return True upon success, otherwise false.
+ */
+ virtual bool Receive_CLIENT_LISTING(Packet *p);
+
+ /**
+ * Game Coordinator replies with a list of all public servers. Multiple
+ * of these packets are received after a request till all servers are
+ * sent over. Last packet will have server count of 0.
+ *
+ * uint16 Amount of public servers in this packet.
+ * For each server:
+ * string Connection string for this server.
+ * Serialized NetworkGameInfo. See game_info.hpp for details.
+ *
+ * @param p The packet that was just received.
+ * @return True upon success, otherwise false.
+ */
+ virtual bool Receive_GC_LISTING(Packet *p);
+
bool HandlePacket(Packet *p);
public:
/**