1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Codechange: strongly type ClientPoolID

Also remove some of the artifical documented limits as they are not true; the
ClientPoolID was not sent over the network, so its size isn't of concern.
This commit is contained in:
Rubidium
2025-02-01 09:46:29 +01:00
committed by rubidium42
parent 47721edb1d
commit d55b9cff9d
4 changed files with 5 additions and 14 deletions

View File

@@ -47,9 +47,7 @@ DECLARE_INCREMENT_DECREMENT_OPERATORS(ClientID)
static ClientID _network_client_id = CLIENT_ID_FIRST;
/** Make very sure the preconditions given in network_type.h are actually followed */
static_assert(MAX_CLIENT_SLOTS > MAX_CLIENTS);
/** Yes... */
static_assert(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENT_SLOTS);
static_assert(NetworkClientSocketPool::MAX_SIZE > MAX_CLIENTS);
/** The pool with clients. */
NetworkClientSocketPool _networkclientsocket_pool("NetworkClientSocket");
@@ -920,7 +918,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_IDENTIFY(Packet
ci->client_name = client_name;
ci->client_playas = playas;
ci->public_key = this->peer_public_key;
Debug(desync, 1, "client: {:08x}; {:02x}; {:02x}; {:02x}", TimerGameEconomy::date, TimerGameEconomy::date_fract, (int)ci->client_playas, (int)ci->index);
Debug(desync, 1, "client: {:08x}; {:02x}; {:02x}; {:02x}", TimerGameEconomy::date, TimerGameEconomy::date_fract, (int)ci->client_playas, ci->index);
/* Make sure companies to which people try to join are not autocleaned */
Company *c = Company::GetIfValid(playas);