Class for handling the server side of the game connection. More...
#include <network_admin.h>
Public Member Functions | |
ServerNetworkAdminSocketHandler (SOCKET s) | |
Create a new socket for the server side of the admin network. | |
~ServerNetworkAdminSocketHandler () | |
Clear everything related to this admin. | |
NetworkRecvStatus | SendError (NetworkErrorCode error) |
NetworkRecvStatus | SendWelcome () |
NetworkRecvStatus | SendNewGame () |
NetworkRecvStatus | SendShutdown () |
NetworkRecvStatus | SendDate () |
NetworkRecvStatus | SendClientJoin (ClientID client_id) |
NetworkRecvStatus | SendClientInfo (const NetworkClientSocket *cs) |
NetworkRecvStatus | SendClientUpdate (const NetworkClientInfo *ci) |
NetworkRecvStatus | SendClientQuit (ClientID client_id) |
NetworkRecvStatus | SendClientError (ClientID client_id, NetworkErrorCode error) |
NetworkRecvStatus | SendCompanyNew (CompanyID company_id) |
NetworkRecvStatus | SendCompanyInfo (const Company *c) |
NetworkRecvStatus | SendCompanyUpdate (const Company *c) |
NetworkRecvStatus | SendCompanyRemove (CompanyID company_id, AdminCompanyRemoveReason bcrr) |
NetworkRecvStatus | SendCompanyEconomy () |
NetworkRecvStatus | SendCompanyStats () |
NetworkRecvStatus | SendChat (NetworkAction action, DestType desttype, ClientID client_id, const char *msg, int64 data) |
NetworkRecvStatus | SendRcon (uint16 colour, const char *command) |
NetworkRecvStatus | SendConsole (const char *origin, const char *command) |
NetworkRecvStatus | SendCmdNames () |
NetworkRecvStatus | SendCmdLogging (ClientID client_id, const CommandPacket *cp) |
Static Public Member Functions | |
static void | Send () |
Send the packets for the server sockets. | |
static void | AcceptConnection (SOCKET s, const NetworkAddress &address) |
static bool | AllowConnection () |
Whether a connection is allowed or not at this moment. | |
static void | WelcomeAll () |
Send a Welcome packet to all connected admins. | |
static const char * | GetName () |
Get the name used by the listener. | |
Data Fields | |
AdminUpdateFrequency | update_frequency [ADMIN_UPDATE_END] |
Admin requested update intervals. | |
uint32 | realtime_connect |
Time of connection. | |
NetworkAddress | address |
Address of the admin. | |
Protected Member Functions | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_JOIN) | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_QUIT) | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY) | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_POLL) | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_CHAT) | |
DECLARE_ADMIN_RECEIVE_COMMAND (ADMIN_PACKET_ADMIN_RCON) | |
NetworkRecvStatus | SendProtocol () |
Class for handling the server side of the game connection.
Definition at line 28 of file network_admin.h.
ServerNetworkAdminSocketHandler::ServerNetworkAdminSocketHandler | ( | SOCKET | s | ) |
Create a new socket for the server side of the admin network.
s | The socket to connect with. |
Definition at line 61 of file network_admin.cpp.
References _network_admins_connected, _realtime_tick, realtime_connect, and NetworkAdminSocketHandler::status.
bool ServerNetworkAdminSocketHandler::AllowConnection | ( | ) | [static] |
Whether a connection is allowed or not at this moment.
Definition at line 82 of file network_admin.cpp.
References _network_admins_connected, _settings_client, NetworkSettings::admin_password, MAX_ADMINS, ClientSettings::network, and StrEmpty().
static const char* ServerNetworkAdminSocketHandler::GetName | ( | ) | [inline, static] |
Get the name used by the listener.
Definition at line 79 of file network_admin.h.
void ServerNetworkAdminSocketHandler::Send | ( | ) | [static] |
Send the packets for the server sockets.
Definition at line 88 of file network_admin.cpp.
References _realtime_tick, ADMIN_AUTHORISATION_TIMEOUT, ADMIN_STATUS_INACTIVE, NetworkAdminSocketHandler::CloseConnection(), DEBUG, realtime_connect, NetworkTCPSocketHandler::SendPackets(), NetworkAdminSocketHandler::status, and NetworkTCPSocketHandler::writable.