home · contact · privacy
Fix faulty send-to-all in login process.
[plomrogue2] / plomrogue / game.py
index e7bc7301e0eea7782ac9cf444e8bb274f98cdef0..8fcb4309d344b45b0d12128636f11f7368d43d08 100755 (executable)
@@ -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"', connection_id)
+            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'),