remove that I can be found on ALTTPR and pep8 reformat MultiMystery.py

This commit is contained in:
Fabian Dill 2020-11-08 07:31:32 +01:00
parent 27971ee6a9
commit b2bbb77470
1 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,4 @@
__author__ = "Berserker55" # you can find me on the ALTTP Randomizer Discord __author__ = "Berserker55" # you can find me on discord.gg/8Z65BR2
""" """
This script launches a Multiplayer "Multiworld" Mystery Game This script launches a Multiplayer "Multiworld" Mystery Game
@ -63,11 +63,11 @@ if __name__ == "__main__":
host = options["server_options"]["host"] host = options["server_options"]["host"]
port = options["server_options"]["port"] port = options["server_options"]["port"]
py_version = f"{sys.version_info.major}.{sys.version_info.minor}" py_version = f"{sys.version_info.major}.{sys.version_info.minor}"
if not os.path.exists(enemizer_path): if not os.path.exists(enemizer_path):
feedback(f"Enemizer not found at {enemizer_path}, please adjust the path in MultiMystery.py's config or put Enemizer in the default location.") feedback(
f"Enemizer not found at {enemizer_path}, please adjust the path in MultiMystery.py's config or put Enemizer in the default location.")
if not os.path.exists(rom_file): if not os.path.exists(rom_file):
feedback(f"Base rom is expected as {rom_file} in the Multiworld root folder please place/rename it there.") feedback(f"Base rom is expected as {rom_file} in the Multiworld root folder please place/rename it there.")
player_files = [] player_files = []
@ -82,7 +82,6 @@ if __name__ == "__main__":
for i, file in enumerate(player_files, 1): for i, file in enumerate(player_files, 1):
player_string += f"--p{i} \"{os.path.join(player_files_path, file)}\" " player_string += f"--p{i} \"{os.path.join(player_files_path, file)}\" "
if os.path.exists("BerserkerMultiServer.exe"): if os.path.exists("BerserkerMultiServer.exe"):
basemysterycommand = "BerserkerMystery.exe" # compiled windows basemysterycommand = "BerserkerMystery.exe" # compiled windows
elif os.path.exists("BerserkerMultiServer"): elif os.path.exists("BerserkerMultiServer"):
@ -90,14 +89,12 @@ if __name__ == "__main__":
else: else:
basemysterycommand = f"py -{py_version} Mystery.py" # source basemysterycommand = f"py -{py_version} Mystery.py" # source
weights_file_path = os.path.join(player_files_path, weights_file_path) weights_file_path = os.path.join(player_files_path, weights_file_path)
if os.path.exists(weights_file_path): if os.path.exists(weights_file_path):
target_player_count = max(len(player_files), target_player_count) target_player_count = max(len(player_files), target_player_count)
else: else:
target_player_count = len(player_files) target_player_count = len(player_files)
if target_player_count == 0: if target_player_count == 0:
feedback(f"No player files found. Please put them in a {player_files_path} folder.") feedback(f"No player files found. Please put them in a {player_files_path} folder.")
else: else:
@ -148,6 +145,7 @@ if __name__ == "__main__":
if any((zip_roms, zip_multidata, zip_spoiler, zip_diffs)): if any((zip_roms, zip_multidata, zip_spoiler, zip_diffs)):
import zipfile import zipfile
compression = {1: zipfile.ZIP_DEFLATED, compression = {1: zipfile.ZIP_DEFLATED,
2: zipfile.ZIP_LZMA, 2: zipfile.ZIP_LZMA,
3: zipfile.ZIP_BZIP2}[zip_format] 3: zipfile.ZIP_BZIP2}[zip_format]
@ -226,5 +224,6 @@ if __name__ == "__main__":
subprocess.call(f"{baseservercommand} --multidata {os.path.join(output_path, multidataname)}") subprocess.call(f"{baseservercommand} --multidata {os.path.join(output_path, multidataname)}")
except: except:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
input("Press enter to close") input("Press enter to close")