Send gwcj to update queue widget when joining Card Jitsu mats

This commit is contained in:
Ben 2020-10-15 18:01:36 +01:00
parent 75c970c4ca
commit 2d6fe99b3b

View File

@ -14,6 +14,10 @@ async def handle_get_waddle_population(p):
async def handle_join_waddle(p, waddle_id: int): async def handle_join_waddle(p, waddle_id: int):
try: try:
waddle = p.room.waddles[waddle_id] waddle = p.room.waddles[waddle_id]
if waddle.game in ['card', 'water', 'fire'] and waddle.penguins.count(None) < waddle.seats:
await p.send_xt('gwcj', *(penguin.id for penguin in waddle.penguins if penguin is not None))
await waddle.add_penguin(p) await waddle.add_penguin(p)
except KeyError: except KeyError:
p.logger.warn(f'{p.username} tried to join a waddle that doesn\'t exist') p.logger.warn(f'{p.username} tried to join a waddle that doesn\'t exist')