SC2: Launcher bugfixes after content merge (#5409)

* sc2: Fixing Launcher.py launch not properly handling command-line arguments

* sc2: Fixing some old option names in webhost

* sc2: Switching to common client url parameter handling
This commit is contained in:
Phaneros
2025-09-30 09:34:26 -07:00
committed by GitHub
parent 1d2ad1f9c9
commit 92ff0ddba8
2 changed files with 10 additions and 14 deletions

View File

@@ -21,10 +21,11 @@ import random
import concurrent.futures import concurrent.futures
import time import time
import uuid import uuid
import argparse
from pathlib import Path from pathlib import Path
# CommonClient import first to trigger ModuleUpdater # CommonClient import first to trigger ModuleUpdater
from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser, handle_url_arg
from Utils import init_logging, is_windows, async_start from Utils import init_logging, is_windows, async_start
from .item import item_names, item_parents, race_to_item_type from .item import item_names, item_parents, race_to_item_type
from .item.item_annotations import ITEM_NAME_ANNOTATIONS from .item.item_annotations import ITEM_NAME_ANNOTATIONS
@@ -1298,20 +1299,15 @@ class CompatItemHolder(typing.NamedTuple):
quantity: int = 1 quantity: int = 1
def parse_uri(uri: str) -> str: async def main(args: typing.Sequence[str] | None):
if "://" in uri:
uri = uri.split("://", 1)[1]
return uri.split('?', 1)[0]
async def main():
multiprocessing.freeze_support() multiprocessing.freeze_support()
parser = get_base_parser() parser = get_base_parser()
parser.add_argument('--name', default=None, help="Slot Name to connect as.") parser.add_argument('--name', default=None, help="Slot Name to connect as.")
args, uri = parser.parse_known_args() args, uri = parser.parse_known_args(args)
if uri and uri[0].startswith('archipelago://'): if uri and uri[0].startswith('archipelago://'):
args.connect = parse_uri(' '.join(uri)) args.url = uri[0]
handle_url_arg(args, parser)
ctx = SC2Context(args.connect, args.password) ctx = SC2Context(args.connect, args.password)
ctx.auth = args.name ctx.auth = args.name
@@ -2346,7 +2342,7 @@ def force_settings_save_on_close() -> None:
_has_forced_save = True _has_forced_save = True
def launch(): def launch(*args: str):
colorama.just_fix_windows_console() colorama.just_fix_windows_console()
asyncio.run(main()) asyncio.run(main(args))
colorama.deinit() colorama.deinit()

View File

@@ -170,7 +170,7 @@ class TwoStartPositions(Toggle):
If turned on and 'grid', 'hopscotch', or 'golden_path' mission orders are selected, If turned on and 'grid', 'hopscotch', or 'golden_path' mission orders are selected,
removes the first mission and allows both of the next two missions to be played from the start. removes the first mission and allows both of the next two missions to be played from the start.
""" """
display_name = "Start with two unlocked missions on grid" display_name = "Two start missions"
default = Toggle.option_false default = Toggle.option_false
@@ -1053,7 +1053,7 @@ class VictoryCache(Range):
Controls how many additional checks are awarded for completing a mission. Controls how many additional checks are awarded for completing a mission.
Goal missions are unaffected by this option. Goal missions are unaffected by this option.
""" """
display_name = "Victory Checks" display_name = "Victory Cache"
range_start = 0 range_start = 0
range_end = 10 range_end = 10
default = 0 default = 0