mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'disappearing-servers-fix' into 'master'
Disappearing servers fix See merge request STJr/SRB2!334
This commit is contained in:
commit
8eae64b38e
1 changed files with 17 additions and 2 deletions
|
|
@ -1623,6 +1623,8 @@ static void SendAskInfo(INT32 node, boolean viams)
|
||||||
serverelem_t serverlist[MAXSERVERLIST];
|
serverelem_t serverlist[MAXSERVERLIST];
|
||||||
UINT32 serverlistcount = 0;
|
UINT32 serverlistcount = 0;
|
||||||
|
|
||||||
|
#define FORCECLOSE 0x8000
|
||||||
|
|
||||||
static void SL_ClearServerList(INT32 connectedserver)
|
static void SL_ClearServerList(INT32 connectedserver)
|
||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
|
|
@ -1630,7 +1632,7 @@ static void SL_ClearServerList(INT32 connectedserver)
|
||||||
for (i = 0; i < serverlistcount; i++)
|
for (i = 0; i < serverlistcount; i++)
|
||||||
if (connectedserver != serverlist[i].node)
|
if (connectedserver != serverlist[i].node)
|
||||||
{
|
{
|
||||||
Net_CloseConnection(serverlist[i].node);
|
Net_CloseConnection(serverlist[i].node|FORCECLOSE);
|
||||||
serverlist[i].node = 0;
|
serverlist[i].node = 0;
|
||||||
}
|
}
|
||||||
serverlistcount = 0;
|
serverlistcount = 0;
|
||||||
|
|
@ -1712,12 +1714,25 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
// Make sure MS version matches our own, to
|
// Make sure MS version matches our own, to
|
||||||
// thwart nefarious servers who lie to the MS.
|
// thwart nefarious servers who lie to the MS.
|
||||||
|
|
||||||
if(strcmp(version, server_list[i].version) == 0)
|
if (strcmp(version, server_list[i].version) == 0)
|
||||||
{
|
{
|
||||||
INT32 node = I_NetMakeNodewPort(server_list[i].ip, server_list[i].port);
|
INT32 node = I_NetMakeNodewPort(server_list[i].ip, server_list[i].port);
|
||||||
if (node == -1)
|
if (node == -1)
|
||||||
break; // no more node free
|
break; // no more node free
|
||||||
SendAskInfo(node, true);
|
SendAskInfo(node, true);
|
||||||
|
// Force close the connection so that servers can't eat
|
||||||
|
// up nodes forever if we never get a reply back from them
|
||||||
|
// (usually when they've not forwarded their ports).
|
||||||
|
//
|
||||||
|
// Don't worry, we'll get in contact with the working
|
||||||
|
// servers again when they send SERVERINFO to us later!
|
||||||
|
//
|
||||||
|
// (Note: as a side effect this probably means every
|
||||||
|
// server in the list will probably be using the same node (e.g. node 1),
|
||||||
|
// not that it matters which nodes they use when
|
||||||
|
// the connections are closed afterwards anyway)
|
||||||
|
// -- Monster Iestyn 12/11/18
|
||||||
|
Net_CloseConnection(node|FORCECLOSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue