diff options
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -160,7 +160,7 @@ try: cmd=command.split(' ')[0].lower() com=" ".join(command.split(' ')[1:]) # Parse the command - if cmd in ["broadcast", "global", "msg", "say"]: + if cmd in ["broadcast", "global", "msg", "say", "kami"]: sendmsg("NOTICE:" + com) elif cmd in ["ban", "block", "nuke"]: security.ban_ip(com) @@ -187,6 +187,24 @@ try: # disconnect & ban all unauthed clients - all these are measures # to manually fight a DoS # Also, "permaban" an IP - open("K-Line.txt", "a") + # And grant gems to an user + elif cmd in ["ddos", "dcall"]: + totaldc=0 + for c in clients: + if c.token == "0" or c.userid < 1: + c.close(status=1000, reason="Remote host closed connection.") + totaldc+=1 + stdout("Disconnected %d clients." % totaldc) + del totaldc + elif cmd in ["ddosban", "dcbanall"]: + totaldc=0 + for c in clients: + if c.token == "0" or c.userid < 1: + security.ban_ip(c.address[0], now()+1800) + c.close(status=1000, reason="Remote host closed connection.") + totaldc+=1 + stdout("Disconnected and banned %d clients." % totaldc) + del totaldc else: stdout("ERROR: Unknown command.") except: |