Implemented json write funcs for netmessages

This commit is contained in:
Jordan Cristiano
2015-06-24 23:59:39 -04:00
parent 65a03fdf79
commit fea8bf485c
31 changed files with 281 additions and 30 deletions

View File

@ -1,6 +1,7 @@
#include "svc_usermessage.h"
#include "sourcesdk/bitbuf.h"
#include "base/bitfile.h"
#include "base/jsonfile.h"
#include "netmath.h"
#include "netcontants.h"
#include <cassert>
@ -32,6 +33,11 @@ namespace NetHandlers
bool SVC_UserMessage_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_UserMessage* data)
{
jsonbuf.StartObject("svc_usermessage");
jsonbuf.WriteUInt32("msgType", data->msgType);
jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits);
jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits);
jsonbuf.EndObject();
return true;
}