- 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
+ login_limit_filename = 'login_limit'
+ if os.path.exists(login_limit_filename):
+ with open(login_limit_filename, 'r') as f:
+ lines = f.readlines()
+ login_limit = int(lines[0])
+ if len(self.sessions) > login_limit - 1:
+ print('DEBUG LOGIN TOO MANY FOR', nick, connection_id)
+ self.io.send('CHAT "sorry, too many users currently '
+ 'logged in, try again later '
+ 'by re-entering your name"', connection_id)
+ return