forked from rDrama/rDrama
1
0
Fork 0

try fixing the issue with the under attack toggle

master
Aevann 2023-10-19 00:02:35 +03:00
parent 7925e1236e
commit f6b5723308
2 changed files with 6 additions and 2 deletions

View File

@ -31,6 +31,10 @@ def toggle_setting(setting):
_save_settings()
return val
def set_setting(setting, val):
_SETTINGS[setting] = val
_save_settings()
def reload_settings():
global _SETTINGS
if not os.path.isfile(SETTINGS_FILENAME):

View File

@ -63,11 +63,11 @@ def calc_users():
if g.loggedout_counter > ddos_threshold:
if not get_setting('under_attack'):
toggle_setting('under_attack')
set_setting('under_attack', True)
set_security_level('under_attack')
else:
if get_setting('under_attack'):
toggle_setting('under_attack')
set_setting('under_attack', False)
set_security_level('high')
return ''