From 76f6eb1434d349116142e6cb693724a3d3f3fc4c Mon Sep 17 00:00:00 2001 From: jsd1982 Date: Fri, 8 Jul 2022 09:36:14 -0500 Subject: [PATCH 1/3] SNIClient: update default SNI port from 8080 to 23074 --- SNIClient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SNIClient.py b/SNIClient.py index e313feff00..151a68da11 100644 --- a/SNIClient.py +++ b/SNIClient.py @@ -62,7 +62,7 @@ class SNIClientCommandProcessor(ClientCommandProcessor): def _cmd_snes(self, snes_options: str = "") -> bool: """Connect to a snes. Optionally include network address of a snes to connect to, otherwise show available devices; and a SNES device number if more than one SNES is detected. - Examples: "/snes", "/snes 1", "/snes localhost:8080 1" """ + Examples: "/snes", "/snes 1", "/snes localhost:23074 1" """ snes_address = self.ctx.snes_address snes_device_number = -1 @@ -1296,7 +1296,7 @@ async def main(): parser = get_base_parser() parser.add_argument('diff_file', default="", type=str, nargs="?", help='Path to a Archipelago Binary Patch file') - parser.add_argument('--snes', default='localhost:8080', help='Address of the SNI server.') + parser.add_argument('--snes', default='localhost:23074', help='Address of the SNI server.') parser.add_argument('--loglevel', default='info', choices=['debug', 'info', 'warning', 'error', 'critical']) args = parser.parse_args() From aa954b776d8fabffde060ba240e7c7114db8c38e Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 3 Jul 2022 14:03:49 +0200 Subject: [PATCH 2/3] MultiServer: add /status and allow status command to dynamically filter for Tags --- MultiServer.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 06f9a9f9cd..dd695fc1bb 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -720,16 +720,16 @@ def get_players_string(ctx: Context): return f'{len(auth_clients)} players of {total} connected ' + text[:-1] -def get_status_string(ctx: Context, team: int): - text = "Player Status on your team:" +def get_status_string(ctx: Context, team: int, tag: str): + text = f"Player Status on team {team}:" for slot in ctx.locations: connected = len(ctx.clients[team][slot]) - death_link = len([client for client in ctx.clients[team][slot] if "DeathLink" in client.tags]) + tagged = len([client for client in ctx.clients[team][slot] if tag in client.tags]) completion_text = f"({len(ctx.location_checks[team, slot])}/{len(ctx.locations[slot])})" - death_text = f" {death_link} of which are death link" if connected else "" + tag_text = f" {tagged} of which are tagged {tag}" if connected and tag else "" goal_text = " and has finished." if ctx.client_game_state[team, slot] == ClientStatus.CLIENT_GOAL else "." text += f"\n{ctx.get_aliased_name(team, slot)} has {connected} connection{'' if connected == 1 else 's'}" \ - f"{death_text}{goal_text} {completion_text}" + f"{tag_text}{goal_text} {completion_text}" return text @@ -1113,9 +1113,11 @@ class ClientMessageProcessor(CommonCommandProcessor): self.output(get_players_string(self.ctx)) return True - def _cmd_status(self) -> bool: - """Get status information about your team.""" - self.output(get_status_string(self.ctx, self.client.team)) + def _cmd_status(self, tag:str="") -> bool: + """Get status information about your team. + Optionally mention a Tag name and get information on who has that Tag. + For example: DeathLink or EnergyLink.""" + self.output(get_status_string(self.ctx, self.client.team, tag)) return True def _cmd_release(self) -> bool: @@ -1657,6 +1659,14 @@ class ServerCommandProcessor(CommonCommandProcessor): self.output(get_players_string(self.ctx)) return True + def _cmd_status(self, tag: str = "") -> bool: + """Get status information about teams. + Optionally mention a Tag name and get information on who has that Tag. + For example: DeathLink or EnergyLink.""" + for team in self.ctx.clients: + self.output(get_status_string(self.ctx, team, tag)) + return True + def _cmd_exit(self) -> bool: """Shutdown the server""" asyncio.create_task(self.ctx.server.ws_server._close()) From 8e15fe51b6b2c0360791a0c1a3fc5c64bda2fd17 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Fri, 15 Jul 2022 06:54:29 +0200 Subject: [PATCH 3/3] Put common options first (#774) * this applies to yaml and webhost * this allows overwriting common options from the world --- WebHostLib/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebHostLib/options.py b/WebHostLib/options.py index 203f223561..2cab7728da 100644 --- a/WebHostLib/options.py +++ b/WebHostLib/options.py @@ -60,7 +60,7 @@ def create(): for game_name, world in AutoWorldRegister.world_types.items(): - all_options = {**world.options, **Options.per_game_common_options} + all_options = {**Options.per_game_common_options, **world.options} res = Template(open(os.path.join("WebHostLib", "templates", "options.yaml")).read()).render( options=all_options, __version__=__version__, game=game_name, yaml_dump=yaml.dump,