Merge pull request #7587 from heinrich5991/pr_ddnet_fix_7575

Reintroduce `m_HaveGlobalTcpAddr`
This commit is contained in:
Robert Müller 2023-12-04 08:57:04 +00:00 committed by GitHub
commit f910ac6a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -2190,6 +2190,7 @@ void CClient::LoadDDNetInfo()
NETADDR Addr;
if(!net_addr_from_str(&Addr, ConnectingIp))
{
m_HaveGlobalTcpAddr = true;
m_GlobalTcpAddr = Addr;
log_debug("info", "got global tcp ip address: %s", (const char *)ConnectingIp);
}
@ -4651,7 +4652,7 @@ int CClient::UdpConnectivity(int NetType)
break;
case CONNECTIVITY::ADDRESS_KNOWN:
GlobalUdpAddr.port = 0;
if(NetType == (int)m_GlobalTcpAddr.type && net_addr_comp(&m_GlobalTcpAddr, &GlobalUdpAddr) != 0)
if(m_HaveGlobalTcpAddr && NetType == (int)m_GlobalTcpAddr.type && net_addr_comp(&m_GlobalTcpAddr, &GlobalUdpAddr) != 0)
{
NewConnectivity = CONNECTIVITY_DIFFERING_UDP_TCP_IP_ADDRESSES;
break;

View file

@ -90,6 +90,7 @@ class CClient : public IClient, public CDemoPlayer::IListener
CUuid m_ConnectionID = UUID_ZEROED;
bool m_HaveGlobalTcpAddr = false;
NETADDR m_GlobalTcpAddr = NETADDR_ZEROED;
uint64_t m_aSnapshotParts[NUM_DUMMIES] = {0, 0};