Add function for checking if there's still pending data in reliable waiting buffers

This commit is contained in:
Amos 2023-08-16 00:15:01 +02:00
parent 2ff35a94cd
commit 3c36b606f0
2 changed files with 11 additions and 0 deletions

View File

@ -157,6 +157,15 @@ bool CNetChan::SendNetMsg(INetMessage& msg, bool bForceReliable, bool bVoice)
return true;
}
//-----------------------------------------------------------------------------
// Purpose: check if there is still data in the reliable waiting buffers
//-----------------------------------------------------------------------------
bool CNetChan::HasPendingReliableData(void)
{
return (m_StreamReliable.GetNumBitsWritten() > 0)
|| (m_WaitingList.Count() > 0);
}
///////////////////////////////////////////////////////////////////////////////
void VNetChan::Attach() const
{

View File

@ -123,6 +123,8 @@ public:
inline const netadr_t& GetRemoteAddress(void) const { return remote_address; }
inline bool IsOverflowed(void) const { return m_StreamReliable.IsOverflowed(); }
bool HasPendingReliableData(void);
inline bool CanPacket(void) const { return v_NetChan_CanPacket(this); }
inline int SendDatagram(bf_write* pDatagram) { return v_NetChan_SendDatagram(this, pDatagram); }
bool SendNetMsg(INetMessage& msg, bool bForceReliable, bool bVoice);