Allow diff files to be created from the command line

This commit is contained in:
Fabian Dill 2020-03-08 15:34:35 +01:00
parent 74c7eca301
commit 74b1688427
3 changed files with 9 additions and 2 deletions

View File

@ -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):

View File

@ -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:

View File

@ -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