mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed a server register issue
This commit is contained in:
parent
d7c106ca90
commit
a5bc567e84
|
@ -231,6 +231,23 @@ void CRegister::RegisterUpdate()
|
|||
|
||||
int CRegister::RegisterProcessPacket(CNetChunk *pPacket)
|
||||
{
|
||||
// check for masterserver address
|
||||
bool Valid = false;
|
||||
NETADDR Addr1 = pPacket->m_Address;
|
||||
Addr1.port = 0;
|
||||
for(int i = 0; i < IMasterServer::MAX_MASTERSERVERS; i++)
|
||||
{
|
||||
NETADDR Addr2 = m_aMasterserverInfo[i].m_Addr;
|
||||
Addr2.port = 0;
|
||||
if(net_addr_comp(&Addr1, &Addr2) == 0)
|
||||
{
|
||||
Valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!Valid)
|
||||
return 0;
|
||||
|
||||
if(pPacket->m_DataSize == sizeof(SERVERBROWSE_FWCHECK) &&
|
||||
mem_comp(pPacket->m_pData, SERVERBROWSE_FWCHECK, sizeof(SERVERBROWSE_FWCHECK)) == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue