OpenTTD Source  1.11.2
ServerNetworkAdminSocketHandler Class Reference

Class for handling the server side of the game connection. More...

#include <network_admin.h>

Inheritance diagram for ServerNetworkAdminSocketHandler:
Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_networkadminsocket_pool > NetworkAdminSocketHandler TCPListenHandler< ServerNetworkAdminSocketHandler, ADMIN_PACKET_SERVER_FULL, ADMIN_PACKET_SERVER_BANNED > NetworkTCPSocketHandler NetworkSocketHandler

Data Structures

struct  ServerNetworkAdminSocketHandlerFilter
 

Public Member Functions

 ServerNetworkAdminSocketHandler (SOCKET s)
 Sanity check. More...
 
 ~ServerNetworkAdminSocketHandler ()
 Clear everything related to this admin.
 
NetworkRecvStatus SendError (NetworkErrorCode error)
 Send an error to the admin. More...
 
NetworkRecvStatus SendWelcome ()
 Send a welcome message to the admin.
 
NetworkRecvStatus SendNewGame ()
 Tell the admin we started a new game.
 
NetworkRecvStatus SendShutdown ()
 Tell the admin we're shutting down.
 
NetworkRecvStatus SendDate ()
 Tell the admin the date.
 
NetworkRecvStatus SendClientJoin (ClientID client_id)
 Tell the admin that a client joined. More...
 
NetworkRecvStatus SendClientInfo (const NetworkClientSocket *cs, const NetworkClientInfo *ci)
 Send an initial set of data from some client's information. More...
 
NetworkRecvStatus SendClientUpdate (const NetworkClientInfo *ci)
 Send an update for some client's information. More...
 
NetworkRecvStatus SendClientQuit (ClientID client_id)
 Tell the admin that a client quit. More...
 
NetworkRecvStatus SendClientError (ClientID client_id, NetworkErrorCode error)
 Tell the admin that a client made an error. More...
 
NetworkRecvStatus SendCompanyNew (CompanyID company_id)
 Tell the admin that a new company was founded. More...
 
NetworkRecvStatus SendCompanyInfo (const Company *c)
 Send the admin some information about a company. More...
 
NetworkRecvStatus SendCompanyUpdate (const Company *c)
 Send an update about a company. More...
 
NetworkRecvStatus SendCompanyRemove (CompanyID company_id, AdminCompanyRemoveReason bcrr)
 Tell the admin that a company got removed. More...
 
NetworkRecvStatus SendCompanyEconomy ()
 Send economic information of all companies.
 
NetworkRecvStatus SendCompanyStats ()
 Send statistics about the companies.
 
NetworkRecvStatus SendChat (NetworkAction action, DestType desttype, ClientID client_id, const char *msg, int64 data)
 Send a chat message. More...
 
NetworkRecvStatus SendRcon (uint16 colour, const char *command)
 Send the reply of an rcon command. More...
 
NetworkRecvStatus SendConsole (const char *origin, const char *command)
 Send console output of other clients. More...
 
NetworkRecvStatus SendGameScript (const char *json)
 Send GameScript JSON output. More...
 
NetworkRecvStatus SendCmdNames ()
 Send the names of the commands.
 
NetworkRecvStatus SendCmdLogging (ClientID client_id, const CommandPacket *cp)
 Send a command for logging purposes. More...
 
NetworkRecvStatus SendRconEnd (const char *command)
 Send a notification indicating the rcon command has completed. More...
 
- Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_networkadminsocket_pool >
void * operator new (size_t size)
 Allocates space for new Titem. More...
 
void * operator new (size_t size, size_t index)
 Allocates space for new Titem with given index. More...
 
void * operator new (size_t size, void *ptr)
 Allocates space for new Titem at given memory address. More...
 
void operator delete (void *p)
 Marks Titem as free. More...
 
- Public Member Functions inherited from NetworkAdminSocketHandler
NetworkRecvStatus CloseConnection (bool error=true) override
 Close the current connection; for TCP this will be mostly equivalent to Close(), but for UDP it just means the packet has to be dropped. More...
 
 NetworkAdminSocketHandler (SOCKET s)
 Create the admin handler for the given socket. More...
 
NetworkRecvStatus ReceivePackets ()
 Do the actual receiving of packets. More...
 
AdminStatus GetAdminStatus () const
 Get the status of the admin. More...
 
- Public Member Functions inherited from NetworkTCPSocketHandler
bool IsConnected () const
 Whether this socket is currently bound to a socket. More...
 
virtual void SendPacket (Packet *packet)
 This function puts the packet in the send-queue and it is send as soon as possible. More...
 
SendPacketsState SendPackets (bool closing_down=false)
 Sends all the buffered packets out for this client. More...
 
virtual PacketReceivePacket ()
 Receives a packet for the given client. More...
 
bool CanSendReceive ()
 Check whether this socket can send or receive something. More...
 
bool HasSendQueue ()
 Whether there is something pending in the send queue. More...
 
 NetworkTCPSocketHandler (SOCKET s=INVALID_SOCKET)
 Construct a socket handler for a TCP connection. More...
 
- Public Member Functions inherited from NetworkSocketHandler
 NetworkSocketHandler ()
 Create a new unbound socket.
 
virtual ~NetworkSocketHandler ()
 Close the socket when destructing the socket handler.
 
virtual void Close ()
 Really close the socket.
 
bool HasClientQuit () const
 Whether the current client connected to the socket has quit. More...
 
void Reopen ()
 Reopen the socket so we can send/receive stuff again.
 
void SendCompanyInformation (Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats, uint max_len=NETWORK_COMPANY_NAME_LENGTH)
 Package some generic company information into a packet. More...
 

Static Public Member Functions

static void Send ()
 Send the packets for the server sockets.
 
static void AcceptConnection (SOCKET s, const NetworkAddress &address)
 Handle the acception of a connection. More...
 
static bool AllowConnection ()
 Whether a connection is allowed or not at this moment. More...
 
static void WelcomeAll ()
 Send a Welcome packet to all connected admins.
 
static const char * GetName ()
 Get the name used by the listener. More...
 
static Pool::IterateWrapperFiltered< ServerNetworkAdminSocketHandler, ServerNetworkAdminSocketHandlerFilterIterateActive (size_t from=0)
 Returns an iterable ensemble of all active admin sockets. More...
 
- Static Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_networkadminsocket_pool >
static bool CanAllocateItem (size_t n=1)
 Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() More...
 
static bool CleaningPool ()
 Returns current state of pool cleaning - yes or no. More...
 
static bool IsValidID (size_t index)
 Tests whether given index can be used to get valid (non-nullptr) Titem. More...
 
static Titem * Get (size_t index)
 Returns Titem with given index. More...
 
static Titem * GetIfValid (size_t index)
 Returns Titem with given index. More...
 
static size_t GetPoolSize ()
 Returns first unused index. More...
 
static size_t GetNumItems ()
 Returns number of valid items in the pool. More...
 
static void PostDestructor (size_t index)
 Dummy function called after destructor of each member. More...
 
static Pool::IterateWrapper< Titem > Iterate (size_t from=0)
 Returns an iterable ensemble of all valid Titem. More...
 
- Static Public Member Functions inherited from TCPListenHandler< ServerNetworkAdminSocketHandler, ADMIN_PACKET_SERVER_FULL, ADMIN_PACKET_SERVER_BANNED >
static void AcceptClient (SOCKET ls)
 Accepts clients from the sockets. More...
 
static bool Receive ()
 Handle the receiving of packets. More...
 
static bool Listen (uint16 port)
 Listen on a particular port. More...
 
static void CloseListeners ()
 Close the sockets we're listening on.
 

Data Fields

AdminUpdateFrequency update_frequency [ADMIN_UPDATE_END]
 Admin requested update intervals.
 
std::chrono::steady_clock::time_point connect_time
 Time of connection.
 
NetworkAddress address
 Address of the admin.
 
- Data Fields inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_networkadminsocket_pool >
Tindex index
 Index of this pool item.
 
- Data Fields inherited from NetworkTCPSocketHandler
SOCKET sock
 The socket currently connected to.
 
bool writable
 Can we write to this socket?
 

Protected Member Functions

NetworkRecvStatus Receive_ADMIN_JOIN (Packet *p) override
 Join the admin network: string Password the server is expecting for this network. More...
 
NetworkRecvStatus Receive_ADMIN_QUIT (Packet *p) override
 Notification to the server that this admin is quitting. More...
 
NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY (Packet *p) override
 Register updates to be sent at certain frequencies (as announced in the PROTOCOL packet): uint16 Update type (see AdminUpdateType). More...
 
NetworkRecvStatus Receive_ADMIN_POLL (Packet *p) override
 Poll the server for certain updates, an invalid poll (e.g. More...
 
NetworkRecvStatus Receive_ADMIN_CHAT (Packet *p) override
 Send chat as the server: uint8 Action such as NETWORK_ACTION_CHAT_CLIENT (see NetworkAction). More...
 
NetworkRecvStatus Receive_ADMIN_RCON (Packet *p) override
 Execute a command on the servers console: string Command to be executed. More...
 
NetworkRecvStatus Receive_ADMIN_GAMESCRIPT (Packet *p) override
 Send a JSON string to the current active GameScript. More...
 
NetworkRecvStatus Receive_ADMIN_PING (Packet *p) override
 Ping the server, requiring the server to reply with a pong packet. More...
 
NetworkRecvStatus SendProtocol ()
 Send the protocol version to the admin.
 
NetworkRecvStatus SendPong (uint32 d1)
 Send ping-reply (pong) to admin.
 
- Protected Member Functions inherited from NetworkAdminSocketHandler
NetworkRecvStatus ReceiveInvalidPacket (PacketAdminType type)
 Helper for logging receiving invalid packets. More...
 
virtual NetworkRecvStatus Receive_SERVER_FULL (Packet *p)
 The server is full (connection gets closed). More...
 
virtual NetworkRecvStatus Receive_SERVER_BANNED (Packet *p)
 The source IP address is banned (connection gets closed). More...
 
virtual NetworkRecvStatus Receive_SERVER_ERROR (Packet *p)
 An error was caused by this admin connection (connection gets closed). More...
 
virtual NetworkRecvStatus Receive_SERVER_PROTOCOL (Packet *p)
 Inform a just joined admin about the protocol specifics: uint8 Protocol version. More...
 
virtual NetworkRecvStatus Receive_SERVER_WELCOME (Packet *p)
 Welcome a connected admin to the game: string Name of the Server (e.g. More...
 
virtual NetworkRecvStatus Receive_SERVER_NEWGAME (Packet *p)
 Notification about a newgame. More...
 
virtual NetworkRecvStatus Receive_SERVER_SHUTDOWN (Packet *p)
 Notification about the server shutting down. More...
 
virtual NetworkRecvStatus Receive_SERVER_DATE (Packet *p)
 Send the current date of the game: uint32 Current game date. More...
 
virtual NetworkRecvStatus Receive_SERVER_CLIENT_JOIN (Packet *p)
 Notification of a new client: uint32 ID of the new client. More...
 
virtual NetworkRecvStatus Receive_SERVER_CLIENT_INFO (Packet *p)
 Client information of a specific client: uint32 ID of the client. More...
 
virtual NetworkRecvStatus Receive_SERVER_CLIENT_UPDATE (Packet *p)
 Client update details on a specific client (e.g. More...
 
virtual NetworkRecvStatus Receive_SERVER_CLIENT_QUIT (Packet *p)
 Notification about a client leaving the game. More...
 
virtual NetworkRecvStatus Receive_SERVER_CLIENT_ERROR (Packet *p)
 Notification about a client error (and thus the clients disconnection). More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_NEW (Packet *p)
 Notification of a new company: uint8 ID of the new company. More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_INFO (Packet *p)
 Company information on a specific company: uint8 ID of the company. More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE (Packet *p)
 Company information of a specific company: uint8 ID of the company. More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_REMOVE (Packet *p)
 Notification about a removed company (e.g. More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_ECONOMY (Packet *p)
 Economy update of a specific company: uint8 ID of the company. More...
 
virtual NetworkRecvStatus Receive_SERVER_COMPANY_STATS (Packet *p)
 Company statistics on stations and vehicles: uint8 ID of the company. More...
 
virtual NetworkRecvStatus Receive_SERVER_CHAT (Packet *p)
 Send chat from the game into the admin network: uint8 Action such as NETWORK_ACTION_CHAT_CLIENT (see NetworkAction). More...
 
virtual NetworkRecvStatus Receive_SERVER_RCON (Packet *p)
 Result of an rcon command: uint16 Colour as it would be used on the server or a client. More...
 
virtual NetworkRecvStatus Receive_SERVER_CONSOLE (Packet *p)
 Send what would be printed on the server's console also into the admin network. More...
 
virtual NetworkRecvStatus Receive_SERVER_CMD_NAMES (Packet *p)
 Send DoCommand names to the bot upon request only. More...
 
virtual NetworkRecvStatus Receive_SERVER_CMD_LOGGING (Packet *p)
 Send incoming command packets to the admin network. More...
 
virtual NetworkRecvStatus Receive_SERVER_PONG (Packet *p)
 Send a ping-reply (pong) to the admin that sent us the ping packet. More...
 
virtual NetworkRecvStatus Receive_SERVER_RCON_END (Packet *p)
 Notify the admin connection that the rcon command has finished. More...
 
NetworkRecvStatus HandlePacket (Packet *p)
 Handle the given packet, i.e. More...
 

Additional Inherited Members

- Public Types inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_networkadminsocket_pool >
typedef struct Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero > Pool
 Type of the pool this item is going to be part of.
 
- Protected Attributes inherited from NetworkAdminSocketHandler
char admin_name [NETWORK_CLIENT_NAME_LENGTH]
 Name of the admin.
 
char admin_version [NETWORK_REVISION_LENGTH]
 Version string of the admin.
 
AdminStatus status
 Status of this admin.
 

Detailed Description

Class for handling the server side of the game connection.

Definition at line 25 of file network_admin.h.

Constructor & Destructor Documentation

◆ ServerNetworkAdminSocketHandler()

ServerNetworkAdminSocketHandler::ServerNetworkAdminSocketHandler ( SOCKET  s)

Sanity check.

Create a new socket for the server side of the admin network.

Parameters
sThe socket to connect with.

Definition at line 64 of file network_admin.cpp.

References _network_admins_connected, ADMIN_STATUS_INACTIVE, connect_time, and NetworkAdminSocketHandler::status.

Referenced by AcceptConnection().

Member Function Documentation

◆ AcceptConnection()

void ServerNetworkAdminSocketHandler::AcceptConnection ( SOCKET  s,
const NetworkAddress address 
)
static

Handle the acception of a connection.

Parameters
sThe socket of the new connection.
addressThe address of the peer.

Definition at line 115 of file network_admin.cpp.

References address, and ServerNetworkAdminSocketHandler().

◆ AllowConnection()

◆ GetName()

static const char* ServerNetworkAdminSocketHandler::GetName ( )
inlinestatic

Get the name used by the listener.

Returns
the name to show in debug logs and the like.

Definition at line 81 of file network_admin.h.

◆ IterateActive()

static Pool::IterateWrapperFiltered<ServerNetworkAdminSocketHandler, ServerNetworkAdminSocketHandlerFilter> ServerNetworkAdminSocketHandler::IterateActive ( size_t  from = 0)
inlinestatic

Returns an iterable ensemble of all active admin sockets.

Parameters
fromindex of the first socket to consider
Returns
an iterable ensemble of all active admin sockets

Definition at line 95 of file network_admin.h.

Referenced by NetworkAdminChat(), NetworkAdminClientError(), NetworkAdminClientInfo(), NetworkAdminClientQuit(), NetworkAdminClientUpdate(), NetworkAdminCmdLogging(), NetworkAdminCompanyInfo(), NetworkAdminCompanyRemove(), NetworkAdminCompanyUpdate(), NetworkAdminConsole(), NetworkAdminGameScript(), NetworkAdminUpdate(), NetworkDisconnect(), and WelcomeAll().

◆ Receive_ADMIN_CHAT()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_CHAT ( Packet p)
overrideprotectedvirtual

Send chat as the server: uint8 Action such as NETWORK_ACTION_CHAT_CLIENT (see NetworkAction).

uint8 Destination type such as DESTTYPE_BROADCAST (see DestType). uint32 ID of the destination such as company or client id. string Message.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 781 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_GAMESCRIPT()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_GAMESCRIPT ( Packet p)
overrideprotectedvirtual

Send a JSON string to the current active GameScript.

json JSON string for the GameScript.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 529 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_JOIN()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_JOIN ( Packet p)
overrideprotectedvirtual

Join the admin network: string Password the server is expecting for this network.

string Name of the application being used to connect. string Version string of the application being used to connect.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 663 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_PING()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_PING ( Packet p)
overrideprotectedvirtual

Ping the server, requiring the server to reply with a pong packet.

uint32 Integer value to pass to the server, which is quoted in the reply.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 543 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_POLL()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_POLL ( Packet p)
overrideprotectedvirtual

Poll the server for certain updates, an invalid poll (e.g.

not existent id) gets silently dropped: uint8 AdminUpdateType the server should answer for, only if AdminUpdateFrequency ADMIN_FREQUENCY_POLL is advertised in the PROTOCOL packet. Note integer type - see "Certain Packet Information" in docs/admin_network.md. uint32 ID relevant to the packet type, e.g.

  • the client ID for ADMIN_UPDATE_CLIENT_INFO. Use UINT32_MAX to show all clients.
  • the company ID for ADMIN_UPDATE_COMPANY_INFO. Use UINT32_MAX to show all companies.
    Parameters
    pThe packet that was just received.
    Returns
    The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 715 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_QUIT()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_QUIT ( Packet p)
overrideprotectedvirtual

Notification to the server that this admin is quitting.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 691 of file network_admin.cpp.

References NetworkAdminSocketHandler::CloseConnection().

◆ Receive_ADMIN_RCON()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_RCON ( Packet p)
overrideprotectedvirtual

Execute a command on the servers console: string Command to be executed.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 513 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ Receive_ADMIN_UPDATE_FREQUENCY()

NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_UPDATE_FREQUENCY ( Packet p)
overrideprotectedvirtual

Register updates to be sent at certain frequencies (as announced in the PROTOCOL packet): uint16 Update type (see AdminUpdateType).

Note integer type - see "Certain Packet Information" in docs/admin_network.md. uint16 Update frequency (see AdminUpdateFrequency), setting ADMIN_FREQUENCY_POLL is always ignored.

Parameters
pThe packet that was just received.
Returns
The state the network should have.

Reimplemented from NetworkAdminSocketHandler.

Definition at line 697 of file network_admin.cpp.

References ADMIN_STATUS_INACTIVE, SendError(), and NetworkAdminSocketHandler::status.

◆ SendChat()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendChat ( NetworkAction  action,
DestType  desttype,
ClientID  client_id,
const char *  msg,
int64  data 
)

Send a chat message.

Parameters
actionThe action associated with the message.
desttypeThe destination type.
client_idThe origin of the chat message.
msgThe actual message.
dataArbitrary extra data.

Definition at line 469 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_CHAT, NETWORK_RECV_STATUS_OKAY, Packet::Send_string(), Packet::Send_uint32(), Packet::Send_uint64(), Packet::Send_uint8(), and NetworkTCPSocketHandler::SendPacket().

◆ SendClientError()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientError ( ClientID  client_id,
NetworkErrorCode  error 
)

Tell the admin that a client made an error.

Parameters
client_idThe client that made the error.
errorThe error that was made.

Definition at line 288 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_CLIENT_ERROR, error(), NETWORK_RECV_STATUS_OKAY, Packet::Send_uint32(), Packet::Send_uint8(), and NetworkTCPSocketHandler::SendPacket().

◆ SendClientInfo()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientInfo ( const NetworkClientSocket cs,
const NetworkClientInfo ci 
)

◆ SendClientJoin()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientJoin ( ClientID  client_id)

Tell the admin that a client joined.

Parameters
client_idThe client that joined.

Definition at line 217 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_CLIENT_JOIN, NETWORK_RECV_STATUS_OKAY, Packet::Send_uint32(), and NetworkTCPSocketHandler::SendPacket().

◆ SendClientQuit()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientQuit ( ClientID  client_id)

Tell the admin that a client quit.

Parameters
client_idThe client that quit.

Definition at line 273 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_CLIENT_QUIT, NETWORK_RECV_STATUS_OKAY, Packet::Send_uint32(), and NetworkTCPSocketHandler::SendPacket().

◆ SendClientUpdate()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientUpdate ( const NetworkClientInfo ci)

◆ SendCmdLogging()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdLogging ( ClientID  client_id,
const CommandPacket cp 
)

◆ SendCompanyInfo()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyInfo ( const Company c)

Send the admin some information about a company.

Parameters
cThe company to send the information about.

Definition at line 317 of file network_admin.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, NETWORK_COMPANY_NAME_LENGTH, and SetDParam().

◆ SendCompanyNew()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyNew ( CompanyID  company_id)

Tell the admin that a new company was founded.

Parameters
company_idThe company that was founded.

Definition at line 303 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_COMPANY_NEW, NETWORK_RECV_STATUS_OKAY, Packet::Send_uint8(), and NetworkTCPSocketHandler::SendPacket().

◆ SendCompanyRemove()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyRemove ( CompanyID  company_id,
AdminCompanyRemoveReason  acrr 
)

Tell the admin that a company got removed.

Parameters
company_idThe company that got removed.
acrrThe reason for removal, e.g. bankruptcy or merger.

Definition at line 387 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_COMPANY_REMOVE, NETWORK_RECV_STATUS_OKAY, Packet::Send_uint8(), and NetworkTCPSocketHandler::SendPacket().

◆ SendCompanyUpdate()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyUpdate ( const Company c)

Send an update about a company.

Parameters
cThe company to send the update of.

Definition at line 353 of file network_admin.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, NETWORK_COMPANY_NAME_LENGTH, and SetDParam().

◆ SendConsole()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendConsole ( const char *  origin,
const char *  string 
)

Send console output of other clients.

Parameters
originThe origin of the string.
stringThe string that's put on the console.

Definition at line 559 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_CONSOLE, NETWORK_RECV_STATUS_OKAY, SEND_MTU, Packet::Send_string(), and NetworkTCPSocketHandler::SendPacket().

◆ SendError()

◆ SendGameScript()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendGameScript ( const char *  json)

Send GameScript JSON output.

Parameters
jsonThe JSON string.

Definition at line 580 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_GAMESCRIPT, NETWORK_GAMESCRIPT_JSON_LENGTH, NETWORK_RECV_STATUS_OKAY, Packet::Send_string(), and NetworkTCPSocketHandler::SendPacket().

◆ SendRcon()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendRcon ( uint16  colour,
const char *  result 
)

Send the reply of an rcon command.

Parameters
colourThe colour of the text.
resultThe result of the command.

Definition at line 502 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_RCON, NETWORK_RECV_STATUS_OKAY, Packet::Send_string(), Packet::Send_uint16(), and NetworkTCPSocketHandler::SendPacket().

◆ SendRconEnd()

NetworkRecvStatus ServerNetworkAdminSocketHandler::SendRconEnd ( const char *  command)

Send a notification indicating the rcon command has completed.

Parameters
commandThe original command sent.

Definition at line 487 of file network_admin.cpp.

References ADMIN_PACKET_SERVER_RCON_END, NETWORK_RECV_STATUS_OKAY, Packet::Send_string(), and NetworkTCPSocketHandler::SendPacket().


The documentation for this class was generated from the following files: