From 959917bb13ae9dfaae07f3357f4923a61c679ad7 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Thu, 2 Apr 2020 10:40:38 -0700 Subject: [PATCH] Print host instead of ip address if host is specified. Also embed specified host into bmbp files. (#57) --- MultiMystery.py | 3 ++- MultiServer.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MultiMystery.py b/MultiMystery.py index bf0497ee..961afe78 100644 --- a/MultiMystery.py +++ b/MultiMystery.py @@ -51,6 +51,7 @@ if __name__ == "__main__": meta_file_path = multi_mystery_options["meta_file_path"] teams = multi_mystery_options["teams"] rom_file = options["general_options"]["rom_file"] + host = options["server_options"]["host"] port = options["server_options"]["port"] @@ -143,7 +144,7 @@ if __name__ == "__main__": zipname = os.path.join(output_path, f"ER_{seedname}.{typical_zip_ending}") print(f"Creating zipfile {zipname}") - ipv4 = get_public_ipv4() + ":" + str(port) + ipv4 = (host if host else get_public_ipv4()) + ":" + str(port) with zipfile.ZipFile(zipname, "w", compression=compression, compresslevel=9) as zf: for file in os.listdir(output_path): if file.endswith(".sfc") and seedname in file: diff --git a/MultiServer.py b/MultiServer.py index eccff905..79778564 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -670,7 +670,7 @@ async def main(args: argparse.Namespace): logging.error('Failed to read multiworld data (%s)' % e) return - ip = Utils.get_public_ipv4() + ip = args.host if args.host else Utils.get_public_ipv4()