diff options
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -142,16 +142,19 @@ try: # Parse the command if cmd in ["broadcast", "global", "msg", "say"]: sendmsg("NOTICE:" + com) - if cmd in ["ban", "block", "nuke"]: + elif cmd in ["ban", "block", "nuke"]: security.ban_ip(com) - if cmd in ["exit", "quit", "close", "term", "end"]: + elif cmd in ["exit", "quit", "close", "term", "end"]: + stdout("Preparing to close server...") break else: stdout("ERROR: Unknown command.") except: - stdout("Terminating!") + stdout("Abrupt error: Terminating!") # TODO: Cleanup here +for c in clients: + c.close(reason="Server is shutting down") print("Server finished.") |