Factor out packet deserialisation functions into common file

This commit is contained in:
Jonathan G Rennison
2022-12-07 19:01:44 +00:00
parent c29b395357
commit f1f73ddd6e
4 changed files with 199 additions and 157 deletions

View File

@@ -9,6 +9,7 @@
#include "../stdafx.h"
#include "serialisation.hpp"
#include "../string_func_extra.h"
/**
* Is it safe to write to the packet, i.e. didn't we run over the buffer?
@@ -135,3 +136,8 @@ void BufferSend_binary(std::vector<byte> &buffer, size_t limit, const char *data
assert(BufferCanWriteToPacket(buffer, limit, size));
buffer.insert(buffer.end(), data, data + size);
}
void BufferRecvStringValidate(std::string &buffer, StringValidationSettings settings)
{
StrMakeValidInPlace(buffer, settings);
}