1
0
Fork 0

Codechange: strongly type AdminID

pull/13512/head
Rubidium 2025-02-01 08:58:13 +01:00 committed by rubidium42
parent 6535fc1f80
commit 47721edb1d
2 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,7 @@ extern AdminID _redirect_console_to_admin;
class ServerNetworkAdminSocketHandler;
/** Pool with all admin connections. */
using NetworkAdminSocketPool = Pool<ServerNetworkAdminSocketHandler, AdminID, 2, 16, PoolType::NetworkAdmin>;
using NetworkAdminSocketPool = Pool<ServerNetworkAdminSocketHandler, AdminID, 2, AdminID::End().base(), PoolType::NetworkAdmin>;
extern NetworkAdminSocketPool _networkadminsocket_pool;
/** Class for handling the server side of the game connection. */

View File

@ -11,6 +11,7 @@
#define NETWORK_TYPE_H
#include "../core/enum_type.hpp"
#include "../core/pool_type.hpp"
/** How many clients can we have */
static const uint MAX_CLIENTS = 255;
@ -56,10 +57,10 @@ enum ClientID : uint32_t {
typedef uint8_t ClientPoolID;
/** Indices into the admin tables. */
typedef uint8_t AdminID;
using AdminID = PoolID<uint8_t, struct AdminIDTag, 16, 0xFF>;
/** An invalid admin marker. */
static const AdminID INVALID_ADMIN_ID = UINT8_MAX;
static constexpr AdminID INVALID_ADMIN_ID = AdminID::Invalid();
/** Simple calculated statistics of a company */
struct NetworkCompanyStats {