OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #ifndef NETWORK_QUERY_H
11 #define NETWORK_QUERY_H
18 static std::vector<std::unique_ptr<QueryNetworkGameSocketHandler>>
queries;
48 auto query = std::make_unique<QueryNetworkGameSocketHandler>(s,
connection_string);
49 query->SendGameInfo();
void Send()
Send the packets of this socket handler.
bool Receive()
Check whether we received/can send some data from/to the server and when that's the case handle it ap...
Base socket handler for all TCP sockets.
static std::vector< std::unique_ptr< QueryNetworkGameSocketHandler > > queries
Pending queries.
bool CheckConnection()
Check the connection's state, i.e.
NetworkRecvStatus CloseConnection(NetworkRecvStatus status) override
Close the network connection due to the given status.
NetworkRecvStatus Receive_SERVER_BANNED(Packet &p) override
Notification that the client trying to join is banned.
Base class that provides memory initialization on dynamically created objects.
NetworkRecvStatus Receive_SERVER_FULL(Packet &p) override
Notification that the server is full.
Internal entity of a packet.
static void QueryServer(SOCKET s, const std::string &connection_string)
Start to query a server based on an open socket.
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
NetworkRecvStatus Receive_SERVER_GAME_INFO(Packet &p) override
Sends information about the game.
Class for handling the client side of quering a game server.
static void SendReceive()
Check if any query needs to send or receive.
NetworkRecvStatus SendGameInfo()
Query the server for server information.
std::string connection_string
Address we are connected to.
QueryNetworkGameSocketHandler(SOCKET s, const std::string &connection_string)
Create a new socket for the client side of quering game server.
NetworkRecvStatus Receive_SERVER_ERROR(Packet &p) override
The client made an error: uint8_t Error code caused (see NetworkErrorCode).