allow uploading of Factorio mods

This commit is contained in:
Fabian Dill
2021-05-16 22:59:45 +02:00
parent a1d7bc558c
commit 1f17aa394e
5 changed files with 23 additions and 5 deletions

View File

@@ -57,6 +57,12 @@ def uploads():
player_id=metadata["player_id"],
game="Minecraft"))
elif file.filename.endswith(".zip"):
# Factorio mods needs a specific name or they do no function
_, seed_name, slot_id, slot_name = file.filename.rsplit("_", 1)[0].split("-")
slots.add(Slot(data=zfile.open(file, "r").read(), player_name=slot_name,
player_id=int(slot_id[1:]), game="Factorio"))
elif file.filename.endswith(".txt"):
spoiler = zfile.open(file, "r").read().decode("utf-8-sig")
elif file.filename.endswith(".archipelago"):