home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
66b6c5c
)
Add login maximum.
author
Christian Heller
<c.heller@plomlompom.de>
Mon, 28 Dec 2020 10:17:42 +0000
(11:17 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Mon, 28 Dec 2020 10:17:42 +0000
(11:17 +0100)
plomrogue/game.py
patch
|
blob
|
history
diff --git
a/plomrogue/game.py
b/plomrogue/game.py
index e7bc7301e0eea7782ac9cf444e8bb274f98cdef0..ba982dd5fcdf7853dfc98947b2427bb04cf20a59 100755
(executable)
--- 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'),