Updated the serverlist, now prints adress and port of the server.

This commit is contained in:
stiffly
2016-02-17 17:05:10 +01:00
parent 950ecba1c0
commit 46987beefb
5 changed files with 23 additions and 8 deletions
+9
View File
@@ -74,7 +74,16 @@ void TCPServer::Send(Packet & packet)
void TCPServer::Disconnect()
{
}
std::string TCPServer::Address()
{
boost::asio::ip::tcp::resolver resolver(m_IOService);
boost::asio::ip::tcp::resolver::query query(boost::asio::ip::tcp::v4(), boost::asio::ip::host_name(), "");
boost::asio::ip::tcp::resolver::iterator it = resolver.resolve(query);
boost::asio::ip::tcp::endpoint endpoint = *it;
return endpoint.address().to_string().c_str();
}
void TCPServer::Receive(Packet & packet, PlayerDefinition & playerDefinition)