mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 19:50:51 +00:00
Don't allow nonsense PT_ASKINFOVIAMS packets, nor any at all if offline
This commit is contained in:
parent
5aeb4b5919
commit
247ed56e17
1 changed files with 14 additions and 4 deletions
|
@ -3405,13 +3405,23 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
||||||
switch (netbuffer->packettype)
|
switch (netbuffer->packettype)
|
||||||
{
|
{
|
||||||
case PT_ASKINFOVIAMS:
|
case PT_ASKINFOVIAMS:
|
||||||
|
if (ms_RoomId < 0) // ignore if we're not actually on the MS right now
|
||||||
|
{
|
||||||
|
Net_CloseConnection(node); // and yes, close connection
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (server && serverrunning)
|
if (server && serverrunning)
|
||||||
{
|
{
|
||||||
INT32 clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr);
|
INT32 clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr);
|
||||||
SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time));
|
if (clientnode != -1)
|
||||||
SV_SendPlayerInfo(clientnode); // Send extra info
|
{
|
||||||
Net_CloseConnection(clientnode);
|
SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time));
|
||||||
// Don't close connection to MS.
|
SV_SendPlayerInfo(clientnode); // Send extra info
|
||||||
|
Net_CloseConnection(clientnode);
|
||||||
|
// Don't close connection to MS...
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Net_CloseConnection(node); // ...unless the IP address is not valid
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue