Implemented primitive server "heartbeat" logic, which sends server info from server to client without being connected.

This commit is contained in:
stiffly
2016-02-17 15:51:26 +01:00
parent 4432891437
commit fdc8f753cb
8 changed files with 61 additions and 4 deletions
+7
View File
@@ -5,6 +5,11 @@ UDPServer::UDPServer()
m_Socket = std::unique_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 27666)));
}
UDPServer::UDPServer(int port)
{
m_Socket = std::unique_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), port)));
}
UDPServer::~UDPServer()
{ }
@@ -31,6 +36,8 @@ void UDPServer::Send(Packet & packet)
0);
}
void UDPServer::Receive(Packet & packet, PlayerDefinition & playerDefinition)
{
int bytesRead = readBuffer(m_ReadBuffer);