From aa3eb6a3f8727c4bac21fc393c005250623b01a7 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 8 May 2020 23:09:56 +0200 Subject: [PATCH] stronger compression and compatibility on multidata --- Main.py | 2 +- MultiServer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Main.py b/Main.py index 4e7e5c01..c6041bdf 100644 --- a/Main.py +++ b/Main.py @@ -245,7 +245,7 @@ def main(args, seed=None): for location in world.get_filled_locations() if type(location.address) is int], "server_options": get_options()["server_options"] - }).encode("utf-8")) + }).encode("utf-8"), 9) if args.jsonout: jsonout["multidata"] = list(multidata) else: diff --git a/MultiServer.py b/MultiServer.py index 1a8243c0..3f949ddb 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1044,7 +1044,7 @@ async def main(args: argparse.Namespace): ctx.data_filename = tkinter.filedialog.askopenfilename(filetypes=(("Multiworld data","*multidata"),)) with open(ctx.data_filename, 'rb') as f: - jsonobj = json.loads(zlib.decompress(f.read()).decode("utf-8")) + jsonobj = json.loads(zlib.decompress(f.read()).decode("utf-8-sig")) for team, names in enumerate(jsonobj['names']): for player, name in enumerate(names, 1): ctx.player_names[(team, player)] = name @@ -1052,7 +1052,7 @@ async def main(args: argparse.Namespace): ctx.remote_items = set(jsonobj['remote_items']) ctx.locations = {tuple(k): tuple(v) for k, v in jsonobj['locations']} except Exception as e: - logging.error('Failed to read multiworld data (%s)' % e) + logging.exception('Failed to read multiworld data (%s)' % e) return ip = args.host if args.host else Utils.get_public_ipv4()