From 74b1688427240eefa2a729caf9af528c5772c6c8 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 8 Mar 2020 15:34:35 +0100 Subject: [PATCH] Allow diff files to be created from the command line --- EntranceRandomizer.py | 3 +++ Main.py | 6 +++++- host.yaml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/EntranceRandomizer.py b/EntranceRandomizer.py index 26b7db66..f8f96a5e 100755 --- a/EntranceRandomizer.py +++ b/EntranceRandomizer.py @@ -274,6 +274,9 @@ def parse_arguments(argv, no_defaults=False): parser.add_argument('--outputpath') parser.add_argument('--race', default=defval(False), action='store_true') parser.add_argument('--outputname') + parser.add_argument('--create_diff', default=defval(False), action='store_true', help='''\ + create a binary patch file from which the randomized rom can be recreated using MultiClient. + Does not work with jsonout.''') if multiargs.multi: for player in range(1, multiargs.multi + 1): diff --git a/Main.py b/Main.py index 4ffbb2c5..0098b3dd 100644 --- a/Main.py +++ b/Main.py @@ -218,7 +218,11 @@ def main(args, seed=None): 'random'] else "", "-nohints" if not world.hints[ player] else "")) if not args.outputname else '' - rom.write_to_file(output_path(f'{outfilebase}{outfilepname}{outfilesuffix}.sfc')) + rompath = output_path(f'{outfilebase}{outfilepname}{outfilesuffix}.sfc') + rom.write_to_file(rompath) + if args.create_diff: + import Patch + Patch.create_patch_file(rompath) return (player, team, list(rom.name)) if not args.suppress_rom: diff --git a/host.yaml b/host.yaml index 6af92b86..b5933951 100644 --- a/host.yaml +++ b/host.yaml @@ -13,7 +13,7 @@ server_options: disable_save: null loglevel: null #disallow automatically forwarding the port that is used, then closing that port on shutdown - disable_port_forward: null + disable_port_forward: true #Disallow !getitem. Old /getitem cannot be blocked this way disable_item_cheat: null #Client hint system