1
0
Fork 0

Codechange: rename AdminIndex to AdminID

pull/13427/head
Rubidium 2025-02-01 09:03:17 +01:00 committed by rubidium42
parent f3e32b2f6a
commit 50e581cd31
3 changed files with 7 additions and 9 deletions

View File

@ -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);
}

View File

@ -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<ServerNetworkAdminSocketHandler, AdminIndex, 2, MAX_ADMINS, PT_NADMIN> NetworkAdminSocketPool;
typedef Pool<ServerNetworkAdminSocketHandler, AdminID, 2, 16, PT_NADMIN> 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);

View File

@ -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 {