diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index f1c6598956..4f61828f61 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -29,7 +29,7 @@ /* This file handles all the admin network commands. */ /** Redirection of the (remote) console to the admin. */ -AdminIndex _redirect_console_to_admin = INVALID_ADMIN_ID; +AdminID _redirect_console_to_admin = INVALID_ADMIN_ID; /** The pool with sockets/clients. */ NetworkAdminSocketPool _networkadminsocket_pool("NetworkAdminSocket"); @@ -1000,7 +1000,7 @@ void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_i * @param colour_code The colour of the string. * @param string The string to show. */ -void NetworkServerSendAdminRcon(AdminIndex admin_index, TextColour colour_code, const std::string_view string) +void NetworkServerSendAdminRcon(AdminID admin_index, TextColour colour_code, const std::string_view string) { ServerNetworkAdminSocketHandler::Get(admin_index)->SendRcon(colour_code, string); } diff --git a/src/network/network_admin.h b/src/network/network_admin.h index 4984ea6847..39279edfac 100644 --- a/src/network/network_admin.h +++ b/src/network/network_admin.h @@ -14,11 +14,11 @@ #include "core/tcp_listen.h" #include "core/tcp_admin.h" -extern AdminIndex _redirect_console_to_admin; +extern AdminID _redirect_console_to_admin; class ServerNetworkAdminSocketHandler; /** Pool with all admin connections. */ -typedef Pool NetworkAdminSocketPool; +typedef Pool NetworkAdminSocketPool; extern NetworkAdminSocketPool _networkadminsocket_pool; /** Class for handling the server side of the game connection. */ @@ -115,7 +115,7 @@ void NetworkAdminCompanyRemove(CompanyID company_id, AdminCompanyRemoveReason bc void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_id, const std::string &msg, int64_t data = 0, bool from_admin = false); void NetworkAdminUpdate(AdminUpdateFrequency freq); -void NetworkServerSendAdminRcon(AdminIndex admin_index, TextColour colour_code, const std::string_view string); +void NetworkServerSendAdminRcon(AdminID admin_index, TextColour colour_code, const std::string_view string); void NetworkAdminConsole(const std::string_view origin, const std::string_view string); void NetworkAdminGameScript(const std::string_view json); void NetworkAdminCmdLogging(const NetworkClientSocket *owner, const CommandPacket &cp); diff --git a/src/network/network_type.h b/src/network/network_type.h index 34375445d7..eca76a73a5 100644 --- a/src/network/network_type.h +++ b/src/network/network_type.h @@ -56,12 +56,10 @@ enum ClientID : uint32_t { typedef uint8_t ClientIndex; /** Indices into the admin tables. */ -typedef uint8_t AdminIndex; +typedef uint8_t AdminID; -/** Maximum number of allowed admins. */ -static const AdminIndex MAX_ADMINS = 16; /** An invalid admin marker. */ -static const AdminIndex INVALID_ADMIN_ID = UINT8_MAX; +static const AdminID INVALID_ADMIN_ID = UINT8_MAX; /** Simple calculated statistics of a company */ struct NetworkCompanyStats {