2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <base/system.h>
|
2010-08-17 22:06:00 +00:00
|
|
|
#include <engine/console.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <engine/masterserver.h>
|
2020-09-26 19:41:58 +00:00
|
|
|
#include <engine/shared/config.h>
|
|
|
|
#include <engine/shared/network.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
#include <mastersrv/mastersrv.h>
|
|
|
|
|
|
|
|
#include "register.h"
|
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
CRegister::CRegister(bool Sixup)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-06-16 12:41:30 +00:00
|
|
|
m_Sixup = Sixup;
|
|
|
|
m_pName = Sixup ? "regsixup" : "register";
|
|
|
|
m_LastTokenRequest = 0;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
m_pNetServer = 0;
|
|
|
|
m_pMasterServer = 0;
|
2010-08-17 22:06:00 +00:00
|
|
|
m_pConsole = 0;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
m_RegisterState = REGISTERSTATE_START;
|
|
|
|
m_RegisterStateStart = 0;
|
|
|
|
m_RegisterFirst = 1;
|
|
|
|
m_RegisterCount = 0;
|
|
|
|
|
|
|
|
mem_zero(m_aMasterserverInfo, sizeof(m_aMasterserverInfo));
|
|
|
|
m_RegisterRegisteredServer = -1;
|
|
|
|
}
|
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
void CRegister::FeedToken(NETADDR Addr, SECURITY_TOKEN ResponseToken)
|
|
|
|
{
|
|
|
|
Addr.port = 0;
|
2020-10-26 14:14:07 +00:00
|
|
|
for(auto &MasterserverInfo : m_aMasterserverInfo)
|
2020-06-16 12:41:30 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
NETADDR Addr2 = MasterserverInfo.m_Addr;
|
2020-06-16 12:41:30 +00:00
|
|
|
Addr2.port = 0;
|
|
|
|
if(net_addr_comp(&Addr, &Addr2) == 0)
|
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
MasterserverInfo.m_Token = ResponseToken;
|
2020-06-16 12:41:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CRegister::RegisterNewState(int State)
|
|
|
|
{
|
|
|
|
m_RegisterState = State;
|
|
|
|
m_RegisterStateStart = time_get();
|
|
|
|
}
|
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
void CRegister::RegisterSendFwcheckresponse(NETADDR *pAddr, SECURITY_TOKEN ResponseToken)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
CNetChunk Packet;
|
|
|
|
Packet.m_ClientID = -1;
|
|
|
|
Packet.m_Address = *pAddr;
|
|
|
|
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
|
|
|
Packet.m_DataSize = sizeof(SERVERBROWSE_FWRESPONSE);
|
|
|
|
Packet.m_pData = SERVERBROWSE_FWRESPONSE;
|
2020-06-16 12:41:30 +00:00
|
|
|
if(m_Sixup)
|
|
|
|
m_pNetServer->SendConnlessSixup(&Packet, ResponseToken);
|
|
|
|
else
|
|
|
|
m_pNetServer->Send(&Packet);
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
void CRegister::RegisterSendHeartbeat(NETADDR Addr, SECURITY_TOKEN ResponseToken)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-10-27 17:57:14 +00:00
|
|
|
unsigned char aData[sizeof(SERVERBROWSE_HEARTBEAT) + 2];
|
2020-08-27 16:54:44 +00:00
|
|
|
unsigned short Port = m_pNetServer->Address().port;
|
2010-05-29 07:25:38 +00:00
|
|
|
CNetChunk Packet;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
mem_copy(aData, SERVERBROWSE_HEARTBEAT, sizeof(SERVERBROWSE_HEARTBEAT));
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
Packet.m_ClientID = -1;
|
|
|
|
Packet.m_Address = Addr;
|
|
|
|
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
|
|
|
Packet.m_DataSize = sizeof(SERVERBROWSE_HEARTBEAT) + 2;
|
|
|
|
Packet.m_pData = &aData;
|
|
|
|
|
|
|
|
// supply the set port that the master can use if it has problems
|
|
|
|
if(g_Config.m_SvExternalPort)
|
|
|
|
Port = g_Config.m_SvExternalPort;
|
|
|
|
aData[sizeof(SERVERBROWSE_HEARTBEAT)] = Port >> 8;
|
2020-09-26 19:41:58 +00:00
|
|
|
aData[sizeof(SERVERBROWSE_HEARTBEAT) + 1] = Port & 0xff;
|
2020-06-16 12:41:30 +00:00
|
|
|
if(m_Sixup)
|
|
|
|
m_pNetServer->SendConnlessSixup(&Packet, ResponseToken);
|
|
|
|
else
|
|
|
|
m_pNetServer->Send(&Packet);
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
void CRegister::RegisterSendCountRequest(NETADDR Addr, SECURITY_TOKEN ResponseToken)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
CNetChunk Packet;
|
|
|
|
Packet.m_ClientID = -1;
|
|
|
|
Packet.m_Address = Addr;
|
|
|
|
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
|
|
|
Packet.m_DataSize = sizeof(SERVERBROWSE_GETCOUNT);
|
|
|
|
Packet.m_pData = SERVERBROWSE_GETCOUNT;
|
2020-06-16 12:41:30 +00:00
|
|
|
if(m_Sixup)
|
|
|
|
m_pNetServer->SendConnlessSixup(&Packet, ResponseToken);
|
|
|
|
else
|
|
|
|
m_pNetServer->Send(&Packet);
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CRegister::RegisterGotCount(CNetChunk *pChunk)
|
|
|
|
{
|
|
|
|
unsigned char *pData = (unsigned char *)pChunk->m_pData;
|
2020-09-26 19:41:58 +00:00
|
|
|
int Count = (pData[sizeof(SERVERBROWSE_COUNT)] << 8) | pData[sizeof(SERVERBROWSE_COUNT) + 1];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2020-10-26 14:14:07 +00:00
|
|
|
for(auto &MasterserverInfo : m_aMasterserverInfo)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
if(net_addr_comp(&MasterserverInfo.m_Addr, &pChunk->m_Address) == 0)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
MasterserverInfo.m_Count = Count;
|
2010-05-29 07:25:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-17 22:06:00 +00:00
|
|
|
void CRegister::Init(CNetServer *pNetServer, IEngineMasterServer *pMasterServer, IConsole *pConsole)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
m_pNetServer = pNetServer;
|
|
|
|
m_pMasterServer = pMasterServer;
|
2010-08-17 22:06:00 +00:00
|
|
|
m_pConsole = pConsole;
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
|
|
|
|
2011-04-04 16:20:05 +00:00
|
|
|
void CRegister::RegisterUpdate(int Nettype)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
int64 Now = time_get();
|
|
|
|
int64 Freq = time_freq();
|
|
|
|
|
|
|
|
if(!g_Config.m_SvRegister)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_pMasterServer->Update();
|
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(m_Sixup && (m_RegisterState == REGISTERSTATE_HEARTBEAT || m_RegisterState == REGISTERSTATE_REGISTERED) && Now > m_LastTokenRequest + Freq * 5)
|
2020-06-16 12:41:30 +00:00
|
|
|
{
|
|
|
|
m_pNetServer->SendTokenSixup(m_aMasterserverInfo[m_RegisterRegisteredServer].m_Addr, NET_SECURITY_TOKEN_UNKNOWN);
|
|
|
|
m_LastTokenRequest = Now;
|
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
if(m_RegisterState == REGISTERSTATE_START)
|
|
|
|
{
|
|
|
|
m_RegisterCount = 0;
|
|
|
|
m_RegisterFirst = 1;
|
|
|
|
RegisterNewState(REGISTERSTATE_UPDATE_ADDRS);
|
2011-04-04 16:20:05 +00:00
|
|
|
m_pMasterServer->RefreshAddresses(Nettype);
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "refreshing ip addresses");
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
|
|
|
else if(m_RegisterState == REGISTERSTATE_UPDATE_ADDRS)
|
|
|
|
{
|
|
|
|
m_RegisterRegisteredServer = -1;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
if(!m_pMasterServer->IsRefreshing())
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for(i = 0; i < IMasterServer::MAX_MASTERSERVERS; i++)
|
|
|
|
{
|
2011-03-30 10:08:33 +00:00
|
|
|
if(!m_pMasterServer->IsValid(i))
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2011-03-30 10:08:33 +00:00
|
|
|
m_aMasterserverInfo[i].m_Valid = 0;
|
|
|
|
m_aMasterserverInfo[i].m_Count = 0;
|
|
|
|
continue;
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
2011-03-30 10:08:33 +00:00
|
|
|
|
|
|
|
NETADDR Addr = m_pMasterServer->GetAddr(i);
|
|
|
|
m_aMasterserverInfo[i].m_Addr = Addr;
|
2020-06-16 12:41:30 +00:00
|
|
|
if(m_Sixup)
|
|
|
|
m_aMasterserverInfo[i].m_Addr.port = 8283;
|
2011-03-30 10:08:33 +00:00
|
|
|
m_aMasterserverInfo[i].m_Valid = 1;
|
|
|
|
m_aMasterserverInfo[i].m_Count = -1;
|
|
|
|
m_aMasterserverInfo[i].m_LastSend = 0;
|
2020-06-16 12:41:30 +00:00
|
|
|
m_aMasterserverInfo[i].m_Token = NET_SECURITY_TOKEN_UNKNOWN;
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "fetching server counts");
|
|
|
|
m_LastTokenRequest = Now;
|
2010-05-29 07:25:38 +00:00
|
|
|
RegisterNewState(REGISTERSTATE_QUERY_COUNT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(m_RegisterState == REGISTERSTATE_QUERY_COUNT)
|
|
|
|
{
|
|
|
|
int Left = 0;
|
2020-10-26 14:14:07 +00:00
|
|
|
for(auto &MasterserverInfo : m_aMasterserverInfo)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
if(!MasterserverInfo.m_Valid)
|
2010-05-29 07:25:38 +00:00
|
|
|
continue;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-10-26 14:14:07 +00:00
|
|
|
if(MasterserverInfo.m_Count == -1)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
Left++;
|
2020-10-26 14:14:07 +00:00
|
|
|
if(MasterserverInfo.m_LastSend + Freq < Now)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
MasterserverInfo.m_LastSend = Now;
|
|
|
|
if(m_Sixup && MasterserverInfo.m_Token == NET_SECURITY_TOKEN_UNKNOWN)
|
|
|
|
m_pNetServer->SendTokenSixup(MasterserverInfo.m_Addr, NET_SECURITY_TOKEN_UNKNOWN);
|
2020-06-16 12:41:30 +00:00
|
|
|
else
|
2020-10-26 14:14:07 +00:00
|
|
|
RegisterSendCountRequest(MasterserverInfo.m_Addr, MasterserverInfo.m_Token);
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// check if we are done or timed out
|
2020-09-26 19:41:58 +00:00
|
|
|
if(Left == 0 || Now > m_RegisterStateStart + Freq * 5)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
// choose server
|
|
|
|
int Best = -1;
|
|
|
|
int i;
|
|
|
|
for(i = 0; i < IMasterServer::MAX_MASTERSERVERS; i++)
|
|
|
|
{
|
|
|
|
if(!m_aMasterserverInfo[i].m_Valid || m_aMasterserverInfo[i].m_Count == -1)
|
|
|
|
continue;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
if(Best == -1 || m_aMasterserverInfo[i].m_Count < m_aMasterserverInfo[Best].m_Count)
|
|
|
|
Best = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
// server chosen
|
|
|
|
m_RegisterRegisteredServer = Best;
|
|
|
|
if(m_RegisterRegisteredServer == -1)
|
|
|
|
{
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "WARNING: No master servers. Retrying in 60 seconds");
|
2010-05-29 07:25:38 +00:00
|
|
|
RegisterNewState(REGISTERSTATE_ERROR);
|
|
|
|
}
|
|
|
|
else
|
2011-04-13 18:37:12 +00:00
|
|
|
{
|
2010-08-17 22:06:00 +00:00
|
|
|
char aBuf[256];
|
2011-01-17 11:56:49 +00:00
|
|
|
str_format(aBuf, sizeof(aBuf), "chose '%s' as master, sending heartbeats", m_pMasterServer->GetName(m_RegisterRegisteredServer));
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, aBuf);
|
2010-05-29 07:25:38 +00:00
|
|
|
m_aMasterserverInfo[m_RegisterRegisteredServer].m_LastSend = 0;
|
|
|
|
RegisterNewState(REGISTERSTATE_HEARTBEAT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(m_RegisterState == REGISTERSTATE_HEARTBEAT)
|
|
|
|
{
|
|
|
|
// check if we should send heartbeat
|
2020-09-26 19:41:58 +00:00
|
|
|
if(Now > m_aMasterserverInfo[m_RegisterRegisteredServer].m_LastSend + Freq * 15)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
m_aMasterserverInfo[m_RegisterRegisteredServer].m_LastSend = Now;
|
2020-06-16 12:41:30 +00:00
|
|
|
RegisterSendHeartbeat(m_aMasterserverInfo[m_RegisterRegisteredServer].m_Addr, m_aMasterserverInfo[m_RegisterRegisteredServer].m_Token);
|
2010-05-29 07:25:38 +00:00
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(Now > m_RegisterStateStart + Freq * 60)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "WARNING: Master server is not responding, switching master");
|
2010-05-29 07:25:38 +00:00
|
|
|
RegisterNewState(REGISTERSTATE_START);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(m_RegisterState == REGISTERSTATE_REGISTERED)
|
|
|
|
{
|
|
|
|
if(m_RegisterFirst)
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "server registered");
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
m_RegisterFirst = 0;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// check if we should send new heartbeat again
|
2020-09-26 19:41:58 +00:00
|
|
|
if(Now > m_RegisterStateStart + Freq)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
if(m_RegisterCount == 120) // redo the whole process after 60 minutes to balance out the master servers
|
|
|
|
RegisterNewState(REGISTERSTATE_START);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_RegisterCount++;
|
|
|
|
RegisterNewState(REGISTERSTATE_HEARTBEAT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(m_RegisterState == REGISTERSTATE_ERROR)
|
|
|
|
{
|
|
|
|
// check for restart
|
2020-09-26 19:41:58 +00:00
|
|
|
if(Now > m_RegisterStateStart + Freq * 60)
|
2010-05-29 07:25:38 +00:00
|
|
|
RegisterNewState(REGISTERSTATE_START);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-16 12:41:30 +00:00
|
|
|
int CRegister::RegisterProcessPacket(CNetChunk *pPacket, SECURITY_TOKEN ResponseToken)
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2010-06-13 17:34:14 +00:00
|
|
|
// check for masterserver address
|
|
|
|
bool Valid = false;
|
2020-10-26 14:14:07 +00:00
|
|
|
for(auto &MasterserverInfo : m_aMasterserverInfo)
|
2010-06-13 17:34:14 +00:00
|
|
|
{
|
2020-10-26 14:14:07 +00:00
|
|
|
if(net_addr_comp_noport(&pPacket->m_Address, &MasterserverInfo.m_Addr) == 0)
|
2010-06-13 17:34:14 +00:00
|
|
|
{
|
|
|
|
Valid = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!Valid)
|
|
|
|
return 0;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
if(pPacket->m_DataSize == sizeof(SERVERBROWSE_FWCHECK) &&
|
|
|
|
mem_comp(pPacket->m_pData, SERVERBROWSE_FWCHECK, sizeof(SERVERBROWSE_FWCHECK)) == 0)
|
|
|
|
{
|
2020-06-16 12:41:30 +00:00
|
|
|
RegisterSendFwcheckresponse(&pPacket->m_Address, ResponseToken);
|
2010-05-29 07:25:38 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else if(pPacket->m_DataSize == sizeof(SERVERBROWSE_FWOK) &&
|
|
|
|
mem_comp(pPacket->m_pData, SERVERBROWSE_FWOK, sizeof(SERVERBROWSE_FWOK)) == 0)
|
|
|
|
{
|
|
|
|
if(m_RegisterFirst)
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "no firewall/nat problems detected");
|
|
|
|
|
|
|
|
if(m_RegisterState == REGISTERSTATE_HEARTBEAT || m_RegisterState == REGISTERSTATE_REGISTERED)
|
|
|
|
RegisterNewState(REGISTERSTATE_REGISTERED);
|
2010-05-29 07:25:38 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else if(pPacket->m_DataSize == sizeof(SERVERBROWSE_FWERROR) &&
|
|
|
|
mem_comp(pPacket->m_pData, SERVERBROWSE_FWERROR, sizeof(SERVERBROWSE_FWERROR)) == 0)
|
|
|
|
{
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, "ERROR: the master server reports that clients can not connect to this server.");
|
2010-08-17 22:06:00 +00:00
|
|
|
char aBuf[256];
|
2020-08-27 16:54:44 +00:00
|
|
|
str_format(aBuf, sizeof(aBuf), "ERROR: configure your firewall/nat to let through udp on port %d.", m_pNetServer->Address().port);
|
2020-06-16 12:41:30 +00:00
|
|
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, m_pName, aBuf);
|
2015-11-02 14:04:59 +00:00
|
|
|
//RegisterNewState(REGISTERSTATE_ERROR);
|
2010-05-29 07:25:38 +00:00
|
|
|
return 1;
|
|
|
|
}
|
2020-09-26 19:41:58 +00:00
|
|
|
else if(pPacket->m_DataSize == sizeof(SERVERBROWSE_COUNT) + 2 &&
|
2010-05-29 07:25:38 +00:00
|
|
|
mem_comp(pPacket->m_pData, SERVERBROWSE_COUNT, sizeof(SERVERBROWSE_COUNT)) == 0)
|
|
|
|
{
|
|
|
|
RegisterGotCount(pPacket);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|