mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
stronger compression and compatibility on multidata
This commit is contained in:
2
Main.py
2
Main.py
@@ -245,7 +245,7 @@ def main(args, seed=None):
|
|||||||
for location in world.get_filled_locations() if
|
for location in world.get_filled_locations() if
|
||||||
type(location.address) is int],
|
type(location.address) is int],
|
||||||
"server_options": get_options()["server_options"]
|
"server_options": get_options()["server_options"]
|
||||||
}).encode("utf-8"))
|
}).encode("utf-8"), 9)
|
||||||
if args.jsonout:
|
if args.jsonout:
|
||||||
jsonout["multidata"] = list(multidata)
|
jsonout["multidata"] = list(multidata)
|
||||||
else:
|
else:
|
||||||
|
@@ -1044,7 +1044,7 @@ async def main(args: argparse.Namespace):
|
|||||||
ctx.data_filename = tkinter.filedialog.askopenfilename(filetypes=(("Multiworld data","*multidata"),))
|
ctx.data_filename = tkinter.filedialog.askopenfilename(filetypes=(("Multiworld data","*multidata"),))
|
||||||
|
|
||||||
with open(ctx.data_filename, 'rb') as f:
|
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 team, names in enumerate(jsonobj['names']):
|
||||||
for player, name in enumerate(names, 1):
|
for player, name in enumerate(names, 1):
|
||||||
ctx.player_names[(team, player)] = name
|
ctx.player_names[(team, player)] = name
|
||||||
@@ -1052,7 +1052,7 @@ async def main(args: argparse.Namespace):
|
|||||||
ctx.remote_items = set(jsonobj['remote_items'])
|
ctx.remote_items = set(jsonobj['remote_items'])
|
||||||
ctx.locations = {tuple(k): tuple(v) for k, v in jsonobj['locations']}
|
ctx.locations = {tuple(k): tuple(v) for k, v in jsonobj['locations']}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error('Failed to read multiworld data (%s)' % e)
|
logging.exception('Failed to read multiworld data (%s)' % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
ip = args.host if args.host else Utils.get_public_ipv4()
|
ip = args.host if args.host else Utils.get_public_ipv4()
|
||||||
|
Reference in New Issue
Block a user