// read udp data while there is data to read :)
while ((dataSize = m_UDPSocket.recv(&from, (char *)data, sizeof(data))) > 0)
{
// compare the received data size to the expected size
if (dataSize == HEARTBEAT_SIZE)
{
char *d = data;
int32 signature;
d = ReadInt32(d, &signature);
// make sure the signature is correct
if (signature == HEARTBEAT_SIGNATURE)
{
CServerInfo info;
info.Deserialize(d);
from.port = 8303;
info.SetAddress(&from);
dbg_msg("got heartbeat", "IP: %i.%i.%i.%i:%i", (int)from.ip[0], (int)from.ip[1], (int)from.ip[2], (int)from.ip[3], from.port);
dbg_msg("refresh", "okay. server count: %i", m_ServerCount);
ProcessHeartBeat(info);
}