mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
skip communication with the version server in case the client can't resolve the address
This commit is contained in:
parent
9800dd4172
commit
eaab561b5b
|
@ -1671,20 +1671,25 @@ void CClient::VersionUpdate()
|
||||||
{
|
{
|
||||||
if(m_VersionInfo.m_VersionServeraddr.m_Job.Status() == CJob::STATE_DONE)
|
if(m_VersionInfo.m_VersionServeraddr.m_Job.Status() == CJob::STATE_DONE)
|
||||||
{
|
{
|
||||||
CNetChunk Packet;
|
if(m_VersionInfo.m_VersionServeraddr.m_Job.Result() == 0)
|
||||||
|
{
|
||||||
|
CNetChunk Packet;
|
||||||
|
|
||||||
mem_zero(&Packet, sizeof(Packet));
|
mem_zero(&Packet, sizeof(Packet));
|
||||||
|
|
||||||
m_VersionInfo.m_VersionServeraddr.m_Addr.port = VERSIONSRV_PORT;
|
m_VersionInfo.m_VersionServeraddr.m_Addr.port = VERSIONSRV_PORT;
|
||||||
|
|
||||||
Packet.m_ClientID = -1;
|
Packet.m_ClientID = -1;
|
||||||
Packet.m_Address = m_VersionInfo.m_VersionServeraddr.m_Addr;
|
Packet.m_Address = m_VersionInfo.m_VersionServeraddr.m_Addr;
|
||||||
Packet.m_pData = VERSIONSRV_GETVERSION;
|
Packet.m_pData = VERSIONSRV_GETVERSION;
|
||||||
Packet.m_DataSize = sizeof(VERSIONSRV_GETVERSION);
|
Packet.m_DataSize = sizeof(VERSIONSRV_GETVERSION);
|
||||||
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
||||||
|
|
||||||
m_ContactClient.Send(&Packet);
|
m_ContactClient.Send(&Packet);
|
||||||
m_VersionInfo.m_State = CVersionInfo::STATE_READY;
|
m_VersionInfo.m_State = CVersionInfo::STATE_READY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_VersionInfo.m_State = CVersionInfo::STATE_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,7 @@ class CClient : public IClient, public CDemoPlayer::IListner
|
||||||
STATE_INIT=0,
|
STATE_INIT=0,
|
||||||
STATE_START,
|
STATE_START,
|
||||||
STATE_READY,
|
STATE_READY,
|
||||||
|
STATE_ERROR,
|
||||||
};
|
};
|
||||||
|
|
||||||
int m_State;
|
int m_State;
|
||||||
|
|
Loading…
Reference in a new issue