change pretty much everything so it does what I want :^)
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
|
||||
#include "dem_consolecmd.h"
|
||||
#include "demofile/demofile.h"
|
||||
#include "base/jsonfile.h"
|
||||
|
||||
namespace DemHandlers
|
||||
{
|
||||
@ -12,31 +11,4 @@ namespace DemHandlers
|
||||
data->command.assign(command);
|
||||
return demofile.IsOk();
|
||||
}
|
||||
|
||||
bool Dem_ConsoleCmd_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_ConsoleCmd* data)
|
||||
{
|
||||
const uint8_t* command = reinterpret_cast<const uint8_t*>(data->command.data());
|
||||
demofile.WriteRawData(command, data->command.length() + 1);
|
||||
return demofile.IsOk();
|
||||
}
|
||||
|
||||
bool Dem_ConsoleCmd_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_ConsoleCmd* data)
|
||||
{
|
||||
base::JsonReaderObject reader = jsonbuf.ParseObject();
|
||||
assert(!reader.HasReadError());
|
||||
|
||||
char command[DemMsg::Dem_ConsoleCmd::COMMAND_MAX_LENGTH];
|
||||
reader.ReadString("command", command, sizeof(command));
|
||||
data->command.assign(command);
|
||||
return !reader.HasReadError();
|
||||
}
|
||||
|
||||
bool Dem_ConsoleCmd_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_ConsoleCmd* data)
|
||||
{
|
||||
jsonbuf.Reset();
|
||||
jsonbuf.StartObject();
|
||||
jsonbuf.WriteString("command", data->command);
|
||||
jsonbuf.EndObject();
|
||||
return jsonbuf.IsComplete();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user