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:
parent
85e0fed9b7
commit
35e382b893
@ -132,14 +132,7 @@ void ConnectToServer::asynchronousUpdate()
|
|||||||
}
|
}
|
||||||
else
|
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;
|
m_state = GOT_SERVER_ADDRESS;
|
||||||
// Pause this protocol till GetPeerAddress finishes.
|
|
||||||
// The callback then will unpause this protocol/
|
|
||||||
requestPause();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -270,11 +263,6 @@ void ConnectToServer::callback(Protocol *protocol)
|
|||||||
// STKHost, so we only need to unpause this protocol
|
// STKHost, so we only need to unpause this protocol
|
||||||
requestUnpause();
|
requestUnpause();
|
||||||
break;
|
break;
|
||||||
case GOT_SERVER_ADDRESS:
|
|
||||||
// Get the server address from the protocol.
|
|
||||||
m_server_address.copy(((GetPeerAddress*)protocol)->getAddress());
|
|
||||||
requestUnpause();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
Log::error("ConnectToServer",
|
Log::error("ConnectToServer",
|
||||||
"Received unexpected callback while in state %d.",
|
"Received unexpected callback while in state %d.",
|
||||||
|
@ -49,7 +49,13 @@ Server::Server(const XMLNode & xml, bool is_lan)
|
|||||||
xml.get("hostid", &m_host_id);
|
xml.get("hostid", &m_host_id);
|
||||||
xml.get("max_players", &m_max_players);
|
xml.get("max_players", &m_max_players);
|
||||||
xml.get("current_players", &m_current_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&)
|
} // Server(const XML&)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user