OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
12 #ifndef NETWORK_CORE_CORE_H
13 #define NETWORK_CORE_CORE_H
15 #include "../../newgrf_config.h"
73 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.
@ NETWORK_RECV_STATUS_DESYNC
A desync did occur.
SocketHandler for all network sockets in OpenTTD.
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.
virtual ~NetworkSocketHandler()
Close the socket when destructing the socket handler.
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.
@ NETWORK_RECV_STATUS_SAVEGAME
Something went wrong (down)loading the savegame.
@ NETWORK_RECV_STATUS_MALFORMED_PACKET
We apparently send a malformed packet.