mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
inventory regions, minor refactor
This commit is contained in:
parent
a57fba4fa4
commit
49fdcdfb27
29 changed files with 259 additions and 160 deletions
|
|
@ -56,7 +56,11 @@ static void to_binary(ByteBuilder& builder, const Value* value) {
|
|||
static List* array_from_binary(ByteReader& reader);
|
||||
static Map* object_from_binary(ByteReader& reader);
|
||||
|
||||
std::vector<ubyte> json::to_binary(const Map* obj) {
|
||||
std::vector<ubyte> json::to_binary(const Map* obj, bool compress) {
|
||||
if (compress) {
|
||||
auto bytes = to_binary(obj, false);
|
||||
return gzip::compress(bytes.data(), bytes.size());
|
||||
}
|
||||
ByteBuilder builder;
|
||||
// type byte
|
||||
builder.put(BJSON_TYPE_DOCUMENT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue