From: Christian Heller Date: Thu, 10 Mar 2016 01:30:22 +0000 (+0100) Subject: Server: Add save hook. X-Git-Tag: tce~54 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdb.prefix%7D%7D/%7B%7Bitem_name%7D%7D?a=commitdiff_plain;h=48431610294b3f48a5f5f8a2ac92c7a378c114bb;p=plomrogue Server: Add save hook. --- 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)