mirror of https://github.com/OpenTTD/OpenTTD
Codechange: strongly type AdminID
parent
6535fc1f80
commit
47721edb1d
|
@ -18,7 +18,7 @@ extern AdminID _redirect_console_to_admin;
|
||||||
|
|
||||||
class ServerNetworkAdminSocketHandler;
|
class ServerNetworkAdminSocketHandler;
|
||||||
/** Pool with all admin connections. */
|
/** 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;
|
extern NetworkAdminSocketPool _networkadminsocket_pool;
|
||||||
|
|
||||||
/** Class for handling the server side of the game connection. */
|
/** Class for handling the server side of the game connection. */
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#define NETWORK_TYPE_H
|
#define NETWORK_TYPE_H
|
||||||
|
|
||||||
#include "../core/enum_type.hpp"
|
#include "../core/enum_type.hpp"
|
||||||
|
#include "../core/pool_type.hpp"
|
||||||
|
|
||||||
/** How many clients can we have */
|
/** How many clients can we have */
|
||||||
static const uint MAX_CLIENTS = 255;
|
static const uint MAX_CLIENTS = 255;
|
||||||
|
@ -56,10 +57,10 @@ enum ClientID : uint32_t {
|
||||||
typedef uint8_t ClientPoolID;
|
typedef uint8_t ClientPoolID;
|
||||||
|
|
||||||
/** Indices into the admin tables. */
|
/** Indices into the admin tables. */
|
||||||
typedef uint8_t AdminID;
|
using AdminID = PoolID<uint8_t, struct AdminIDTag, 16, 0xFF>;
|
||||||
|
|
||||||
/** An invalid admin marker. */
|
/** 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 */
|
/** Simple calculated statistics of a company */
|
||||||
struct NetworkCompanyStats {
|
struct NetworkCompanyStats {
|
||||||
|
|
Loading…
Reference in New Issue