From 520e5feefbaff56dfdde142cf83eedad9f4c5b50 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 30 Nov 2021 06:41:50 +0100 Subject: [PATCH] Docs: add missed JSONMessagePart types --- NetUtils.py | 3 +-- docs/network protocol.md | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/NetUtils.py b/NetUtils.py index bdf01c38..ff49b8b8 100644 --- a/NetUtils.py +++ b/NetUtils.py @@ -280,11 +280,10 @@ class Hint(typing.NamedTuple): add_json_text(parts, self.entrance, type="entrance_name") else: add_json_text(parts, "'s World") + add_json_text(parts, ". ") if self.found: - add_json_text(parts, ". ") add_json_text(parts, "(found)", type="color", color="green") else: - add_json_text(parts, ". ") add_json_text(parts, "(not found)", type="color", color="red") return {"cmd": "PrintJSON", "data": parts, "type": "Hint", diff --git a/docs/network protocol.md b/docs/network protocol.md index 4673b5b7..1a715048 100644 --- a/docs/network protocol.md +++ b/docs/network protocol.md @@ -349,12 +349,21 @@ class JSONMessagePart(TypedDict): `type` is used to denote the intent of the message part. This can be used to indicate special information which may be rendered differently depending on client. How these types are displayed in Archipelago's ALttP client is not the end-all be-all. Other clients may choose to interpret and display these messages differently. Possible values for `type` include: -* player_id -* item_id -* location_id -* entrance_name -`color` is used to denote a console color to display the message part with. This is limited to console colors due to backwards compatibility needs with games such as ALttP. Although background colors as well as foreground colors are listed, only one may be applied to a [JSONMessagePart](#JSONMessagePart) at a time. +| Name | Notes | +| ---- | ----- | +| text | Regular text content | +| player_id | player ID of someone on your team, should be resolved to Player Name | +| player_name | Player Name, could be a player within a multiplayer game or from another team, not ID resolvable | +| item_id | Item ID, should be resolved to Item Name | +| item_name | Item Name, not currently used over network, but supported by reference Clients. | +| location_id | Location ID, should be resolved to Location Name | +| location_name |Location Name, not currently used over network, but supported by reference Clients. | +| entrance_name | Entrance Name. No ID mapping exists. | +| color | Regular text that should be colored. Only `type` that will contain `color` data. | + + +`color` is used to denote a console color to display the message part with and is only send if the `type` is `color`. This is limited to console colors due to backwards compatibility needs with games such as ALttP. Although background colors as well as foreground colors are listed, only one may be applied to a [JSONMessagePart](#JSONMessagePart) at a time. Color options: * bold