OpenTTD Source 20241224-master-gee860a5c8e
|
Game Coordinator communication. More...
#include <network_coordinator.h>
Public Member Functions | |
NetworkRecvStatus | CloseConnection (bool error=true) override |
This will put this socket handler in a close state. | |
void | SendReceive () |
Check whether we received/can send some data from/to the Game Coordinator server and when that's the case handle it appropriately. | |
void | ConnectFailure (const std::string &token, uint8_t tracking_number) |
Callback from a Connecter to let the Game Coordinator know the connection failed. | |
void | ConnectSuccess (const std::string &token, SOCKET sock, NetworkAddress &address) |
Callback from a Connecter to let the Game Coordinator know the connection to the game server is established. | |
void | StunResult (const std::string &token, uint8_t family, bool result) |
Callback from the STUN connecter to inform the Game Coordinator about the result of the STUN. | |
void | Connect () |
void | CloseToken (const std::string &token) |
Close everything related to this connection token. | |
void | CloseAllConnections () |
Close all pending connection tokens. | |
void | CloseStunHandler (const std::string &token, uint8_t family=AF_UNSPEC) |
Close the STUN handler. | |
void | CloseTurnHandler (const std::string &token) |
Close the TURN handler. | |
void | Register () |
Register our server to receive our invite code. | |
void | SendServerUpdate () |
Send an update of our server status to the Game Coordinator. | |
void | GetListing () |
Request a listing of all public servers. | |
void | ConnectToServer (const std::string &invite_code, TCPServerConnecter *connecter) |
Join a server based on an invite code. | |
void | StartTurnConnection (std::string &token) |
Public Member Functions inherited from NetworkCoordinatorSocketHandler | |
NetworkCoordinatorSocketHandler (SOCKET s=INVALID_SOCKET) | |
Create a new cs socket handler for a given cs. | |
bool | ReceivePackets () |
Receive a packet at TCP level. | |
Public Member Functions inherited from NetworkTCPSocketHandler | |
bool | IsConnected () const |
Whether this socket is currently bound to a socket. | |
void | CloseSocket () |
Close the actual socket of the connection. | |
virtual void | SendPacket (std::unique_ptr< Packet > &&packet) |
This function puts the packet in the send-queue and it is send as soon as possible. | |
SendPacketsState | SendPackets (bool closing_down=false) |
Sends all the buffered packets out for this client. | |
virtual std::unique_ptr< Packet > | ReceivePacket () |
Receives a packet for the given client. | |
bool | CanSendReceive () |
Check whether this socket can send or receive something. | |
bool | HasSendQueue () |
Whether there is something pending in the send queue. | |
NetworkTCPSocketHandler (SOCKET s=INVALID_SOCKET) | |
Construct a socket handler for a TCP connection. | |
Public Member Functions inherited from NetworkSocketHandler | |
NetworkSocketHandler () | |
Create a new unbound socket. | |
virtual | ~NetworkSocketHandler ()=default |
Close the socket when destructing the socket handler. | |
void | MarkClosed () |
Mark the connection as closed. | |
bool | HasClientQuit () const |
Whether the current client connected to the socket has quit. | |
void | Reopen () |
Reopen the socket so we can send/receive stuff again. | |
Data Fields | |
std::chrono::steady_clock::time_point | last_activity |
The last time there was network activity. | |
bool | connecting |
Are we connecting to the Game Coordinator? | |
Data Fields inherited from NetworkTCPSocketHandler | |
SOCKET | sock |
The socket currently connected to. | |
bool | writable |
Can we write to this socket? | |
Static Public Attributes | |
static constexpr std::chrono::seconds | IDLE_TIMEOUT = std::chrono::seconds(60) |
The idle timeout; when to close the connection because it's idle. | |
Protected Member Functions | |
bool | Receive_GC_ERROR (Packet &p) override |
Game Coordinator indicates there was an error. | |
bool | Receive_GC_REGISTER_ACK (Packet &p) override |
Game Coordinator acknowledges the registration. | |
bool | Receive_GC_LISTING (Packet &p) override |
Game Coordinator replies with a list of all public servers. | |
bool | Receive_GC_CONNECTING (Packet &p) override |
Game Coordinator informs the Client under what token it will start the attempt to connect the Server and Client together. | |
bool | Receive_GC_CONNECT_FAILED (Packet &p) override |
Game Coordinator informs the Client that it failed to find a way to connect the Client to the Server. | |
bool | Receive_GC_DIRECT_CONNECT (Packet &p) override |
Game Coordinator requests that the Client makes a direct connection to the indicated peer, which is a Server. | |
bool | Receive_GC_STUN_REQUEST (Packet &p) override |
Game Coordinator requests the client/server to do a STUN request to the STUN server. | |
bool | Receive_GC_STUN_CONNECT (Packet &p) override |
Game Coordinator informs the client/server of its STUN peer (the host:ip of the other side). | |
bool | Receive_GC_NEWGRF_LOOKUP (Packet &p) override |
Game Coordinator informs the client of updates for the NewGRFs lookup table as used by the NewGRF deserialization in GC_LISTING. | |
bool | Receive_GC_TURN_CONNECT (Packet &p) override |
Game Coordinator requests that we make a connection to the indicated peer, which is a TURN server. | |
Protected Member Functions inherited from NetworkCoordinatorSocketHandler | |
bool | ReceiveInvalidPacket (PacketCoordinatorType type) |
Helper for logging receiving invalid packets. | |
virtual bool | Receive_SERVER_REGISTER (Packet &p) |
Server is starting a multiplayer game and wants to let the Game Coordinator know. | |
virtual bool | Receive_SERVER_UPDATE (Packet &p) |
Send an update of the current state of the server to the Game Coordinator. | |
virtual bool | Receive_CLIENT_LISTING (Packet &p) |
Client requests a list of all public servers. | |
virtual bool | Receive_CLIENT_CONNECT (Packet &p) |
Client wants to connect to a Server. | |
virtual bool | Receive_SERCLI_CONNECT_FAILED (Packet &p) |
Client or Server failed to connect to the remote side. | |
virtual bool | Receive_CLIENT_CONNECTED (Packet &p) |
Client informs the Game Coordinator the connection with the Server is established. | |
virtual bool | Receive_SERCLI_STUN_RESULT (Packet &p) |
Client/server informs the Game Coordinator the result of a STUN request. | |
bool | HandlePacket (Packet &p) |
Handle the given packet, i.e. | |
Private Attributes | |
std::chrono::steady_clock::time_point | next_update |
When to send the next update (if server and public). | |
std::map< std::string, std::pair< std::string, TCPServerConnecter * > > | connecter |
Based on tokens, the current (invite-code, connecter) that are pending. | |
std::map< std::string, TCPServerConnecter * > | connecter_pre |
Based on invite codes, the current connecters that are pending. | |
std::map< std::string, std::map< int, std::unique_ptr< ClientNetworkStunSocketHandler > > > | stun_handlers |
All pending STUN handlers, stored by token:family. | |
std::map< std::string, std::unique_ptr< ClientNetworkTurnSocketHandler > > | turn_handlers |
Pending TURN handler (if any), stored by token. | |
std::shared_ptr< TCPConnecter > | game_connecter {} |
Pending connecter to the game server. | |
uint32_t | newgrf_lookup_table_cursor = 0 |
Last received cursor for the GameInfoNewGRFLookupTable updates. | |
GameInfoNewGRFLookupTable | newgrf_lookup_table |
Table to look up NewGRFs in the GC_LISTING packets. | |
Additional Inherited Members | |
Protected Attributes inherited from NetworkSocketHandler | |
std::unique_ptr< class NetworkEncryptionHandler > | receive_encryption_handler |
The handler for decrypting received packets. | |
std::unique_ptr< class NetworkEncryptionHandler > | send_encryption_handler |
The handler for encrypting sent packets. | |
Game Coordinator communication.
For more detail about what the Game Coordinator does, please see docs/game_coordinator.md.
For servers:
For clients (listing):
For clients (connecting):
Definition at line 53 of file network_coordinator.h.
|
inline |
Definition at line 84 of file network_coordinator.h.
void ClientNetworkCoordinatorSocketHandler::CloseAllConnections | ( | ) |
Close all pending connection tokens.
Definition at line 685 of file network_coordinator.cpp.
References CloseStunHandler(), CloseTurnHandler(), connecter, connecter_pre, ConnectFailure(), game_connecter, stun_handlers, and turn_handlers.
Referenced by CloseConnection().
|
overridevirtual |
This will put this socket handler in a close state.
It will not actually close the OS socket; use CloseSocket for this.
error | Whether we quit under an error condition or not. |
Reimplemented from NetworkTCPSocketHandler.
Definition at line 432 of file network_coordinator.cpp.
References _network_server_connection_type, CloseAllConnections(), NetworkTCPSocketHandler::CloseConnection(), NetworkTCPSocketHandler::CloseSocket(), connecting, CONNECTION_TYPE_UNKNOWN, NETWORK_RECV_STATUS_OKAY, next_update, SetWindowDirty(), and WC_CLIENT_LIST.
Referenced by NetworkUpdateServerGameType(), NetworkCoordinatorConnecter::OnFailure(), Receive_GC_CONNECTING(), Receive_GC_ERROR(), and SendReceive().
void ClientNetworkCoordinatorSocketHandler::CloseStunHandler | ( | const std::string & | token, |
uint8_t | family = AF_UNSPEC |
||
) |
Close the STUN handler.
token | The token used for the STUN handlers. |
family | The family of STUN handlers to close. AF_UNSPEC to close all STUN handlers for this token. |
Definition at line 622 of file network_coordinator.cpp.
References stun_handlers.
Referenced by CloseAllConnections(), CloseToken(), and NetworkReuseStunConnecter::OnFailure().
void ClientNetworkCoordinatorSocketHandler::CloseToken | ( | const std::string & | token | ) |
Close everything related to this connection token.
token | The connection token to close. |
Definition at line 668 of file network_coordinator.cpp.
References CloseStunHandler(), CloseTurnHandler(), and connecter.
Referenced by ConnectSuccess(), and Receive_GC_CONNECT_FAILED().
void ClientNetworkCoordinatorSocketHandler::CloseTurnHandler | ( | const std::string & | token | ) |
Close the TURN handler.
token | The token used for the TURN handler. |
Definition at line 649 of file network_coordinator.cpp.
References CloseWindowByClass(), NRWCD_HANDLED, turn_handlers, and WC_NETWORK_ASK_RELAY.
Referenced by CloseAllConnections(), and CloseToken().
void ClientNetworkCoordinatorSocketHandler::Connect | ( | ) |
Definition at line 419 of file network_coordinator.cpp.
void ClientNetworkCoordinatorSocketHandler::ConnectFailure | ( | const std::string & | token, |
uint8_t | tracking_number | ||
) |
Callback from a Connecter to let the Game Coordinator know the connection failed.
token | Token of the connecter that failed. |
tracking_number | Tracking number of the connecter that failed. |
Definition at line 545 of file network_coordinator.cpp.
References game_connecter, NETWORK_COORDINATOR_VERSION, PACKET_COORDINATOR_SERCLI_CONNECT_FAILED, and NetworkTCPSocketHandler::SendPacket().
Referenced by NetworkAskRelayWindow::Close(), CloseAllConnections(), NetworkAskRelayWindow::OnClick(), NetworkDirectConnecter::OnFailure(), NetworkReuseStunConnecter::OnFailure(), and Receive_GC_TURN_CONNECT().
void ClientNetworkCoordinatorSocketHandler::ConnectSuccess | ( | const std::string & | token, |
SOCKET | sock, | ||
NetworkAddress & | address | ||
) |
Callback from a Connecter to let the Game Coordinator know the connection to the game server is established.
token | Token of the connecter that succeeded. |
sock | The socket that the connecter can now use. |
Definition at line 567 of file network_coordinator.cpp.
References _frame_counter, _network_server, ServerNetworkGameSocketHandler::AcceptConnection(), CloseToken(), connecter, Debug, game_connecter, NetworkAddress::GetHostname(), ServerNetworkGameSocketHandler::GetName(), NETWORK_COORDINATOR_VERSION, PACKET_COORDINATOR_CLIENT_CONNECTED, NetworkTCPSocketHandler::SendPacket(), and NetworkTCPSocketHandler::sock.
Referenced by NetworkDirectConnecter::OnConnect(), NetworkReuseStunConnecter::OnConnect(), and ClientNetworkTurnSocketHandler::Receive_TURN_CONNECTED().
void ClientNetworkCoordinatorSocketHandler::ConnectToServer | ( | const std::string & | invite_code, |
TCPServerConnecter * | connecter | ||
) |
Join a server based on an invite code.
invite_code | The invite code of the server to connect to. |
connecter | The connecter of the request. |
Definition at line 515 of file network_coordinator.cpp.
References connecter, connecter_pre, NETWORK_COORDINATOR_VERSION, PACKET_COORDINATOR_CLIENT_CONNECT, and NetworkTCPSocketHandler::SendPacket().
Referenced by TCPServerConnecter::TCPServerConnecter().
void ClientNetworkCoordinatorSocketHandler::GetListing | ( | ) |
Request a listing of all public servers.
Definition at line 495 of file network_coordinator.cpp.
References _network_game_list_version, NETWORK_COORDINATOR_VERSION, NETWORK_GAME_INFO_VERSION, newgrf_lookup_table_cursor, PACKET_COORDINATOR_CLIENT_LISTING, and NetworkTCPSocketHandler::SendPacket().
Referenced by NetworkGameWindow::OnClick().
|
overrideprotectedvirtual |
Game Coordinator informs the Client that it failed to find a way to connect the Client to the Server.
Any open connections for this token should be closed now.
string Token to track the current connect request.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 288 of file network_coordinator.cpp.
References CloseToken(), NETWORK_TOKEN_LENGTH, and Packet::Recv_string().
|
overrideprotectedvirtual |
Game Coordinator informs the Client under what token it will start the attempt to connect the Server and Client together.
string Token to track the current connect request. string Invite code of the Server to join.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 269 of file network_coordinator.cpp.
References CloseConnection(), connecter, connecter_pre, NETWORK_INVITE_CODE_LENGTH, NETWORK_TOKEN_LENGTH, and Packet::Recv_string().
|
overrideprotectedvirtual |
Game Coordinator requests that the Client makes a direct connection to the indicated peer, which is a Server.
string Token to track the current connect request. uint8_t Tracking number to track current connect request. string Hostname of the peer. uint16_t Port of the peer.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 296 of file network_coordinator.cpp.
References game_connecter, NETWORK_HOSTNAME_LENGTH, NETWORK_TOKEN_LENGTH, Packet::Recv_string(), Packet::Recv_uint16(), and Packet::Recv_uint8().
|
overrideprotectedvirtual |
Game Coordinator indicates there was an error.
This can either be a permanent error causing the connection to be dropped, or in response to a request that is invalid.
uint8_t Type of error (see NetworkCoordinatorErrorType). string Details of the error.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 127 of file network_coordinator.cpp.
References _settings_client, CloseConnection(), connecter_pre, Debug, INVALID_STRING_ID, ClientSettings::network, NETWORK_COORDINATOR_ERROR_INVALID_INVITE_CODE, NETWORK_COORDINATOR_ERROR_REGISTRATION_FAILED, NETWORK_COORDINATOR_ERROR_REUSE_OF_INVITE_CODE, NETWORK_COORDINATOR_ERROR_UNKNOWN, NETWORK_ERROR_DETAIL_LENGTH, NetworkGameListAddItem(), NGLS_OFFLINE, Packet::Recv_string(), Packet::Recv_uint8(), NetworkSettings::server_game_type, ShowErrorMessage(), NetworkGameList::status, UpdateNetworkGameWindow(), and WL_ERROR.
|
overrideprotectedvirtual |
Game Coordinator replies with a list of all public servers.
Multiple of these packets are received after a request till all servers are sent over. Last packet will have server count of 0.
uint16_t Amount of public servers in this packet. For each server: string Connection string for this server. Serialized NetworkGameInfo. See game_info.hpp for details.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 233 of file network_coordinator.cpp.
References _network_game_list_version, ClearGRFConfigList(), NetworkServerGameInfo::grfconfig, NetworkGameList::info, NETWORK_HOSTNAME_PORT_LENGTH, NetworkGameListAddItem(), NetworkGameListRemoveExpired(), newgrf_lookup_table, NGLS_ONLINE, Packet::Recv_string(), Packet::Recv_uint16(), NetworkGameList::status, UpdateNetworkGameWindow(), and NetworkGameList::version.
|
overrideprotectedvirtual |
Game Coordinator informs the client of updates for the NewGRFs lookup table as used by the NewGRF deserialization in GC_LISTING.
This packet is sent after a CLIENT_LISTING request, but before GC_LISTING.
uint32_t Lookup table cursor. uint16_t Number of NewGRFs in the packet, with for each of the NewGRFs: uint32_t Lookup table index for the NewGRF. uint32_t Unique NewGRF ID. uint8_t[16] MD5 checksum of the NewGRF string Name of the NewGRF.
The lookup table built using these packets are used by the deserialisation of the NewGRFs for servers in the GC_LISTING. These updates are additive, i.e. each update will add NewGRFs but never remove them. However, this lookup table is specific to the connection with the Game Coordinator, and should be considered invalid after disconnecting from the Game Coordinator.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 356 of file network_coordinator.cpp.
References newgrf_lookup_table, newgrf_lookup_table_cursor, Packet::Recv_uint16(), and Packet::Recv_uint32().
|
overrideprotectedvirtual |
Game Coordinator acknowledges the registration.
string Invite code that can be used to join this server. string Secret that belongs to the invite code (only needed if reusing the invite code on next SERVER_REGISTER). uint8_t Type of connection was detected (see ConnectionType).
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 177 of file network_coordinator.cpp.
References _network_dedicated, _network_server_connection_type, _network_server_invite_code, _settings_client, CONNECTION_TYPE_DIRECT, CONNECTION_TYPE_ISOLATED, CONNECTION_TYPE_STUN, CONNECTION_TYPE_TURN, CONNECTION_TYPE_UNKNOWN, Debug, ClientSettings::network, NETWORK_INVITE_CODE_LENGTH, NETWORK_INVITE_CODE_SECRET_LENGTH, next_update, Packet::Recv_string(), Packet::Recv_uint8(), NetworkSettings::server_game_type, NetworkSettings::server_invite_code, NetworkSettings::server_invite_code_secret, SetWindowDirty(), ShowErrorMessage(), WC_CLIENT_LIST, and WL_ERROR.
|
overrideprotectedvirtual |
Game Coordinator informs the client/server of its STUN peer (the host:ip of the other side).
It should start a connect() to this peer ASAP with the local address as used with the STUN request.
string Token to track the current connect request. uint8_t Tracking number to track current connect request. uint8_t Interface number, as given during STUN request. string Host of the peer. uint16_t Port of the peer.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 322 of file network_coordinator.cpp.
References game_connecter, NETWORK_HOSTNAME_PORT_LENGTH, NETWORK_TOKEN_LENGTH, Packet::Recv_string(), Packet::Recv_uint16(), Packet::Recv_uint8(), and stun_handlers.
|
overrideprotectedvirtual |
Game Coordinator requests the client/server to do a STUN request to the STUN server.
Important is to remember the local port these STUN requests are sent from, as this will be needed for later conenctions too. The client/server should do multiple STUN requests for every available interface that connects to the Internet (e.g., once for IPv4 and once for IPv6).
string Token to track the current connect request.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 313 of file network_coordinator.cpp.
References NETWORK_TOKEN_LENGTH, Packet::Recv_string(), ClientNetworkStunSocketHandler::Stun(), and stun_handlers.
|
overrideprotectedvirtual |
Game Coordinator requests that we make a connection to the indicated peer, which is a TURN server.
string Token to track the current connect request. uint8_t Tracking number to track current connect request. string Ticket to hand over to the TURN server. string Connection string of the TURN server.
p | The packet that was just received. |
Reimplemented from NetworkCoordinatorSocketHandler.
Definition at line 368 of file network_coordinator.cpp.
References _network_server, _settings_client, connecter, ConnectFailure(), game_connecter, ClientSettings::network, NETWORK_HOSTNAME_PORT_LENGTH, NETWORK_TOKEN_LENGTH, Packet::Recv_string(), Packet::Recv_uint8(), ShowNetworkAskRelay(), ClientNetworkTurnSocketHandler::Turn(), turn_handlers, and NetworkSettings::use_relay_service.
void ClientNetworkCoordinatorSocketHandler::Register | ( | ) |
Register our server to receive our invite code.
Definition at line 452 of file network_coordinator.cpp.
References _network_server_connection_type, _settings_client, CONNECTION_TYPE_UNKNOWN, ClientSettings::network, NETWORK_COORDINATOR_VERSION, next_update, PACKET_COORDINATOR_SERVER_REGISTER, NetworkTCPSocketHandler::SendPacket(), NetworkSettings::server_game_type, NetworkSettings::server_invite_code, NetworkSettings::server_invite_code_secret, NetworkSettings::server_port, SetWindowDirty(), and WC_CLIENT_LIST.
Referenced by NetworkUpdateServerGameType(), and SendReceive().
void ClientNetworkCoordinatorSocketHandler::SendReceive | ( | ) |
Check whether we received/can send some data from/to the Game Coordinator server and when that's the case handle it appropriately.
Definition at line 717 of file network_coordinator.cpp.
References _network_server, _network_server_connection_type, _settings_client, NetworkTCPSocketHandler::CanSendReceive(), CloseConnection(), connecting, CONNECTION_TYPE_UNKNOWN, Debug, IDLE_TIMEOUT, last_activity, ClientSettings::network, next_update, NetworkCoordinatorSocketHandler::ReceivePackets(), Register(), NetworkTCPSocketHandler::SendPackets(), SendServerUpdate(), NetworkSettings::server_game_type, NetworkTCPSocketHandler::sock, stun_handlers, and turn_handlers.
Referenced by NetworkBackgroundLoop().
void ClientNetworkCoordinatorSocketHandler::SendServerUpdate | ( | ) |
Send an update of our server status to the Game Coordinator.
Definition at line 479 of file network_coordinator.cpp.
References Debug, NETWORK_COORDINATOR_DELAY_BETWEEN_UPDATES, NETWORK_COORDINATOR_VERSION, next_update, PACKET_COORDINATOR_SERVER_UPDATE, NetworkTCPSocketHandler::SendPacket(), and TCP_MTU.
Referenced by SendReceive().
void ClientNetworkCoordinatorSocketHandler::StartTurnConnection | ( | std::string & | token | ) |
Definition at line 411 of file network_coordinator.cpp.
void ClientNetworkCoordinatorSocketHandler::StunResult | ( | const std::string & | token, |
uint8_t | family, | ||
bool | result | ||
) |
Callback from the STUN connecter to inform the Game Coordinator about the result of the STUN.
This helps the Game Coordinator not to wait for a timeout on its end, but rather react as soon as the client/server knows the result.
Definition at line 607 of file network_coordinator.cpp.
References NETWORK_COORDINATOR_VERSION, PACKET_COORDINATOR_SERCLI_STUN_RESULT, and NetworkTCPSocketHandler::SendPacket().
Referenced by NetworkStunConnecter::OnFailure(), and ClientNetworkStunSocketHandler::SendReceive().
|
private |
Based on tokens, the current (invite-code, connecter) that are pending.
Definition at line 56 of file network_coordinator.h.
Referenced by CloseAllConnections(), CloseToken(), ConnectSuccess(), ConnectToServer(), Receive_GC_CONNECTING(), and Receive_GC_TURN_CONNECT().
|
private |
Based on invite codes, the current connecters that are pending.
Definition at line 57 of file network_coordinator.h.
Referenced by CloseAllConnections(), ConnectToServer(), Receive_GC_CONNECTING(), and Receive_GC_ERROR().
bool ClientNetworkCoordinatorSocketHandler::connecting |
Are we connecting to the Game Coordinator?
Definition at line 82 of file network_coordinator.h.
Referenced by CloseConnection(), NetworkCoordinatorConnecter::OnConnect(), NetworkCoordinatorConnecter::OnFailure(), and SendReceive().
|
private |
Pending connecter to the game server.
Definition at line 60 of file network_coordinator.h.
Referenced by CloseAllConnections(), ConnectFailure(), ConnectSuccess(), Receive_GC_DIRECT_CONNECT(), Receive_GC_STUN_CONNECT(), and Receive_GC_TURN_CONNECT().
|
staticconstexpr |
The idle timeout; when to close the connection because it's idle.
Definition at line 79 of file network_coordinator.h.
Referenced by SendReceive().
std::chrono::steady_clock::time_point ClientNetworkCoordinatorSocketHandler::last_activity |
The last time there was network activity.
Definition at line 81 of file network_coordinator.h.
Referenced by NetworkCoordinatorConnecter::OnConnect(), and SendReceive().
|
private |
Table to look up NewGRFs in the GC_LISTING packets.
Definition at line 63 of file network_coordinator.h.
Referenced by Receive_GC_LISTING(), and Receive_GC_NEWGRF_LOOKUP().
|
private |
Last received cursor for the GameInfoNewGRFLookupTable updates.
Definition at line 62 of file network_coordinator.h.
Referenced by GetListing(), and Receive_GC_NEWGRF_LOOKUP().
|
private |
When to send the next update (if server and public).
Definition at line 55 of file network_coordinator.h.
Referenced by CloseConnection(), Receive_GC_REGISTER_ACK(), Register(), SendReceive(), and SendServerUpdate().
|
private |
All pending STUN handlers, stored by token:family.
Definition at line 58 of file network_coordinator.h.
Referenced by CloseAllConnections(), CloseStunHandler(), Receive_GC_STUN_CONNECT(), Receive_GC_STUN_REQUEST(), and SendReceive().
|
private |
Pending TURN handler (if any), stored by token.
Definition at line 59 of file network_coordinator.h.
Referenced by CloseAllConnections(), CloseTurnHandler(), Receive_GC_TURN_CONNECT(), and SendReceive().