Moved UDP logic from Hybrid server/client to UDP server/client. fixed bug in Server::CheckForTimeOuts.

This commit is contained in:
Jocke
2016-02-08 14:32:00 +01:00
parent 88d7b79cd3
commit ba9419b342
16 changed files with 271 additions and 230 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef UDPServer_h__
#define UDPServer_h__
#include "Server.h"
#include <boost/asio/ip/udp.hpp>
class UDPServer : public Server
{
public:
UDPServer();
~UDPServer();
private:
// UDP logic
boost::asio::io_service m_IOService;
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
std::unique_ptr<boost::asio::ip::udp::socket> m_Socket;
void readFromClients();
int receive(char * data);
void parseConnect(Packet & packet);
void send(Packet & packet, PlayerDefinition & playerDefinition);
void send(Packet & packet);
};
#endif