|
OpenTTD Source 20251117-master-g7398d2e290
|
Helper class for handling all server side communication. More...
Public Member Functions | |
| ServerNetworkUDPSocketHandler (NetworkAddressList *addresses) | |
| Create the socket. | |
Public Member Functions inherited from NetworkUDPSocketHandler | |
| NetworkUDPSocketHandler (NetworkAddressList *bind=nullptr) | |
| Create an UDP socket but don't listen yet. | |
| virtual | ~NetworkUDPSocketHandler () |
| On destructing of this class, the socket needs to be closed. | |
| bool | Listen () |
| Start listening on the given host and port. | |
| void | CloseSocket () |
| Close the actual UDP socket. | |
| void | SendPacket (Packet &p, NetworkAddress &recv, bool all=false, bool broadcast=false) |
| Send a packet over UDP. | |
| void | ReceivePackets () |
| Receive a packet at UDP level. | |
Public Member Functions inherited from NetworkSocketHandler | |
| NetworkSocketHandler ()=default | |
| Create a new unbound socket. | |
| virtual | ~NetworkSocketHandler ()=default |
| Close the socket when destructing the socket handler. | |
| void | MarkClosed () |
| Mark the connection as closed. | |
| bool | HasClientQuit () const |
| Whether the current client connected to the socket has quit. | |
| void | Reopen () |
| Reopen the socket so we can send/receive stuff again. | |
Protected Member Functions | |
| void | Receive_CLIENT_FIND_SERVER (Packet &p, NetworkAddress &client_addr) override |
| Queries to the server for information about the game. | |
Protected Member Functions inherited from NetworkUDPSocketHandler | |
| void | ReceiveInvalidPacket (PacketUDPType, NetworkAddress &client_addr) |
| Helper for logging receiving invalid packets. | |
| virtual void | Receive_SERVER_RESPONSE (Packet &p, NetworkAddress &client_addr) |
| Response to a query letting the client know we are here. | |
| void | HandleUDPPacket (Packet &p, NetworkAddress &client_addr) |
| Handle an incoming packets by sending it to the correct function. | |
Additional Inherited Members | |
Protected Attributes inherited from NetworkUDPSocketHandler | |
| NetworkAddressList | bind |
| The address to bind to. | |
| SocketList | sockets |
| The opened sockets. | |
Protected Attributes inherited from NetworkSocketHandler | |
| std::unique_ptr< class NetworkEncryptionHandler > | receive_encryption_handler = nullptr |
| The handler for decrypting received packets. | |
| std::unique_ptr< class NetworkEncryptionHandler > | send_encryption_handler = nullptr |
| The handler for encrypting sent packets. | |
Helper class for handling all server side communication.
Definition at line 53 of file network_udp.cpp.
|
inline |
Create the socket.
| addresses | The addresses to bind on. |
Definition at line 61 of file network_udp.cpp.
|
overrideprotectedvirtual |
Queries to the server for information about the game.
| p | The received packet. |
| client_addr | The origin of the packet. |
Reimplemented from NetworkUDPSocketHandler.
Definition at line 65 of file network_udp.cpp.
References Debug, NetworkAddress::GetHostname(), PACKET_UDP_SERVER_RESPONSE, and NetworkUDPSocketHandler::SendPacket().