diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-08-16 19:28:54 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-08-16 19:28:54 -0300 |
commit | e0f0ae108bd9f41cd19a3f2ef0c82f0d872c022f (patch) | |
tree | 3b6bbfbb4c2611d31b02b54598b89ddb37afb8fc | |
parent | 239358745f0827906f77e52341551cb58fd59329 (diff) | |
download | server-e0f0ae108bd9f41cd19a3f2ef0c82f0d872c022f.tar.gz server-e0f0ae108bd9f41cd19a3f2ef0c82f0d872c022f.tar.bz2 server-e0f0ae108bd9f41cd19a3f2ef0c82f0d872c022f.tar.xz server-e0f0ae108bd9f41cd19a3f2ef0c82f0d872c022f.zip |
Add command `list` (aka. `all`) which lists everyone connected.
Also lists their tokens and IPs so the other commands (ban, ddos, etc.) can be used
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | server.py | 4 |
2 files changed, 5 insertions, 0 deletions
@@ -154,6 +154,7 @@ After the server start, it will listen for a few commands. They are listed below | raw | eval | Evaluates an arbitrary Python statement if server is in debug mode. | | run | exec | Executes an arbitrary Python statement if server is in debug mode. | | status | st | Reports status regarding server health | +| list | all | Reports data on all connected clients | | ddos | dcall | Disconnects all unauthed clients. | | ddosban | dcbanall | Disconnects all unauthed clients, and ban their IP for half hour. | @@ -240,6 +240,10 @@ try: elif cmd in ["status", "st"]: stdout("Total clients connected: %d" % len(clients)) stdout("Total blacklist size: %d" % len(security.blacklist)) + elif cmd in ["list", "all"]: + stdout("Total clients connected: %d" % len(clients)) + for cli in clients: + print("[%d] %s - %s" % (cli.userid, cli.token, cli.address[0])) elif cmd in ["kick", "dc"]: totaldc=disconnect(com) stdout("Disconnected %d clients." % totaldc) |