X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomrogue%2Fgame.py;h=ba982dd5fcdf7853dfc98947b2427bb04cf20a59;hb=acbbf266ec7288bf7a22b7131f085a7e118b41d4;hp=d51c832fd36dc2e9d353969bee079f751c62ce40;hpb=7f7742ecc229f9f6b5ab5c28daf11ea2a67ad29a;p=plomrogue2 diff --git a/plomrogue/game.py b/plomrogue/game.py index d51c832..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'), @@ -365,7 +370,7 @@ class Game(GameBase): self.io.send('PLAYER_ID %s' % t.id_, connection_id) self.io.send('LOGIN_OK', connection_id) for msg in self.intro_messages: - self.io.send('CHAT ' + quote(msg)) + self.io.send('CHAT ' + quote(msg), connection_id) self.io.send('CHAT ' + quote(t.name + ' entered the map.')) for s in [s for s in self.things if s.type_ == 'SpawnPoint' and s.name == t.name]: