OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
12 #ifndef NETWORK_CORE_CORE_H
13 #define NETWORK_CORE_CORE_H
15 #include "../../newgrf_config.h"
16 #include "../network_crypto.h"
79 void Reopen() { this->has_quit =
false; }
@ NETWORK_RECV_STATUS_CLIENT_QUIT
The connection is lost gracefully. Other clients are already informed of this leaving client.
std::unique_ptr< class NetworkEncryptionHandler > send_encryption_handler
The handler for encrypting sent packets.
@ NETWORK_RECV_STATUS_DESYNC
A desync did occur.
SocketHandler for all network sockets in OpenTTD.
virtual ~NetworkSocketHandler()=default
Close the socket when destructing the socket handler.
bool has_quit
Whether the current client has quit/send a bad packet.
void NetworkCoreShutdown()
Shuts down the network core (as that is needed for some platforms.
void Reopen()
Reopen the socket so we can send/receive stuff again.
@ NETWORK_RECV_STATUS_NEWGRF_MISMATCH
We did not have the required NewGRFs.
@ NETWORK_RECV_STATUS_SERVER_FULL
The server is full.
@ NETWORK_RECV_STATUS_SERVER_ERROR
The server told us we made an error.
NetworkSocketHandler()
Create a new unbound socket.
@ NETWORK_RECV_STATUS_SERVER_BANNED
The server has banned us.
void MarkClosed()
Mark the connection as closed.
@ NETWORK_RECV_STATUS_CLOSE_QUERY
Done querying the server.
Internal entity of a packet.
bool HasClientQuit() const
Whether the current client connected to the socket has quit.
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
bool NetworkCoreInitialize()
Initializes the network core (as that is needed for some platforms.
@ NETWORK_RECV_STATUS_CONNECTION_LOST
The connection is lost unexpectedly.
@ NETWORK_RECV_STATUS_OKAY
Everything is okay.
std::unique_ptr< class NetworkEncryptionHandler > receive_encryption_handler
The handler for decrypting received packets.
@ NETWORK_RECV_STATUS_SAVEGAME
Something went wrong (down)loading the savegame.
@ NETWORK_RECV_STATUS_MALFORMED_PACKET
We apparently send a malformed packet.