mirror of
https://github.com/rehlds/rehlds.git
synced 2024-12-28 15:45:46 +03:00
fix for split packets
This commit is contained in:
parent
5fdafc1f3e
commit
b8927fc6da
@ -776,14 +776,6 @@ qboolean NET_GetLong(unsigned char *pData, int size, int *outSize)
|
||||
gNetSplit.currentSequence = pHeader->sequenceNumber;
|
||||
gNetSplit.splitCount = packetCount;
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
gNetSplit.totalSize = 0;
|
||||
|
||||
// clear part's sequence
|
||||
for (int i = 0; i < NET_WS_MAX_FRAGMENTS; i++)
|
||||
gNetSplitFlags[i] = -1;
|
||||
#endif
|
||||
|
||||
if (net_showpackets.value == 4.0f)
|
||||
Con_Printf("<-- Split packet restart %i count %i seq\n", gNetSplit.splitCount, sequenceNumber);
|
||||
}
|
||||
@ -809,9 +801,6 @@ qboolean NET_GetLong(unsigned char *pData, int size, int *outSize)
|
||||
if (SPLIT_SIZE * packetNumber + packetPayloadSize > MAX_UDP_PACKET)
|
||||
{
|
||||
Con_NetPrintf("Malformed packet size (%i, %i)\n", SPLIT_SIZE * packetNumber, packetPayloadSize);
|
||||
#ifdef REHLDS_FIXES
|
||||
gNetSplit.currentSequence = -1;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -833,9 +822,6 @@ qboolean NET_GetLong(unsigned char *pData, int size, int *outSize)
|
||||
i + 1,
|
||||
gNetSplitFlags[i],
|
||||
gNetSplit.currentSequence);
|
||||
#ifdef REHLDS_FIXES
|
||||
gNetSplit.currentSequence = -1; // no more parts can be attached, clear it
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -850,9 +836,6 @@ qboolean NET_GetLong(unsigned char *pData, int size, int *outSize)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
*outSize = 0;
|
||||
#endif
|
||||
Con_NetPrintf("Split packet too large! %d bytes\n", gNetSplit.totalSize);
|
||||
return FALSE;
|
||||
}
|
||||
@ -928,6 +911,12 @@ qboolean NET_QueuePacket(netsrc_t sock)
|
||||
{
|
||||
return NET_LagPacket(TRUE, sock, &in_from, &in_message);
|
||||
}
|
||||
#ifdef REHLDS_FIXES
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (in_message.cursize < 9)
|
||||
{
|
||||
@ -935,15 +924,6 @@ qboolean NET_QueuePacket(netsrc_t sock)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
// Only server can send split packets, there is no server<->server communication, so server can't receive split packets
|
||||
if (sock == NS_SERVER)
|
||||
{
|
||||
Con_NetPrintf("Someone tries to send split packet to the server\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NET_GetLong(in_message.data, ret, &in_message.cursize);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user