diff --git a/Fill.py b/Fill.py index 5bbbfa79c2..a040794fd1 100644 --- a/Fill.py +++ b/Fill.py @@ -531,7 +531,8 @@ def distribute_items_restrictive(multiworld: MultiWorld, if progitempool: raise FillError( f"Not enough locations for progression items. " - f"There are {len(progitempool)} more progression items than there are available locations.", + f"There are {len(progitempool)} more progression items than there are available locations.\n" + f"Unfilled locations:\n{multiworld.get_unfilled_locations()}.", multiworld=multiworld, ) accessibility_corrections(multiworld, multiworld.state, defaultlocations) diff --git a/SNIClient.py b/SNIClient.py index 19440e1dc5..9140c73c14 100644 --- a/SNIClient.py +++ b/SNIClient.py @@ -243,6 +243,9 @@ class SNIContext(CommonContext): # Once the games handled by SNIClient gets made to be remote items, # this will no longer be needed. async_start(self.send_msgs([{"cmd": "LocationScouts", "locations": list(new_locations)}])) + + if self.client_handler is not None: + self.client_handler.on_package(self, cmd, args) def run_gui(self) -> None: from kvui import GameManager diff --git a/worlds/AutoSNIClient.py b/worlds/AutoSNIClient.py index f9444eee73..28515d90c4 100644 --- a/worlds/AutoSNIClient.py +++ b/worlds/AutoSNIClient.py @@ -86,3 +86,7 @@ class SNIClient(abc.ABC, metaclass=AutoSNIClientRegister): async def deathlink_kill_player(self, ctx: SNIContext) -> None: """ override this with implementation to kill player """ pass + + def on_package(self, ctx: SNIContext, cmd: str, args: Dict[str, Any]) -> None: + """ override this with code to handle packages from the server """ + pass diff --git a/worlds/LauncherComponents.py b/worlds/LauncherComponents.py index 7f178f1739..d1b274c19a 100644 --- a/worlds/LauncherComponents.py +++ b/worlds/LauncherComponents.py @@ -18,16 +18,42 @@ class Type(Enum): class Component: + """ + A Component represents a process launchable by Archipelago Launcher, either by a User action in the GUI, + by resolving an archipelago://user:pass@host:port link from the WebHost, by resolving a patch file's metadata, + or by using a component name arg while running the Launcher in CLI i.e. `ArchipelagoLauncher.exe "Text Client"` + + Expected to be appended to LauncherComponents.component list to be used. + """ display_name: str + """Used as the GUI button label and the component name in the CLI args""" type: Type + """ + Enum "Type" classification of component intent, for filtering in the Launcher GUI + If not set in the constructor, it will be inferred by display_name + """ script_name: Optional[str] + """Recommended to use func instead; Name of file to run when the component is called""" frozen_name: Optional[str] + """Recommended to use func instead; Name of the frozen executable file for this component""" icon: str # just the name, no suffix + """Lookup ID for the icon path in LauncherComponents.icon_paths""" cli: bool + """Bool to control if the component gets launched in an appropriate Terminal for the OS""" func: Optional[Callable] + """ + Function that gets called when the component gets launched + Any arg besides the component name arg is passed into the func as well, so handling *args is suggested + """ file_identifier: Optional[Callable[[str], bool]] + """ + Function that is run against patch file arg to identify which component is appropriate to launch + If the function is an Instance of SuffixIdentifier the suffixes will also be valid for the Open Patch component + """ game_name: Optional[str] + """Game name to identify component when handling launch links from WebHost""" supports_uri: Optional[bool] + """Bool to identify if a component supports being launched by launch links from WebHost""" def __init__(self, display_name: str, script_name: Optional[str] = None, frozen_name: Optional[str] = None, cli: bool = False, icon: str = 'icon', component_type: Optional[Type] = None, diff --git a/worlds/generic/docs/commands_en.md b/worlds/generic/docs/commands_en.md index 317f724109..3848bb4c50 100644 --- a/worlds/generic/docs/commands_en.md +++ b/worlds/generic/docs/commands_en.md @@ -27,6 +27,7 @@ including the exclamation point. - `!countdown ` Starts a countdown using the given seconds value. Useful for synchronizing starts. Defaults to 10 seconds if no argument is provided. - `!alias ` Sets your alias, which allows you to use commands with the alias rather than your provided name. + `!alias` on its own will reset the alias to the player's original name. - `!admin ` Executes a command as if you typed it into the server console. Remote administration must be enabled. @@ -65,6 +66,7 @@ including the exclamation point. argument is provided. - `/option