mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Try to punch a hole through local firewalls, and fallback to localhost.
Fixes (probably rare) regression in 2034136560.
Differential Revision: https://code.wildfiregames.com/D3999
This was SVN commit r25515.
This commit is contained in:
@@ -862,7 +862,7 @@ bool XmppClient::handleIq(const glooxwrapper::IQ& iq)
|
||||
}
|
||||
|
||||
g_NetClient->SetupServerData(cd->m_Ip.to_string(), stoi(cd->m_Port.to_string()), !cd->m_UseSTUN.empty());
|
||||
g_NetClient->TryToConnect(iq.from().full());
|
||||
g_NetClient->TryToConnect(iq.from().full(), !cd->m_IsLocalIP.empty());
|
||||
}
|
||||
if (gq)
|
||||
{
|
||||
@@ -995,6 +995,7 @@ bool XmppClient::handleIq(const glooxwrapper::IQ& iq)
|
||||
connectionData->m_Ip = g_NetServer->GetPublicIp();
|
||||
connectionData->m_Port = std::to_string(g_NetServer->GetPublicPort());
|
||||
connectionData->m_UseSTUN = g_NetServer->GetUseSTUN() ? "true" : "";
|
||||
connectionData->m_IsLocalIP = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1004,6 +1005,7 @@ bool XmppClient::handleIq(const glooxwrapper::IQ& iq)
|
||||
connectionData->m_Ip = ip;
|
||||
connectionData->m_Port = std::to_string(g_NetServer->GetLocalPort());
|
||||
connectionData->m_UseSTUN = "";
|
||||
connectionData->m_IsLocalIP = "true";
|
||||
}
|
||||
else
|
||||
connectionData->m_Error = "local_ip_failed";
|
||||
|
||||
Reference in New Issue
Block a user