From 6a40e771af5c778d092fa83793569ead4a90b84f Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Wed, 27 May 2015 22:51:30 -0400 Subject: [PATCH] Netmessage cleanup --- demboyz/netmessages/net_setconvar.cpp | 4 ++-- demboyz/netmessages/net_signonstate.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demboyz/netmessages/net_setconvar.cpp b/demboyz/netmessages/net_setconvar.cpp index 8a61ac3..5a59070 100644 --- a/demboyz/netmessages/net_setconvar.cpp +++ b/demboyz/netmessages/net_setconvar.cpp @@ -8,7 +8,7 @@ namespace NetHandlers bool Net_SetConVar_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::Net_SetConVar* data) { - data->cvars.resize(bitbuf.ReadUBitLong(8)); + data->cvars.resize(bitbuf.ReadByte()); for (cvar_t& cvar : data->cvars) { bitbuf.ReadString(cvar.name, sizeof(cvar.name)); @@ -19,7 +19,7 @@ namespace NetHandlers bool Net_SetConVar_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_SetConVar* data) { - bitbuf.WriteUBitLong(data->cvars.size(), 8); + bitbuf.WriteByte(data->cvars.size()); for (cvar_t& cvar : data->cvars) { bitbuf.WriteString(cvar.name); diff --git a/demboyz/netmessages/net_signonstate.cpp b/demboyz/netmessages/net_signonstate.cpp index d534b97..f58c0ad 100644 --- a/demboyz/netmessages/net_signonstate.cpp +++ b/demboyz/netmessages/net_signonstate.cpp @@ -6,16 +6,16 @@ namespace NetHandlers { bool Net_SignonState_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::Net_SignonState* data) { - data->signonState = bitbuf.ReadUBitLong(8); - data->spawnCount = bitbuf.ReadUBitLong(32); + data->signonState = bitbuf.ReadByte(); + data->spawnCount = bitbuf.ReadLong(); //assert(signonState >= SIGNONSTATE_NONE && signonState <= SIGNONSTATE_CHANGELEVEL); return !bitbuf.IsOverflowed(); } bool Net_SignonState_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data) { - bitbuf.WriteUBitLong(data->signonState, 8); - bitbuf.WriteUBitLong(data->spawnCount, 32); + bitbuf.WriteByte(data->signonState); + bitbuf.WriteLong(data->spawnCount); return !bitbuf.IsOverflowed(); }