10#ifndef NETWORK_CORE_CORE_H
11#define NETWORK_CORE_CORE_H
77 void Reopen() { this->has_quit =
false; }
virtual ~NetworkSocketHandler()=default
Ensure the destructor of the sub classes are called as well.
void MarkClosed()
Mark the connection as closed.
bool HasClientQuit() const
Whether the current client connected to the socket has quit.
std::unique_ptr< class NetworkEncryptionHandler > send_encryption_handler
The handler for encrypting sent packets.
void Reopen()
Reopen the socket so we can send/receive stuff again.
std::unique_ptr< class NetworkEncryptionHandler > receive_encryption_handler
The handler for decrypting received packets.
bool has_quit
Whether the current client has quit/send a bad packet.
NetworkSocketHandler()=default
Create a new unbound socket.
Configuration options of the network stuff.
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
@ Savegame
Something went wrong (down)loading the savegame.
@ Desync
A desync did occur.
@ Okay
Everything is okay.
@ ClientQuit
The connection is lost gracefully. Other clients are already informed of this leaving client.
@ ServerFull
The server is full.
@ ServerBanned
The server has banned us.
@ ServerError
The server told us we made an error.
@ MalformedPacket
We apparently send a malformed packet.
@ ConnectionLost
The connection is lost unexpectedly.
@ CloseQuery
Done querying the server.
@ NewGRFMismatch
We did not have the required NewGRFs.
void NetworkCoreShutdown()
Shuts down the network core (as that is needed for some platforms.
bool NetworkCoreInitialize()
Initializes the network core (as that is needed for some platforms.
Crypto specific bits of the network handling.
Functions to find and configure NewGRFs.
Internal entity of a packet.