From acbbf266ec7288bf7a22b7131f085a7e118b41d4 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 28 Dec 2020 11:17:42 +0100 Subject: [PATCH] Add login maximum. --- plomrogue/game.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plomrogue/game.py b/plomrogue/game.py index e7bc730..ba982dd 100755 --- a/plomrogue/game.py +++ b/plomrogue/game.py @@ -349,6 +349,11 @@ class Game(GameBase): self.changed = True def login(self, nick, connection_id): + if len(self.sessions) > 200: + print('DEBUG LOGIN TOO MANY FOR', connection_id) + self.io.send('CHAT "sorry, too many users currenty ' + 'logged in, try again later"') + return for t in [t for t in self.things if t.type_ == 'Player' and t.name == nick]: self.io.send('GAME_ERROR ' + quote('name already in use'), -- 2.30.2