X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=roguelike-server;h=57f0b6c1bc737dd92c8ebd3e14fa9bca2697c662;hb=b36bacf2869c51bbbfe628ad431080971fab409c;hp=b9eb86bc140cb2e48866cee3e28edcb5c53986ae;hpb=ff36c2a8f2d46499491ce1be1eba5e0be6f9ca5a;p=plomrogue diff --git a/roguelike-server b/roguelike-server index b9eb86b..57f0b6c 100755 --- a/roguelike-server +++ b/roguelike-server @@ -222,7 +222,7 @@ def save_world(): for id in sorted(world_db["Things"].keys()): if [] != world_db["Things"][id]["T_CARRIES"]: string = string + "T_ID " + str(id) + "\n" - for carried in sorted(world_db["Things"][id]["T_CARRIES"].keys()): + for carried in sorted(world_db["Things"][id]["T_CARRIES"]): string = string + "T_CARRIES " + str(carried) + "\n" string = string + "SEED_RANDOMNESS " + str(rand.seed) + "\n" + \ "WORLD_ACTIVE " + str(world_db["WORLD_ACTIVE"]) @@ -625,8 +625,8 @@ def actor_move(t): if t == world_db["Things"][0]: hitted_type = world_db["Things"][hit_id]["T_TYPE"] hitted_name = world_db["ThingTypes"][hitted_type]["TT_NAME"] - strong_write(io_db["file_out"], "LOG You wound " + hitted + - ".\n") + strong_write(io_db["file_out"], "LOG You wound " + + hitted_name + ".\n") elif 0 == hit_id: hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"] strong_write(io_db["file_out"], "LOG " + hitter_name + @@ -1111,8 +1111,9 @@ def command_ping(): def command_quit(): """Abort server process.""" - save_world() - atomic_write(io_db["path_record"], io_db["record_chunk"], do_append=True) + if None == opts.replay: + save_world() + atomic_write(io_db["path_record"], io_db["record_chunk"], do_append=True) raise SystemExit("received QUIT command")