forked from rDrama/rDrama
restore auto under_attack
parent
3583f14f6f
commit
a4166f271c
|
@ -56,6 +56,20 @@ def calc_users():
|
|||
g.loggedin_counter = len(loggedin)
|
||||
g.loggedout_counter = len(loggedout)
|
||||
|
||||
if SITE == 'watchpeopledie.tv':
|
||||
ddos_threshold = 3500
|
||||
else:
|
||||
ddos_threshold = 1000
|
||||
|
||||
if g.loggedin_counter + g.loggedout_counter > ddos_threshold or (SITE == 'watchpeopledie.tv' and get_setting('login_required')):
|
||||
if not get_setting('under_attack'):
|
||||
set_setting('under_attack', True)
|
||||
set_security_level('under_attack')
|
||||
else:
|
||||
if get_setting('under_attack'):
|
||||
set_setting('under_attack', False)
|
||||
set_security_level('high')
|
||||
|
||||
return ''
|
||||
|
||||
def get_logged_in_user():
|
||||
|
|
Loading…
Reference in New Issue