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 time
import uuid
import argparse
from pathlib import Path
# 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 .item import item_names, item_parents, race_to_item_type
from .item.item_annotations import ITEM_NAME_ANNOTATIONS
@@ -1298,20 +1299,15 @@ class CompatItemHolder(typing.NamedTuple):
quantity: int = 1
def parse_uri(uri: str) -> str:
if "://" in uri:
uri = uri.split("://", 1)[1]
return uri.split('?', 1)[0]
async def main():
async def main(args: typing.Sequence[str] | None):
multiprocessing.freeze_support()
parser = get_base_parser()
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://'):
args.connect = parse_uri(' '.join(uri))
args.url = uri[0]
handle_url_arg(args, parser)
ctx = SC2Context(args.connect, args.password)
ctx.auth = args.name
@@ -2346,7 +2342,7 @@ def force_settings_save_on_close() -> None:
_has_forced_save = True
def launch():
def launch(*args: str):
colorama.just_fix_windows_console()
asyncio.run(main())
asyncio.run(main(args))
colorama.deinit()

View File

@@ -170,7 +170,7 @@ class TwoStartPositions(Toggle):
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.
"""
display_name = "Start with two unlocked missions on grid"
display_name = "Two start missions"
default = Toggle.option_false
@@ -1053,7 +1053,7 @@ class VictoryCache(Range):
Controls how many additional checks are awarded for completing a mission.
Goal missions are unaffected by this option.
"""
display_name = "Victory Checks"
display_name = "Victory Cache"
range_start = 0
range_end = 10
default = 0