OpenTTD Source  1.11.2
ClientNetworkUDPSocketHandler Class Reference

‍*** Communication with servers (we are client) ***‍/ More...

Inheritance diagram for ClientNetworkUDPSocketHandler:
NetworkUDPSocketHandler NetworkSocketHandler

Protected Member Functions

void Receive_SERVER_RESPONSE (Packet *p, NetworkAddress *client_addr) override
 Return of server information to the client. More...
 
void Receive_MASTER_RESPONSE_LIST (Packet *p, NetworkAddress *client_addr) override
 The server sends a list of servers. More...
 
void Receive_SERVER_NEWGRFS (Packet *p, NetworkAddress *client_addr) override
 The return of the client's request of the names of some NewGRFs.
 
- Protected Member Functions inherited from NetworkUDPSocketHandler
NetworkRecvStatus CloseConnection (bool error=true) override
 Close the current connection; for TCP this will be mostly equivalent to Close(), but for UDP it just means the packet has to be dropped. More...
 
void ReceiveInvalidPacket (PacketUDPType, NetworkAddress *client_addr)
 Helper for logging receiving invalid packets. More...
 
virtual void Receive_CLIENT_FIND_SERVER (Packet *p, NetworkAddress *client_addr)
 Queries to the server for information about the game. More...
 
virtual void Receive_CLIENT_DETAIL_INFO (Packet *p, NetworkAddress *client_addr)
 Query for detailed information about companies. More...
 
virtual void Receive_SERVER_DETAIL_INFO (Packet *p, NetworkAddress *client_addr)
 Reply with detailed company information. More...
 
virtual void Receive_SERVER_REGISTER (Packet *p, NetworkAddress *client_addr)
 Registers the server to the master server. More...
 
virtual void Receive_MASTER_ACK_REGISTER (Packet *p, NetworkAddress *client_addr)
 The master server acknowledges the registration. More...
 
virtual void Receive_CLIENT_GET_LIST (Packet *p, NetworkAddress *client_addr)
 The client requests a list of servers. More...
 
virtual void Receive_SERVER_UNREGISTER (Packet *p, NetworkAddress *client_addr)
 A server unregisters itself at the master server. More...
 
virtual void Receive_CLIENT_GET_NEWGRFS (Packet *p, NetworkAddress *client_addr)
 The client requests information about some NewGRFs. More...
 
virtual void Receive_MASTER_SESSION_KEY (Packet *p, NetworkAddress *client_addr)
 The master server sends us a session key. More...
 
void HandleUDPPacket (Packet *p, NetworkAddress *client_addr)
 Handle an incoming packets by sending it to the correct function. More...
 

Additional Inherited Members

- Public Member Functions inherited from NetworkUDPSocketHandler
 NetworkUDPSocketHandler (NetworkAddressList *bind=nullptr)
 Create an UDP socket but don't listen yet. More...
 
virtual ~NetworkUDPSocketHandler ()
 On destructing of this class, the socket needs to be closed.
 
bool Listen ()
 Start listening on the given host and port. More...
 
void Close () override
 Close the given UDP socket.
 
void SendPacket (Packet *p, NetworkAddress *recv, bool all=false, bool broadcast=false)
 Send a packet over UDP. More...
 
void ReceivePackets ()
 Receive a packet at UDP level.
 
- Public Member Functions inherited from NetworkSocketHandler
 NetworkSocketHandler ()
 Create a new unbound socket.
 
virtual ~NetworkSocketHandler ()
 Close the socket when destructing the socket handler.
 
bool HasClientQuit () const
 Whether the current client connected to the socket has quit. More...
 
void Reopen ()
 Reopen the socket so we can send/receive stuff again.
 
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. More...
 
- Protected Attributes inherited from NetworkUDPSocketHandler
NetworkAddressList bind
 The address to bind to.
 
SocketList sockets
 The opened sockets.
 

Detailed Description

‍*** Communication with servers (we are client) ***‍/

Helper class for handling all client side communication.

Definition at line 306 of file network_udp.cpp.

Member Function Documentation

◆ Receive_MASTER_RESPONSE_LIST()

void ClientNetworkUDPSocketHandler::Receive_MASTER_RESPONSE_LIST ( Packet p,
NetworkAddress client_addr 
)
overrideprotectedvirtual

The server sends a list of servers.

uint8 The protocol version. For each server: 4 or 16 bytes of IPv4 or IPv6 address. uint8 The port.

Parameters
pThe received packet.
client_addrThe origin of the packet.

Reimplemented from NetworkUDPSocketHandler.

Definition at line 381 of file network_udp.cpp.

References Packet::Recv_uint16(), Packet::Recv_uint8(), SLT_END, and SLT_IPv4.

◆ Receive_SERVER_RESPONSE()


The documentation for this class was generated from the following file: