Netmessage cleanup

This commit is contained in:
Jordan Cristiano 2015-05-27 22:51:30 -04:00
parent bbf100a5c7
commit 6a40e771af
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ namespace NetHandlers
bool Net_SetConVar_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::Net_SetConVar* data) 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) for (cvar_t& cvar : data->cvars)
{ {
bitbuf.ReadString(cvar.name, sizeof(cvar.name)); 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) 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) for (cvar_t& cvar : data->cvars)
{ {
bitbuf.WriteString(cvar.name); bitbuf.WriteString(cvar.name);

View File

@ -6,16 +6,16 @@ namespace NetHandlers
{ {
bool Net_SignonState_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::Net_SignonState* data) bool Net_SignonState_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::Net_SignonState* data)
{ {
data->signonState = bitbuf.ReadUBitLong(8); data->signonState = bitbuf.ReadByte();
data->spawnCount = bitbuf.ReadUBitLong(32); data->spawnCount = bitbuf.ReadLong();
//assert(signonState >= SIGNONSTATE_NONE && signonState <= SIGNONSTATE_CHANGELEVEL); //assert(signonState >= SIGNONSTATE_NONE && signonState <= SIGNONSTATE_CHANGELEVEL);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_SignonState_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data) bool Net_SignonState_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data)
{ {
bitbuf.WriteUBitLong(data->signonState, 8); bitbuf.WriteByte(data->signonState);
bitbuf.WriteUBitLong(data->spawnCount, 32); bitbuf.WriteLong(data->spawnCount);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }