Remove unnecessary request for server address,since it is now included

for each server in the list of all servers.
This commit is contained in:
hiker 2016-10-14 17:48:22 +11:00
parent 85e0fed9b7
commit 35e382b893
2 changed files with 7 additions and 13 deletions

View File

@ -132,14 +132,7 @@ void ConnectToServer::asynchronousUpdate()
}
else
{
// No quick connect, so we have a server to connect to.
// Find its address
m_current_protocol = new GetPeerAddress(m_host_id, this);
m_current_protocol->requestStart();
m_state = GOT_SERVER_ADDRESS;
// Pause this protocol till GetPeerAddress finishes.
// The callback then will unpause this protocol/
requestPause();
}
}
break;
@ -270,11 +263,6 @@ void ConnectToServer::callback(Protocol *protocol)
// STKHost, so we only need to unpause this protocol
requestUnpause();
break;
case GOT_SERVER_ADDRESS:
// Get the server address from the protocol.
m_server_address.copy(((GetPeerAddress*)protocol)->getAddress());
requestUnpause();
break;
default:
Log::error("ConnectToServer",
"Received unexpected callback while in state %d.",

View File

@ -49,7 +49,13 @@ Server::Server(const XMLNode & xml, bool is_lan)
xml.get("hostid", &m_host_id);
xml.get("max_players", &m_max_players);
xml.get("current_players", &m_current_players);
uint32_t ip;
xml.get("ip", &ip);
m_address.setIP(ip);
uint16_t port;
xml.get("port", &port);
m_address.setPort(port);
xml.get("private_port", &m_private_port);
} // Server(const XML&)
// ----------------------------------------------------------------------------