mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Don't do anything hole punching related if rendezvousserver is unset
This commit is contained in:
parent
307cdf7039
commit
df59f3580d
2 changed files with 16 additions and 9 deletions
|
@ -1909,8 +1909,11 @@ static void SendAskInfo(INT32 node)
|
||||||
// our address to the host, it'll be able to speak to us.
|
// our address to the host, it'll be able to speak to us.
|
||||||
HSendPacket(node, false, 0, sizeof (askinfo_pak));
|
HSendPacket(node, false, 0, sizeof (askinfo_pak));
|
||||||
|
|
||||||
if (node != 0 && node != BROADCASTADDR)
|
if (node != 0 && node != BROADCASTADDR &&
|
||||||
|
cv_rendezvousserver.string[0])
|
||||||
|
{
|
||||||
I_NetRequestHolePunch();
|
I_NetRequestHolePunch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
serverelem_t serverlist[MAXSERVERLIST];
|
serverelem_t serverlist[MAXSERVERLIST];
|
||||||
|
@ -5730,14 +5733,17 @@ static void UpdatePingTable(void)
|
||||||
|
|
||||||
static void RenewHolePunch(void)
|
static void RenewHolePunch(void)
|
||||||
{
|
{
|
||||||
static time_t past;
|
if (cv_rendezvousserver.string[0])
|
||||||
|
|
||||||
const time_t now = time(NULL);
|
|
||||||
|
|
||||||
if ((now - past) > 20)
|
|
||||||
{
|
{
|
||||||
I_NetRegisterHolePunch();
|
static time_t past;
|
||||||
past = now;
|
|
||||||
|
const time_t now = time(NULL);
|
||||||
|
|
||||||
|
if ((now - past) > 20)
|
||||||
|
{
|
||||||
|
I_NetRegisterHolePunch();
|
||||||
|
past = now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -600,7 +600,8 @@ void Command_Numnodes(void)
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
static boolean hole_punch(ssize_t c)
|
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;
|
mysockaddr_t addr;
|
||||||
addr.ip4.sin_family = AF_INET;
|
addr.ip4.sin_family = AF_INET;
|
||||||
|
|
Loading…
Reference in a new issue