diff --git a/houdini/handlers/games/table.py b/houdini/handlers/games/table.py index 5e486f9..1c325a8 100644 --- a/houdini/handlers/games/table.py +++ b/houdini/handlers/games/table.py @@ -1,5 +1,6 @@ from houdini import handlers from houdini.handlers import XTPacket, check +from houdini.handlers.play.navigation import handle_join_room, handle_join_player_room def table_handler(logic): @@ -20,3 +21,27 @@ async def handle_get_waddle_population(p): async def handle_join_table(p, table_id: int): table = p.room.tables[table_id] await table.add(p) + + +@handlers.handler(XTPacket('a', 'lt')) +async def handle_leave_table(p): + if p.table is not None: + await p.table.remove(p) + + +@handlers.handler(XTPacket('j', 'jr'), after=handle_join_room) +async def handle_join_room_table(p): + if p.table is not None: + await p.table.remove(p) + + +@handlers.handler(XTPacket('j', 'jp'), after=handle_join_player_room) +async def handle_join_player_room_table(p): + if p.table is not None: + await p.table.remove(p) + + +@handlers.disconnected +async def handle_disconnect_table(p): + if p.table is not None: + await p.table.remove(p)