mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
WebHost: Add game listing for all players on room info page.
This commit is contained in:

committed by
Fabian Dill

parent
1f4ddc295a
commit
3508cf21c7
@@ -62,12 +62,19 @@ def upload_zip_to_db(zfile: zipfile.ZipFile, owner=None, meta={"race": False}, s
|
||||
elif file.filename.endswith(".archipelago"):
|
||||
try:
|
||||
multidata = zfile.open(file).read()
|
||||
MultiServer.Context._decompress(multidata)
|
||||
except:
|
||||
flash("Could not load multidata. File may be corrupted or incompatible.")
|
||||
multidata = None
|
||||
|
||||
if multidata:
|
||||
decompressed_multidata = MultiServer.Context._decompress(multidata)
|
||||
leftover_names = [(name, decompressed_multidata["names"][0].index(name) + 1) for name in
|
||||
decompressed_multidata["names"][0] if name not in [slot.player_name for slot in slots]]
|
||||
newslots = [(Slot(data=None, player_name=name, player_id=slot, game=decompressed_multidata["games"][slot]))
|
||||
for name, slot in leftover_names]
|
||||
for slot in newslots:
|
||||
slots.add(slot)
|
||||
|
||||
flush() # commit slots
|
||||
seed = Seed(multidata=multidata, spoiler=spoiler, slots=slots, owner=owner, meta=json.dumps(meta),
|
||||
id=sid if sid else uuid.uuid4())
|
||||
|
Reference in New Issue
Block a user