Small fix to comply with changed server-code. (Not tested - though is relatively small change.)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/networking@13141 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx
2013-07-09 02:04:35 +00:00
parent 49631c0027
commit bd3ee05f10

View File

@@ -298,20 +298,27 @@ void ServerLobbyRoomProtocol::update()
const XMLNode * result = connector->getXMLFromPage();
std::string rec_success;
if(result->getName() == "users")
if(result->get("success", &rec_success))
{
uint32_t id = 0;
for (unsigned int i = 0; i < result->getNumNodes(); i++)
if(rec_success == "yes")
{
result->getNode(i)->get("id", &id);
Log::info("ServerLobbyRoomProtocol", "User with id %d wants to connect.", id);
m_incoming_peers_ids.push_back(id);
}
const XMLNode * users_xml = result->getNode("users");
uint32_t id = 0;
for (unsigned int i = 0; i < users_xml->getNumNodes(); i++)
{
users_xml->getNode(i)->get("id", &id);
Log::info("ServerLobbyRoomProtocol", "User with id %d wants to connect.", id);
m_incoming_peers_ids.push_back(id);
}
}
else
{
Log::error("ServerLobbyRoomProtocol", "INSERT SOME ERROR MESSAGE");
}
}
else
{
Log::error("ServerLobbyRoomProtocol", "Cannot retreive the list");
Log::error("ServerLobbyRoomProtocol", "Cannot retrieve the list");
}
}