14 #ifndef NETWORK_CORE_CORE_H 15 #define NETWORK_CORE_CORE_H 17 #include "../../newgrf_config.h" 76 void Reopen() { this->has_quit =
false; }
bool HasClientQuit() const
Whether the current client connected to the socket has quit.
Internal entity of a packet.
Something went wrong (down)loading the savegame.
Configuration options of the network stuff.
The server told us we made an error.
Basic data to distinguish a GRF.
void Reopen()
Reopen the socket so we can send/receive stuff again.
bool has_quit
Whether the current client has quit/send a bad packet.
Done querying the server.
virtual void Close()
Really close the socket.
NetworkSocketHandler()
Create a new unbound socket.
void SendCompanyInformation(Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats, uint max_len=NETWORK_COMPANY_NAME_LENGTH)
Package some generic company information into a packet.
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
We did not have the required NewGRFs.
The connection is 'just' lost.
The server has banned us.
virtual ~NetworkSocketHandler()
Close the socket when destructing the socket handler.
virtual NetworkRecvStatus CloseConnection(bool error=true)
Close the current connection; for TCP this will be mostly equivalent to Close(), but for UDP it just ...
static const uint NETWORK_COMPANY_NAME_LENGTH
The maximum length of the company name, in bytes including '\0'.
void CDECL error(const char *s,...)
Error handling for fatal non-user errors.
bool NetworkCoreInitialize()
Initializes the network core (as that is needed for some platforms.
We apparently send a malformed packet.
Simple calculated statistics of a company.
void NetworkCoreShutdown()
Shuts down the network core (as that is needed for some platforms.
void ReceiveGRFIdentifier(Packet *p, GRFIdentifier *grf)
Deserializes the GRFIdentifier (GRF ID and MD5 checksum) from the packet.
void SendGRFIdentifier(Packet *p, const GRFIdentifier *grf)
Serializes the GRFIdentifier (GRF ID and MD5 checksum) to the packet.
SocketHandler for all network sockets in OpenTTD.