implement syncing world to file on disk

This commit is contained in:
p2r3
2025-08-29 02:49:41 +03:00
parent e4267e7edf
commit 728d49f7b6
6 changed files with 215 additions and 3 deletions

21
include/serialize.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef SERIALIZE_H
#define SERIALIZE_H
#include <stdlib.h>
#include "globals.h"
#if defined(SYNC_WORLD_TO_DISK) && !defined(ESP_PLATFORM)
int initSerializer ();
void writeBlockChangesToDisk (int from, int to);
void writeChestChangesToDisk (uint8_t *storage_ptr, uint8_t slot);
void writePlayerDataToDisk ();
#else
// Define no-op placeholders for when disk syncing isn't enabled
#define writeBlockChangesToDisk(a, b)
#define writeChestChangesToDisk(a, b)
#define writePlayerDataToDisk()
#define initSerializer() 0
#endif
#endif