From 250099f5fd267e786d76d9e1598f0e60ef90a9d8 Mon Sep 17 00:00:00 2001 From: Fabian Dill <fabian.dill@web.de> Date: Sat, 3 Apr 2021 20:02:15 +0200 Subject: [PATCH] Small adjustments --- BaseClasses.py | 2 +- CommonClient.py | 2 +- MultiServer.py | 13 +++++++++---- worlds/alttp/Rom.py | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 774c3ab0..f88a48ac 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1111,7 +1111,7 @@ class Location(): @property def hint_text(self): - return getattr(self, "_hint_text", self.name) + return getattr(self, "_hint_text", self.name.replace("_", " ").replace("-", " ")) class Item(): location: Optional[Location] = None diff --git a/CommonClient.py b/CommonClient.py index c6f58c48..4a155a00 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -356,7 +356,7 @@ async def process_server_cmd(ctx: CommonContext, args: dict): if msgs: await ctx.send_msgs(msgs) if ctx.finished_game: - await ctx.send_msgs([{"cmd": "StatusUpdate", "status": CLientStatus.CLIENT_GOAL}]) + await ctx.send_msgs([{"cmd": "StatusUpdate", "status": ClientStatus.CLIENT_GOAL}]) # Get the server side view of missing as of time of connecting. # This list is used to only send to the server what is reported as ACTUALLY Missing. diff --git a/MultiServer.py b/MultiServer.py index 770d644e..912a0272 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -525,10 +525,15 @@ def format_hint(ctx: Context, team: int, hint: NetUtils.Hint) -> str: def json_format_send_event(net_item: NetworkItem, receiving_player: int): parts = [] NetUtils.add_json_text(parts, net_item.player, type=NetUtils.JSONTypes.player_id) - NetUtils.add_json_text(parts, " sent ") - NetUtils.add_json_text(parts, net_item.item, type=NetUtils.JSONTypes.item_id) - NetUtils.add_json_text(parts, " to ") - NetUtils.add_json_text(parts, receiving_player, type=NetUtils.JSONTypes.player_id) + if net_item.player == receiving_player: + NetUtils.add_json_text(parts, " found their ") + NetUtils.add_json_text(parts, net_item.item, type=NetUtils.JSONTypes.item_id) + else: + NetUtils.add_json_text(parts, " sent ") + NetUtils.add_json_text(parts, net_item.item, type=NetUtils.JSONTypes.item_id) + NetUtils.add_json_text(parts, " to ") + NetUtils.add_json_text(parts, receiving_player, type=NetUtils.JSONTypes.player_id) + NetUtils.add_json_text(parts, " (") NetUtils.add_json_text(parts, net_item.location, type=NetUtils.JSONTypes.location_id) NetUtils.add_json_text(parts, ")") diff --git a/worlds/alttp/Rom.py b/worlds/alttp/Rom.py index bf7afdb4..87993c58 100644 --- a/worlds/alttp/Rom.py +++ b/worlds/alttp/Rom.py @@ -1651,7 +1651,7 @@ def write_custom_shops(rom, world, player): if item is None: break if not item['item'] in item_table: # item not native to ALTTP - item_code = 0x09 # Hammer + item_code = 0x09 # Hammer else: item_code = ItemFactory(item['item'], player).code if item['item'] == 'Single Arrow' and item['player'] == 0 and world.retro[player]: