1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

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

View File

@@ -31,6 +31,7 @@
#include "worldgen.h"
#include "registries.h"
#include "procedures.h"
#include "serialize.h"
void handlePacket (int client_fd, int length, int packet_id, int state) {
@@ -456,10 +457,12 @@ int main () {
for (int i = 3; i >= 0; i --) printf("%X", (unsigned int)((rng_seed >> (8 * i)) & 255));
printf("\n\n");
for (int i = 0; i < sizeof(block_changes) / sizeof(BlockChange); i ++) {
for (int i = 0; i < MAX_BLOCK_CHANGES; i ++) {
block_changes[i].block = 0xFF;
}
if (initSerializer()) exit(EXIT_FAILURE);
int server_fd, opt = 1;
struct sockaddr_in server_addr, client_addr;
socklen_t addr_len = sizeof(client_addr);