From 720ef936da0ef5687c10c5e58358d78e3ceea7d5 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 6 Nov 2021 11:19:49 +0100 Subject: [PATCH] DeathLink: add support for the cause field --- CommonClient.py | 5 +++++ LttPClient.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CommonClient.py b/CommonClient.py index fa4e0881..0e5715b8 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -263,6 +263,11 @@ class CommonContext(): def on_deathlink(self, data: dict): """Gets dispatched when a new DeathLink is triggered by another linked player.""" self.last_death_link = max(data["time"], self.last_death_link) + text = data.get("cause", "") + if text: + logger.info(f"DeathLink: {text}") + else: + logger.info(f"DeathLink: Received from {data['source']}") async def send_death(self): self.last_death_link = time.time() diff --git a/LttPClient.py b/LttPClient.py index b09b57be..a81071cb 100644 --- a/LttPClient.py +++ b/LttPClient.py @@ -148,7 +148,6 @@ class Context(CommonContext): snes_buffered_write(self, WRAM_START + 0x0373, bytes([8])) asyncio.create_task(snes_flush_writes(self)) self.death_state = True - snes_logger.info(f"Received DeathLink from {data['source']}") super(Context, self).on_deathlink(data)