Added an event to search for servers.

Client now broadcasts a serverlistrequest.
An active server will then answer the request and send info about the server.
The client saves this data to a list and presents it to the user.
This commit is contained in:
stiffly
2016-02-19 15:38:09 +01:00
parent 46987beefb
commit 993d804cef
12 changed files with 178 additions and 51 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ public:
void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers);
void Receive(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet);
void Send(Packet & packet);
void Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint);
void Broadcast(Packet & packet, int port);
bool IsSocketAvailable();
private:
// UDP logic