From d6c73fc6d696818f52e7c0c16f471e11b8e61d13 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 12 Jun 2020 15:17:52 +0100 Subject: [PATCH] Check buddy has joined the world before pushing presence to them --- houdini/handlers/play/buddy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/houdini/handlers/play/buddy.py b/houdini/handlers/play/buddy.py index ad8a77a..ab98983 100644 --- a/houdini/handlers/play/buddy.py +++ b/houdini/handlers/play/buddy.py @@ -11,13 +11,15 @@ async def update_player_presence(p): for buddy_id in p.buddies.keys(): if buddy_id in p.server.penguins_by_id: buddy = p.server.penguins_by_id[buddy_id] - await p.send_xt('bon', buddy.id, p.server.config.id, buddy.room.id) - await buddy.send_xt('bon', p.id, p.server.config.id, p.room.id) + if buddy.joined_world: + await p.send_xt('bon', buddy.id, p.server.config.id, buddy.room.id) + await buddy.send_xt('bon', p.id, p.server.config.id, p.room.id) for character_id in p.character_buddies.keys(): if character_id in p.server.penguins_by_character_id: character = p.server.penguins_by_character_id[character_id] - await p.send_xt('caon', character_id, p.server.config.id, character.room.id) + if character.joined_world: + await p.send_xt('caon', character_id, p.server.config.id, character.room.id) if p.character is not None: for penguin in p.server.penguins_by_id.values():