Changeset - r28688:fc936ee56030
[Not reviewed]
master
0 8 0
Rubidium - 10 months ago 2024-02-04 11:31:56
rubidium@openttd.org
Codechange: define the size of the PacketType enumerations
8 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/network/core/config.h
Show inline comments
 
@@ -25,7 +25,7 @@ static const uint16_t NETWORK_CONTENT_SE
 
static const uint16_t NETWORK_DEFAULT_PORT            = 3979;           ///< The default port of the game server (TCP & UDP)
 
static const uint16_t NETWORK_ADMIN_PORT              = 3977;           ///< The default port for admin network
 

	
 
static const size_t UDP_MTU                         = 1460;           ///< Number of bytes we can pack in a single UDP packet
 
static const size_t UDP_MTU = 1460; ///< Number of bytes we can pack in a single UDP packet
 

	
 
static const std::string NETWORK_SURVEY_DETAILS_LINK = "https://survey.openttd.org/participate"; ///< Link with more details & privacy statement of the survey.
 
/*
 
@@ -42,8 +42,8 @@ static const std::string NETWORK_SURVEY_
 
 * Send_uint16(GB(size, 16, 14) | 0b10 << 14)
 
 * Send_uint16(GB(size,  0, 16))
 
 */
 
static const size_t TCP_MTU                         = 32767;          ///< Number of bytes we can pack in a single TCP packet
 
static const size_t COMPAT_MTU                      = 1460;           ///< Number of bytes we can pack in a single packet for backward compatibility
 
static const size_t TCP_MTU = 32767; ///< Number of bytes we can pack in a single TCP packet
 
static const size_t COMPAT_MTU = 1460; ///< Number of bytes we can pack in a single packet for backward compatibility
 

	
 
static const byte NETWORK_GAME_ADMIN_VERSION        =    3;           ///< What version of the admin network do we use?
 
static const byte NETWORK_GAME_INFO_VERSION         =    7;           ///< What version of game-info do we use?
src/network/core/tcp_admin.h
Show inline comments
 
@@ -21,7 +21,7 @@
 
 * Enum with types of TCP packets specific to the admin network.
 
 * This protocol may only be extended to ensure stability.
 
 */
 
enum PacketAdminType {
 
enum PacketAdminType : uint8_t {
 
	ADMIN_PACKET_ADMIN_JOIN,             ///< The admin announces and authenticates itself to the server.
 
	ADMIN_PACKET_ADMIN_QUIT,             ///< The admin tells the server that it is quitting.
 
	ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY, ///< The admin tells the server the update frequency of a particular piece of information.
src/network/core/tcp_content_type.h
Show inline comments
 
@@ -32,7 +32,7 @@ enum ContentType {
 
};
 

	
 
/** Enum with all types of TCP content packets. The order MUST not be changed **/
 
enum PacketContentType {
 
enum PacketContentType : uint8_t {
 
	PACKET_CONTENT_CLIENT_INFO_LIST,      ///< Queries the content server for a list of info of a given content type
 
	PACKET_CONTENT_CLIENT_INFO_ID,        ///< Queries the content server for information about a list of internal IDs
 
	PACKET_CONTENT_CLIENT_INFO_EXTID,     ///< Queries the content server for information about a list of external IDs
src/network/core/tcp_coordinator.h
Show inline comments
 
@@ -25,7 +25,7 @@
 
 * CLIENT -> packets from Client to Game Coordinator.
 
 * SERCLI -> packets from either the Server or Client to Game Coordinator.
 
 **/
 
enum PacketCoordinatorType {
 
enum PacketCoordinatorType : uint8_t {
 
	PACKET_COORDINATOR_GC_ERROR,              ///< Game Coordinator indicates there was an error.
 
	PACKET_COORDINATOR_SERVER_REGISTER,       ///< Server registration.
 
	PACKET_COORDINATOR_GC_REGISTER_ACK,       ///< Game Coordinator accepts the registration.
src/network/core/tcp_game.h
Show inline comments
 
@@ -22,7 +22,7 @@
 
 * Enum with all types of TCP packets.
 
 * For the exact meaning, look at #NetworkGameSocketHandler.
 
 */
 
enum PacketGameType {
 
enum PacketGameType : uint8_t {
 
	/*
 
	 * These first four pair of packets (thus eight in
 
	 * total) must remain in this order for backward
src/network/core/tcp_stun.h
Show inline comments
 
@@ -17,7 +17,7 @@
 
#include "packet.h"
 

	
 
/** Enum with all types of TCP STUN packets. The order MUST not be changed. **/
 
enum PacketStunType {
 
enum PacketStunType : uint8_t {
 
	PACKET_STUN_SERCLI_STUN,  ///< Send a STUN request to the STUN server.
 
	PACKET_STUN_END,          ///< Must ALWAYS be on the end of this list!! (period)
 
};
src/network/core/tcp_turn.h
Show inline comments
 
@@ -18,7 +18,7 @@
 
#include "network_game_info.h"
 

	
 
/** Enum with all types of TCP TURN packets. The order MUST not be changed. **/
 
enum PacketTurnType {
 
enum PacketTurnType : uint8_t {
 
	PACKET_TURN_TURN_ERROR,     ///< TURN server is unable to relay.
 
	PACKET_TURN_SERCLI_CONNECT, ///< Client or server is connecting to the TURN server.
 
	PACKET_TURN_TURN_CONNECTED, ///< TURN server indicates the socket is now being relayed.
src/network/core/udp.h
Show inline comments
 
@@ -16,7 +16,7 @@
 
#include "packet.h"
 

	
 
/** Enum with all types of UDP packets. The order MUST not be changed **/
 
enum PacketUDPType {
 
enum PacketUDPType : uint8_t {
 
	PACKET_UDP_CLIENT_FIND_SERVER,   ///< Queries a game server for game information
 
	PACKET_UDP_SERVER_RESPONSE,      ///< Reply of the game server with game information
 
	PACKET_UDP_END,                  ///< Must ALWAYS be on the end of this list!! (period)
0 comments (0 inline, 0 general)