Don't do anything hole punching related if rendezvousserver is unset

This commit is contained in:
James R 2021-08-30 18:27:52 -07:00
parent 307cdf7039
commit df59f3580d
2 changed files with 16 additions and 9 deletions

View file

@ -1909,9 +1909,12 @@ static void SendAskInfo(INT32 node)
// our address to the host, it'll be able to speak to us.
HSendPacket(node, false, 0, sizeof (askinfo_pak));
if (node != 0 && node != BROADCASTADDR)
if (node != 0 && node != BROADCASTADDR &&
cv_rendezvousserver.string[0])
{
I_NetRequestHolePunch();
}
}
serverelem_t serverlist[MAXSERVERLIST];
UINT32 serverlistcount = 0;
@ -5729,6 +5732,8 @@ static void UpdatePingTable(void)
}
static void RenewHolePunch(void)
{
if (cv_rendezvousserver.string[0])
{
static time_t past;
@ -5740,6 +5745,7 @@ static void RenewHolePunch(void)
past = now;
}
}
}
// Handle timeouts to prevent definitive freezes from happenning
static void HandleNodeTimeouts(void)

View file

@ -600,7 +600,8 @@ void Command_Numnodes(void)
#ifndef NONET
static boolean hole_punch(ssize_t c)
{
if (c == 10 && holepunchpacket->magic == hole_punch_magic)
if (cv_rendezvousserver.string[0] &&
c == 10 && holepunchpacket->magic == hole_punch_magic)
{
mysockaddr_t addr;
addr.ip4.sin_family = AF_INET;