mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Change return type of CNetBase::IsSeqInBackroom
from int
to bool
This commit is contained in:
parent
5f7d19d2e0
commit
b594a323a6
|
@ -339,23 +339,23 @@ unsigned char *CNetChunkHeader::Unpack(unsigned char *pData, int Split)
|
|||
return pData + 2;
|
||||
}
|
||||
|
||||
int CNetBase::IsSeqInBackroom(int Seq, int Ack)
|
||||
bool CNetBase::IsSeqInBackroom(int Seq, int Ack)
|
||||
{
|
||||
int Bottom = (Ack - NET_MAX_SEQUENCE / 2);
|
||||
if(Bottom < 0)
|
||||
{
|
||||
if(Seq <= Ack)
|
||||
return 1;
|
||||
return true;
|
||||
if(Seq >= (Bottom + NET_MAX_SEQUENCE))
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Seq <= Ack && Seq >= Bottom)
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
IOHANDLE CNetBase::ms_DataLogSent = 0;
|
||||
|
|
|
@ -544,7 +544,7 @@ public:
|
|||
static int UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct *pPacket, bool &Sixup, SECURITY_TOKEN *pSecurityToken = nullptr, SECURITY_TOKEN *pResponseToken = nullptr);
|
||||
|
||||
// The backroom is ack-NET_MAX_SEQUENCE/2. Used for knowing if we acked a packet or not
|
||||
static int IsSeqInBackroom(int Seq, int Ack);
|
||||
static bool IsSeqInBackroom(int Seq, int Ack);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue