mirror of https://github.com/OpenTTD/OpenTTD
Codechange: rename AdminIndex to AdminID
parent
f3e32b2f6a
commit
50e581cd31
|
@ -29,7 +29,7 @@
|
||||||
/* This file handles all the admin network commands. */
|
/* This file handles all the admin network commands. */
|
||||||
|
|
||||||
/** Redirection of the (remote) console to the admin. */
|
/** 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. */
|
/** The pool with sockets/clients. */
|
||||||
NetworkAdminSocketPool _networkadminsocket_pool("NetworkAdminSocket");
|
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 colour_code The colour of the string.
|
||||||
* @param string The string to show.
|
* @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);
|
ServerNetworkAdminSocketHandler::Get(admin_index)->SendRcon(colour_code, string);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
#include "core/tcp_listen.h"
|
#include "core/tcp_listen.h"
|
||||||
#include "core/tcp_admin.h"
|
#include "core/tcp_admin.h"
|
||||||
|
|
||||||
extern AdminIndex _redirect_console_to_admin;
|
extern AdminID _redirect_console_to_admin;
|
||||||
|
|
||||||
class ServerNetworkAdminSocketHandler;
|
class ServerNetworkAdminSocketHandler;
|
||||||
/** Pool with all admin connections. */
|
/** 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;
|
extern NetworkAdminSocketPool _networkadminsocket_pool;
|
||||||
|
|
||||||
/** Class for handling the server side of the game connection. */
|
/** 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 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 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 NetworkAdminConsole(const std::string_view origin, const std::string_view string);
|
||||||
void NetworkAdminGameScript(const std::string_view json);
|
void NetworkAdminGameScript(const std::string_view json);
|
||||||
void NetworkAdminCmdLogging(const NetworkClientSocket *owner, const CommandPacket &cp);
|
void NetworkAdminCmdLogging(const NetworkClientSocket *owner, const CommandPacket &cp);
|
||||||
|
|
|
@ -56,12 +56,10 @@ enum ClientID : uint32_t {
|
||||||
typedef uint8_t ClientIndex;
|
typedef uint8_t ClientIndex;
|
||||||
|
|
||||||
/** Indices into the admin tables. */
|
/** 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. */
|
/** 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 */
|
/** Simple calculated statistics of a company */
|
||||||
struct NetworkCompanyStats {
|
struct NetworkCompanyStats {
|
||||||
|
|
Loading…
Reference in New Issue