Made NetHandler Write functions take a const SourceGameContext

This commit is contained in:
Jordan Cristiano 2015-05-15 02:49:51 -04:00
parent 9a0956e8f2
commit 3d80d17a99
34 changed files with 74 additions and 74 deletions

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_Disconnect_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::Net_Disconnect* data) bool Net_Disconnect_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_Disconnect* data)
{ {
bitbuf.WriteString(data->message); bitbuf.WriteString(data->message);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
@ -21,7 +21,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_Disconnect_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_Disconnect* data) bool Net_Disconnect_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_Disconnect* data)
{ {
return true; return true;
} }

View File

@ -12,7 +12,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_File_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::Net_File* data) bool Net_File_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_File* data)
{ {
bitbuf.WriteUBitLong(data->transferID, 32); bitbuf.WriteUBitLong(data->transferID, 32);
bitbuf.WriteString(data->filename); bitbuf.WriteString(data->filename);
@ -25,7 +25,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_File_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_File* data) bool Net_File_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_File* data)
{ {
return true; return true;
} }

View File

@ -8,7 +8,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_NOP_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::Net_NOP* data) bool Net_NOP_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_NOP* data)
{ {
return true; return true;
} }
@ -18,7 +18,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_NOP_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_NOP* data) bool Net_NOP_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_NOP* data)
{ {
return true; return true;
} }

View File

@ -17,7 +17,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_SetConVar_BitWrite_Internal(bf_write& bitbuf, 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.WriteUBitLong(data->cvars.size(), 8);
for (cvar_t& cvar : data->cvars) for (cvar_t& cvar : data->cvars)
@ -33,7 +33,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_SetConVar_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_SetConVar* data) bool Net_SetConVar_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_SetConVar* data)
{ {
return true; return true;
} }

View File

@ -12,7 +12,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_SignonState_BitWrite_Internal(bf_write& bitbuf, 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.WriteUBitLong(data->signonState, 8);
bitbuf.WriteUBitLong(data->spawnCount, 32); bitbuf.WriteUBitLong(data->spawnCount, 32);
@ -24,7 +24,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_SignonState_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_SignonState* data) bool Net_SignonState_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data)
{ {
return true; return true;
} }

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_StringCmd_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::Net_StringCmd* data) bool Net_StringCmd_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_StringCmd* data)
{ {
bitbuf.WriteString(data->command); bitbuf.WriteString(data->command);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
@ -21,7 +21,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_StringCmd_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_StringCmd* data) bool Net_StringCmd_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_StringCmd* data)
{ {
return true; return true;
} }

View File

@ -12,7 +12,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool Net_Tick_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::Net_Tick* data) bool Net_Tick_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::Net_Tick* data)
{ {
bitbuf.WriteUBitLong(data->tick, 32); bitbuf.WriteUBitLong(data->tick, 32);
bitbuf.WriteUBitLong(data->hostFrameTime, 16); bitbuf.WriteUBitLong(data->hostFrameTime, 16);
@ -25,7 +25,7 @@ namespace NetHandlers
return true; return true;
} }
bool Net_Tick_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::Net_Tick* data) bool Net_Tick_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_Tick* data)
{ {
return true; return true;
} }

View File

@ -41,9 +41,9 @@
} }
typedef bool (*NetMsgBitReadFn)(bf_read& bitbuf, SourceGameContext& context, void* data); typedef bool (*NetMsgBitReadFn)(bf_read& bitbuf, SourceGameContext& context, void* data);
typedef bool (*NetMsgBitWriteFn)(bf_write& bitbuf, SourceGameContext& context, void* data); typedef bool (*NetMsgBitWriteFn)(bf_write& bitbuf, const SourceGameContext& context, void* data);
typedef bool (*NetMsgJsonReadFn)(JsonRead& bitbuf, SourceGameContext& context, void* data); typedef bool (*NetMsgJsonReadFn)(JsonRead& bitbuf, SourceGameContext& context, void* data);
typedef bool (*NetMsgJsonWriteFn)(JsonWrite& bitbuf, SourceGameContext& context, void* data); typedef bool (*NetMsgJsonWriteFn)(JsonWrite& bitbuf, const SourceGameContext& context, void* data);
typedef void (*NetMsgToStringFn)(std::ostringstream& out, void* data); typedef void (*NetMsgToStringFn)(std::ostringstream& out, void* data);
bool NetHandlers::NetMsg_BitRead(uint32_t type, bf_read& bitbuf, SourceGameContext& context, void* data) bool NetHandlers::NetMsg_BitRead(uint32_t type, bf_read& bitbuf, SourceGameContext& context, void* data)
@ -52,7 +52,7 @@ bool NetHandlers::NetMsg_BitRead(uint32_t type, bf_read& bitbuf, SourceGameConte
return netHandlers[type](bitbuf, context, data); return netHandlers[type](bitbuf, context, data);
} }
bool NetHandlers::NetMsg_BitWrite(uint32_t type, bf_write& bitbuf, SourceGameContext& context, void* data) bool NetHandlers::NetMsg_BitWrite(uint32_t type, bf_write& bitbuf, const SourceGameContext& context, void* data)
{ {
static const NetMsgBitWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(BitWrite); static const NetMsgBitWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(BitWrite);
return netHandlers[type](bitbuf, context, data); return netHandlers[type](bitbuf, context, data);
@ -64,7 +64,7 @@ bool NetHandlers::NetMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, SourceGameCo
return netHandlers[type](jsonbuf, context, data); return netHandlers[type](jsonbuf, context, data);
} }
bool NetHandlers::NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, SourceGameContext& context, void* data) bool NetHandlers::NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, const SourceGameContext& context, void* data)
{ {
static const NetMsgJsonWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(JsonWrite); static const NetMsgJsonWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(JsonWrite);
return netHandlers[type](jsonbuf, context, data); return netHandlers[type](jsonbuf, context, data);

View File

@ -22,15 +22,15 @@ struct SourceGameContext
namespace NetHandlers \ namespace NetHandlers \
{ \ { \
bool msgname##_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::##msgname* data); \ bool msgname##_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::##msgname* data); \
bool msgname##_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::##msgname* data); \ bool msgname##_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::##msgname* data); \
bool msgname##_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::##msgname* data); \ bool msgname##_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::##msgname* data); \
bool msgname##_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::##msgname* data); \ bool msgname##_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::##msgname* data); \
void msgname##_ToString_Internal(std::ostringstream& out, NetMsg::##msgname* data); \ void msgname##_ToString_Internal(std::ostringstream& out, NetMsg::##msgname* data); \
inline bool msgname##_BitRead(bf_read& bitbuf, SourceGameContext& context, void* data) \ inline bool msgname##_BitRead(bf_read& bitbuf, SourceGameContext& context, void* data) \
{ \ { \
return msgname##_BitRead_Internal(bitbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \ return msgname##_BitRead_Internal(bitbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \
} \ } \
inline bool msgname##_BitWrite(bf_write& bitbuf, SourceGameContext& context, void* data) \ inline bool msgname##_BitWrite(bf_write& bitbuf, const SourceGameContext& context, void* data) \
{ \ { \
return msgname##_BitWrite_Internal(bitbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \ return msgname##_BitWrite_Internal(bitbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \
} \ } \
@ -38,7 +38,7 @@ struct SourceGameContext
{ \ { \
return msgname##_JsonRead_Internal(jsonbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \ return msgname##_JsonRead_Internal(jsonbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \
} \ } \
inline bool msgname##_JsonWrite(JsonWrite& jsonbuf, SourceGameContext& context, void* data) \ inline bool msgname##_JsonWrite(JsonWrite& jsonbuf, const SourceGameContext& context, void* data) \
{ \ { \
return msgname##_JsonWrite_Internal(jsonbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \ return msgname##_JsonWrite_Internal(jsonbuf, context, reinterpret_cast<NetMsg::##msgname*>(data)); \
} \ } \
@ -51,8 +51,8 @@ struct SourceGameContext
namespace NetHandlers namespace NetHandlers
{ {
bool NetMsg_BitRead(uint32_t type, bf_read& bitbuf, SourceGameContext& context, void* data); bool NetMsg_BitRead(uint32_t type, bf_read& bitbuf, SourceGameContext& context, void* data);
bool NetMsg_BitWrite(uint32_t type, bf_write& bitbuf, SourceGameContext& context, void* data); bool NetMsg_BitWrite(uint32_t type, bf_write& bitbuf, const SourceGameContext& context, void* data);
bool NetMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, SourceGameContext& context, void* data); bool NetMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, SourceGameContext& context, void* data);
bool NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, SourceGameContext& context, void* data); bool NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, const SourceGameContext& context, void* data);
void NetMsg_ToString(uint32_t type, std::ostringstream& out, void* data); void NetMsg_ToString(uint32_t type, std::ostringstream& out, void* data);
} }

View File

@ -23,7 +23,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_BSPDecal_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_BSPDecal* data) bool SVC_BSPDecal_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_BSPDecal* data)
{ {
bitbuf.WriteBitVec3Coord(data->position); bitbuf.WriteBitVec3Coord(data->position);
bitbuf.WriteUBitLong(data->decalTextureIndex, MAX_DECAL_INDEX_BITS); bitbuf.WriteUBitLong(data->decalTextureIndex, MAX_DECAL_INDEX_BITS);
@ -46,7 +46,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_BSPDecal_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_BSPDecal* data) bool SVC_BSPDecal_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_BSPDecal* data)
{ {
return true; return true;
} }

View File

@ -27,7 +27,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_ClassInfo_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_ClassInfo* data) bool SVC_ClassInfo_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_ClassInfo* data)
{ {
bitbuf.WriteShort(data->numServerClasses); bitbuf.WriteShort(data->numServerClasses);
bitbuf.WriteOneBit(data->createOnClient); bitbuf.WriteOneBit(data->createOnClient);
@ -49,7 +49,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_ClassInfo_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_ClassInfo* data) bool SVC_ClassInfo_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_ClassInfo* data)
{ {
return true; return true;
} }

View File

@ -52,7 +52,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_CreateStringTable_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) bool SVC_CreateStringTable_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_CreateStringTable* data)
{ {
if (data->isFileNames) if (data->isFileNames)
{ {
@ -88,7 +88,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_CreateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) bool SVC_CreateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_CreateStringTable* data)
{ {
return true; return true;
} }

View File

@ -13,7 +13,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_CrosshairAngle_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data) bool SVC_CrosshairAngle_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data)
{ {
bitbuf.WriteBitAngle(data->x, 16); bitbuf.WriteBitAngle(data->x, 16);
bitbuf.WriteBitAngle(data->y, 16); bitbuf.WriteBitAngle(data->y, 16);
@ -26,7 +26,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_CrosshairAngle_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data) bool SVC_CrosshairAngle_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data)
{ {
return true; return true;
} }

View File

@ -16,7 +16,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_EntityMessage_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_EntityMessage* data) bool SVC_EntityMessage_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_EntityMessage* data)
{ {
bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS); bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS);
bitbuf.WriteUBitLong(data->classID, MAX_SERVER_CLASS_BITS); bitbuf.WriteUBitLong(data->classID, MAX_SERVER_CLASS_BITS);
@ -30,7 +30,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_EntityMessage_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_EntityMessage* data) bool SVC_EntityMessage_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_EntityMessage* data)
{ {
return true; return true;
} }

View File

@ -14,7 +14,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_FixAngle_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_FixAngle* data) bool SVC_FixAngle_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_FixAngle* data)
{ {
bitbuf.WriteOneBit(data->relative); bitbuf.WriteOneBit(data->relative);
bitbuf.WriteBitAngle(data->x, 16); bitbuf.WriteBitAngle(data->x, 16);
@ -28,7 +28,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_FixAngle_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_FixAngle* data) bool SVC_FixAngle_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_FixAngle* data)
{ {
return true; return true;
} }

View File

@ -14,7 +14,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_GameEvent_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_GameEvent* data) bool SVC_GameEvent_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_GameEvent* data)
{ {
bitbuf.WriteUBitLong(data->dataLengthInBits, 11); bitbuf.WriteUBitLong(data->dataLengthInBits, 11);
bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); bitbuf.WriteBits(data->data.get(), data->dataLengthInBits);
@ -26,7 +26,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_GameEvent_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_GameEvent* data) bool SVC_GameEvent_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GameEvent* data)
{ {
return true; return true;
} }

View File

@ -28,7 +28,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_GameEventList_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_GameEventList* data) bool SVC_GameEventList_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_GameEventList* data)
{ {
bitbuf.WriteUBitLong(data->eventDescriptors.size(), MAX_EVENT_BITS); bitbuf.WriteUBitLong(data->eventDescriptors.size(), MAX_EVENT_BITS);
bitbuf.WriteUBitLong(data->dataLengthInBits, 20); bitbuf.WriteUBitLong(data->dataLengthInBits, 20);
@ -51,7 +51,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_GameEventList_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_GameEventList* data) bool SVC_GameEventList_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GameEventList* data)
{ {
return true; return true;
} }

View File

@ -11,7 +11,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_GetCvarValue_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_GetCvarValue* data) bool SVC_GetCvarValue_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_GetCvarValue* data)
{ {
bitbuf.WriteSBitLong(data->cookie, 32); bitbuf.WriteSBitLong(data->cookie, 32);
bitbuf.WriteString(data->cvarName); bitbuf.WriteString(data->cvarName);
@ -23,7 +23,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_GetCvarValue_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_GetCvarValue* data) bool SVC_GetCvarValue_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GetCvarValue* data)
{ {
return true; return true;
} }

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_HLTV_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_HLTV* data) bool SVC_HLTV_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_HLTV* data)
{ {
assert(false); assert(false);
return true; return true;
@ -22,7 +22,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_HLTV_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_HLTV* data) bool SVC_HLTV_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_HLTV* data)
{ {
assert(false); assert(false);
return true; return true;

View File

@ -26,7 +26,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_Menu_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Menu* data) bool SVC_Menu_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_Menu* data)
{ {
bitbuf.WriteShort(static_cast<uint16_t>(data->type)); bitbuf.WriteShort(static_cast<uint16_t>(data->type));
bitbuf.WriteWord(data->dataLengthInBytes); bitbuf.WriteWord(data->dataLengthInBytes);
@ -39,7 +39,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_Menu_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_Menu* data) bool SVC_Menu_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Menu* data)
{ {
return true; return true;
} }

View File

@ -27,7 +27,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_PacketEntities_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_PacketEntities* data) bool SVC_PacketEntities_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_PacketEntities* data)
{ {
bitbuf.WriteUBitLong(data->maxEntries, MAX_EDICT_BITS); bitbuf.WriteUBitLong(data->maxEntries, MAX_EDICT_BITS);
if (data->isDelta) if (data->isDelta)
@ -47,7 +47,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_PacketEntities_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_PacketEntities* data) bool SVC_PacketEntities_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_PacketEntities* data)
{ {
return true; return true;
} }

View File

@ -19,7 +19,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_Prefetch_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data) bool SVC_Prefetch_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_Prefetch* data)
{ {
if (context.protocol > 23) if (context.protocol > 23)
{ {
@ -37,7 +37,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_Prefetch_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data) bool SVC_Prefetch_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Prefetch* data)
{ {
return true; return true;
} }

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_Print_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Print* data) bool SVC_Print_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_Print* data)
{ {
bitbuf.WriteString(data->text); bitbuf.WriteString(data->text);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
@ -21,7 +21,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_Print_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_Print* data) bool SVC_Print_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Print* data)
{ {
return true; return true;
} }

View File

@ -14,7 +14,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_SendTable_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_SendTable* data) bool SVC_SendTable_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_SendTable* data)
{ {
bitbuf.WriteOneBit(data->needsDecoder); bitbuf.WriteOneBit(data->needsDecoder);
bitbuf.WriteShort(data->dataLengthInBits); bitbuf.WriteShort(data->dataLengthInBits);
@ -27,7 +27,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_SendTable_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_SendTable* data) bool SVC_SendTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SendTable* data)
{ {
return true; return true;
} }

View File

@ -35,7 +35,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_ServerInfo_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_ServerInfo* data) bool SVC_ServerInfo_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_ServerInfo* data)
{ {
bitbuf.WriteShort(data->protocol); bitbuf.WriteShort(data->protocol);
bitbuf.WriteLong(data->serverCount); bitbuf.WriteLong(data->serverCount);
@ -71,7 +71,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_ServerInfo_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_ServerInfo* data) bool SVC_ServerInfo_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_ServerInfo* data)
{ {
return true; return true;
} }

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_SetPause_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_SetPause* data) bool SVC_SetPause_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_SetPause* data)
{ {
bitbuf.WriteOneBit(data->isPaused); bitbuf.WriteOneBit(data->isPaused);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
@ -21,7 +21,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_SetPause_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_SetPause* data) bool SVC_SetPause_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SetPause* data)
{ {
return true; return true;
} }

View File

@ -11,7 +11,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_SetView_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_SetView* data) bool SVC_SetView_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_SetView* data)
{ {
bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS); bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS);
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
@ -22,7 +22,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_SetView_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_SetView* data) bool SVC_SetView_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SetView* data)
{ {
return true; return true;
} }

View File

@ -23,7 +23,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_Sounds_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Sounds* data) bool SVC_Sounds_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_Sounds* data)
{ {
if (data->reliableSound) if (data->reliableSound)
{ {
@ -45,7 +45,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_Sounds_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_Sounds* data) bool SVC_Sounds_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Sounds* data)
{ {
return true; return true;
} }

View File

@ -22,7 +22,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_TempEntities_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_TempEntities* data) bool SVC_TempEntities_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_TempEntities* data)
{ {
bitbuf.WriteUBitLong(data->numEntries, EVENT_INDEX_BITS); bitbuf.WriteUBitLong(data->numEntries, EVENT_INDEX_BITS);
if (context.protocol > 23) if (context.protocol > 23)
@ -42,7 +42,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_TempEntities_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_TempEntities* data) bool SVC_TempEntities_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_TempEntities* data)
{ {
return true; return true;
} }

View File

@ -10,7 +10,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_TerrainMod_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_TerrainMod* data) bool SVC_TerrainMod_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_TerrainMod* data)
{ {
assert(false); assert(false);
return true; return true;
@ -22,7 +22,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_TerrainMod_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_TerrainMod* data) bool SVC_TerrainMod_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_TerrainMod* data)
{ {
assert(false); assert(false);
return true; return true;

View File

@ -16,7 +16,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_UpdateStringTable_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data) bool SVC_UpdateStringTable_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data)
{ {
bitbuf.WriteUBitLong(data->tableID, math::log2(MAX_TABLES)); bitbuf.WriteUBitLong(data->tableID, math::log2(MAX_TABLES));
if (data->numChangedEntries != 1) if (data->numChangedEntries != 1)
@ -38,7 +38,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_UpdateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data) bool SVC_UpdateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data)
{ {
return true; return true;
} }

View File

@ -17,7 +17,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_UserMessage_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_UserMessage* data) bool SVC_UserMessage_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_UserMessage* data)
{ {
bitbuf.WriteByte(data->msgType); bitbuf.WriteByte(data->msgType);
bitbuf.WriteUBitLong(data->dataLengthInBits, 11); bitbuf.WriteUBitLong(data->dataLengthInBits, 11);
@ -30,7 +30,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_UserMessage_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_UserMessage* data) bool SVC_UserMessage_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_UserMessage* data)
{ {
return true; return true;
} }

View File

@ -15,7 +15,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_VoiceData_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_VoiceData* data) bool SVC_VoiceData_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_VoiceData* data)
{ {
bitbuf.WriteByte(data->fromClientIndex); bitbuf.WriteByte(data->fromClientIndex);
bitbuf.WriteByte(data->proximity); bitbuf.WriteByte(data->proximity);
@ -29,7 +29,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_VoiceData_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_VoiceData* data) bool SVC_VoiceData_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_VoiceData* data)
{ {
return true; return true;
} }

View File

@ -11,7 +11,7 @@ namespace NetHandlers
return !bitbuf.IsOverflowed(); return !bitbuf.IsOverflowed();
} }
bool SVC_VoiceInit_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_VoiceInit* data) bool SVC_VoiceInit_BitWrite_Internal(bf_write& bitbuf, const SourceGameContext& context, NetMsg::SVC_VoiceInit* data)
{ {
bitbuf.WriteString(data->voiceCodec); bitbuf.WriteString(data->voiceCodec);
bitbuf.WriteByte(data->quality); bitbuf.WriteByte(data->quality);
@ -23,7 +23,7 @@ namespace NetHandlers
return true; return true;
} }
bool SVC_VoiceInit_JsonWrite_Internal(JsonWrite& jsonbuf, SourceGameContext& context, NetMsg::SVC_VoiceInit* data) bool SVC_VoiceInit_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_VoiceInit* data)
{ {
return true; return true;
} }