From 0d8c79c18deac6d980b23566d0017a01f24f180a Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 14 Feb 2020 21:58:00 +0000 Subject: [PATCH] Send error if room is full --- houdini/data/room.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/houdini/data/room.py b/houdini/data/room.py index 24d6e60..9893cb6 100644 --- a/houdini/data/room.py +++ b/houdini/data/room.py @@ -26,6 +26,9 @@ class RoomMixin: self.waddles = {} async def add_penguin(self, p): + if len(self.penguins_by_id) >= self.max_users and not p.moderator: + return await p.send_error(210) + if p.room: await p.room.remove_penguin(p) self.penguins_by_id[p.id] = p