From 48431610294b3f48a5f5f8a2ac92c7a378c114bb Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 10 Mar 2016 02:30:22 +0100 Subject: [PATCH] Server: Add save hook. --- server/config/io.py | 3 ++- server/io.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/config/io.py b/server/config/io.py index 4631638..dabe255 100644 --- a/server/config/io.py +++ b/server/config/io.py @@ -31,5 +31,6 @@ io_db = { ["MAP_LENGTH", "world_int"], [write_fov_map, "func"], [write_mem_map, "func"] - ] + ], + "hook_save": lambda: "", } diff --git a/server/io.py b/server/io.py index ce3ee1a..5e02ed4 100644 --- a/server/io.py +++ b/server/io.py @@ -212,6 +212,7 @@ def save_world(): string = string + "T_ID " + str(tid) + "\n" for carried in sorted(world_db["Things"][tid]["T_CARRIES"]): string = string + "T_CARRIES " + str(carried) + "\n" + string = string + io_db["hook_save"]() string = string + "SEED_RANDOMNESS " + str(rand.seed) + "\n" + \ "WORLD_ACTIVE " + str(world_db["WORLD_ACTIVE"]) atomic_write(io_db["path_save"], string) -- 2.30.2