diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-21 12:08:57 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-21 12:08:57 -0300 |
commit | aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8 (patch) | |
tree | 48bf9d50223b4d8b736b849820724fe6738cdec2 /server.py | |
parent | 3ae4c05e03408f0010c780ddd00c617853312a4c (diff) | |
download | server-aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8.tar.gz server-aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8.tar.bz2 server-aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8.tar.xz server-aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8.zip |
Allow high and totally unsafe wizardry if debug mode is ON.
Allow debug mode to be toggled on and off on server console.
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -8,7 +8,7 @@ LOG_AUTH=syslog.LOG_AUTH from websock import WebSocketServer, WebSocket ## Local Modules -from utils import stdout, now, clients +from utils import stdout, now, clients, debug from consts import MAX_CLIENTS, PACKET_ACK import protocol, security, traceback @@ -165,6 +165,15 @@ try: stdout("Preparing to close server...") sendmsg("NOTICE:Server is going down for scheduled maintenance. Please close, wait five minutes, and then re-open the app.") break + elif cmd in ["dbg", "debug"]: + debug = not debug + stdout("Changed debug mode to %s" % str(debug)) + elif cmd in ["raw", "eval", "exec"] and debug: + try: + print(eval(com)) + except: + traceback.print_exc() + print("[RAW] Error.") # TODO: Disconnect a client, disconnect all unauthed client, # disconnect & ban all unauthed clients - all these are measures # to manually fight a DoS |