From 840e6341619a06ff02c75ddd99d438d4dda661f6 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 18 Feb 2022 18:54:26 +0100 Subject: [PATCH] update docs with NetworkSlot and create_as_hint --- Utils.py | 4 ++-- docs/network protocol.md | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Utils.py b/Utils.py index b74e4d69..911e4358 100644 --- a/Utils.py +++ b/Utils.py @@ -182,7 +182,7 @@ def get_default_options() -> dict: "output_path": "output", }, "factorio_options": { - "executable": "factorio\\bin\\x64\\factorio", + "executable": os.path.join("factorio", "bin", "x64", "factorio"), }, "sm_options": { "rom_file": "Super Metroid (JU).sfc", @@ -219,7 +219,7 @@ def get_default_options() -> dict: }, "generator": { "teams": 1, - "enemizer_path": "EnemizerCLI/EnemizerCLI.Core.exe", + "enemizer_path": os.path.join("EnemizerCLI", "EnemizerCLI.Core.exe"), "player_files_path": "Players", "players": 0, "weights_file_path": "weights.yaml", diff --git a/docs/network protocol.md b/docs/network protocol.md index 4c10ea6a..fa74ec8a 100644 --- a/docs/network protocol.md +++ b/docs/network protocol.md @@ -119,6 +119,7 @@ Sent to clients when the connection handshake is successfully completed. | missing_locations | list\[int\] | Contains ids of remaining locations that need to be checked. Useful for trackers, among other things. | | checked_locations | list\[int\] | Contains ids of all locations that have been checked. Useful for trackers, among other things. Location ids are in the range of ± 253-1. | | slot_data | dict | Contains a json object for slot related data, differs per game. Empty if not required. | +| slot_info | dict\[int, NetworkSlot\] | maps each slot to a NetworkSlot information | ### ReceivedItems Sent to clients when they receive an item. @@ -262,6 +263,7 @@ Sent to the server to inform it of locations the client has seen, but not checke | Name | Type | Notes | | ---- | ---- | ----- | | locations | list\[int\] | The ids of the locations seen by the client. May contain any number of locations, even ones sent before; duplicates do not cause issues with the Archipelago server. | +| create_as_hint | bool | If True, the scouted locations get created and broadcasted as a player-visible hint. | ### StatusUpdate Sent to the server to update on the sender's status. Examples include readiness or goal completion. (Example: defeated Ganon in A Link to the Past) @@ -445,6 +447,30 @@ class Version(NamedTuple): build: int ``` +### SlotType +An enum representing the nature of a slot. + +```python +import enum +class SlotType(enum.IntFlag): + spectator = 0b00 + player = 0b01 + group = 0b10 +``` + +### NetworkSlot +An object representing static information about a slot. + +```python +import typing +from NetUtils import SlotType +class NetworkSlot(typing.NamedTuple): + name: str + game: str + type: SlotType + group_members: typing.List[int] = [] # only populated if type == group +``` + ### Permission An enumeration containing the possible command permission, for commands that may be restricted. ```python