[General] Use simple types for master server packets

pull/249/merge
Koncord 8 years ago
parent b0cd636924
commit 80bd268de6

@ -34,22 +34,25 @@ void PacketMasterQuery::Packet(RakNet::BitStream *bs, bool send)
serverIt = servers->begin();
QueryData server;
SystemAddress sa;
string addr;
unsigned short port;
while(serversCount--)
{
if (send)
{
sa = serverIt->first;
addr = serverIt->first.ToString(false);
port = serverIt->first.GetPort();
server = serverIt->second;
}
RW(addr, send);
RW(port, send);
RW(sa, send);
ProxyMasterPacket::addServer(this, server, send);
if (send)
serverIt++;
else
servers->insert(pair<SystemAddress, QueryData>(sa, server));
servers->insert(pair<SystemAddress, QueryData>(SystemAddress(addr.c_str(), port), server));
}
}

@ -22,7 +22,14 @@ void PacketMasterUpdate::Packet(RakNet::BitStream *bs, bool send)
if (send)
bs->Write(packetID);
RW(server->first, send);
string addr = server->first.ToString(false);
unsigned short port = server->first.GetPort();
RW(addr, send);
RW(port, send);
if(!send)
server->first = SystemAddress(addr.c_str(), port);
ProxyMasterPacket::addServer(this, server->second, send);

Loading…
Cancel
Save