mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add wrapper for reading netmsg types
This commit is contained in:
parent
8c87ad219f
commit
d528ec69f1
@ -178,6 +178,19 @@ void NET_RemoveChannel(CClient* pClient, int nIndex, const char* szReason, uint8
|
||||
g_ServerPlayer[nIndex].Reset(); // Reset ServerPlayer slot.
|
||||
#endif // !CLIENT_DLL
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: reads the net message type from buffer
|
||||
// Input : &outType -
|
||||
// &buffer -
|
||||
// Output : true on success, false otherwise
|
||||
//-----------------------------------------------------------------------------
|
||||
bool NET_ReadMessageType(int* outType, bf_read* buffer)
|
||||
{
|
||||
*outType = buffer->ReadUBitLong(NETMSG_TYPE_BITS);
|
||||
return !buffer->IsOverflowed();
|
||||
}
|
||||
|
||||
#endif // !NETCONSOLE
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -48,6 +48,8 @@ void NET_GenerateKey();
|
||||
void NET_PrintFunc(const char* fmt, ...);
|
||||
void NET_RemoveChannel(CClient* pClient, int nIndex, const char* szReason, uint8_t bBadRep, bool bRemoveNow);
|
||||
|
||||
bool NET_ReadMessageType(int* outType, bf_read* buffer);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
extern netadr_t* g_pNetAdr;
|
||||
extern netkey_t* g_pNetKey;
|
||||
|
Loading…
x
Reference in New Issue
Block a user