Codechange: Use EnumBitSet for pool types

This commit is contained in:
Rubidium
2025-02-01 13:30:03 +01:00
committed by rubidium42
parent c4c5028862
commit 89d0a688a9
9 changed files with 20 additions and 19 deletions
+3 -1
View File
@@ -582,7 +582,9 @@ NetworkAddress ParseConnectionString(const std::string &connection_string, uint1
*/
static void InitializeNetworkPools(bool close_admins = true)
{
PoolBase::Clean(PT_NCLIENT | (close_admins ? PT_NADMIN : PT_NONE));
PoolTypes to_clean{PoolType::NetworkClient};
if (close_admins) to_clean.Set(PoolType::NetworkAdmin);
PoolBase::Clean(to_clean);
}
/**
+1 -1
View File
@@ -18,7 +18,7 @@ extern AdminID _redirect_console_to_admin;
class ServerNetworkAdminSocketHandler;
/** Pool with all admin connections. */
typedef Pool<ServerNetworkAdminSocketHandler, AdminID, 2, 16, PT_NADMIN> NetworkAdminSocketPool;
using NetworkAdminSocketPool = Pool<ServerNetworkAdminSocketHandler, AdminID, 2, 16, PoolType::NetworkAdmin>;
extern NetworkAdminSocketPool _networkadminsocket_pool;
/** Class for handling the server side of the game connection. */
+1 -1
View File
@@ -17,7 +17,7 @@
#include "../timer/timer_game_economy.h"
/** Type for the pool with client information. */
using NetworkClientInfoPool = Pool<NetworkClientInfo, ClientPoolID, 8, MAX_CLIENT_SLOTS, PT_NCLIENT>;
using NetworkClientInfoPool = Pool<NetworkClientInfo, ClientPoolID, 8, MAX_CLIENT_SLOTS, PoolType::NetworkClient>;
extern NetworkClientInfoPool _networkclientinfo_pool;
/** Container for all information known about a client. */
+1 -1
View File
@@ -17,7 +17,7 @@ class ServerNetworkGameSocketHandler;
/** Make the code look slightly nicer/simpler. */
typedef ServerNetworkGameSocketHandler NetworkClientSocket;
/** Pool with all client sockets. */
using NetworkClientSocketPool = Pool<NetworkClientSocket, ClientPoolID, 8, MAX_CLIENT_SLOTS, PT_NCLIENT>;
using NetworkClientSocketPool = Pool<NetworkClientSocket, ClientPoolID, 8, MAX_CLIENT_SLOTS, PoolType::NetworkClient>;
extern NetworkClientSocketPool _networkclientsocket_pool;
/** Class for handling the server side of the game connection. */