diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-27 22:25:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-27 22:25:01 -0300 |
commit | 2e183f4c72abf67172d929f7dbb8dee116923792 (patch) | |
tree | 6d8db6d2a562cf2ac7475ccbe8ae337f108a1435 | |
parent | 636cb4deb4b82ed88ce608cb9f45c59e77614a9d (diff) | |
download | server-2e183f4c72abf67172d929f7dbb8dee116923792.tar.gz server-2e183f4c72abf67172d929f7dbb8dee116923792.tar.bz2 server-2e183f4c72abf67172d929f7dbb8dee116923792.tar.xz server-2e183f4c72abf67172d929f7dbb8dee116923792.zip |
Add command to kick users (no ban)
-rw-r--r-- | README.md | 3 | ||||
-rwxr-xr-x | server.py | 10 |
2 files changed, 8 insertions, 5 deletions
@@ -145,7 +145,8 @@ After the server start, it will listen for a few commands. They are listed below | Command | Aliases | Effects | | ------- | ------- | ------- | | broadcast | global, msg, say, kami | Sends a plain text notice to all connected clients (regardless of auth state). Useful to warn about maintenances. | -| ban | nuke | Bans an IP until the server restarts. | +| kick | dc | Disconnects an IP from the server. | +| ban | nuke, kb | Bans an IP until the server restarts. | | unban | | Unbans an IP until the server restarts. | | kline | permaban, block | Bans an IP and record it on K-Line.txt - Survives server restarts, is permanent | | exit | quit, close, term, end | Sends a shutdown notice to all clients and shuts down the server. | @@ -170,9 +170,10 @@ try: cmd=command.split(' ')[0].lower() com=" ".join(command.split(' ')[1:]) # Parse the command + # TODO: grant gems to an user if cmd in ["broadcast", "global", "msg", "say", "kami"]: sendmsg("NOTICE:" + com) - elif cmd in ["ban", "nuke"]: + elif cmd in ["ban", "nuke", "kb"]: security.ban_ip(com) totaldc=disconnect(com) stdout("BAN: Disconnected %d clients." % totaldc) @@ -210,9 +211,10 @@ try: elif cmd in ["status", "st"]: stdout("Total clients connected: %d" % len(clients)) stdout("Total blacklist size: %d" % len(security.blacklist)) - # TODO: Disconnect a client (kick/dc) - # kickandban (kb) - # And grant gems to an user + elif cmd in ["kick", "dc"]: + totaldc=disconnect(com) + stdout("Disconnected %d clients." % totaldc) + del totaldc elif cmd in ["ddos", "dcall"]: totaldc=0 for c in clients: |