diff options
| author | 2019-09-02 13:12:24 +0100 | |
|---|---|---|
| committer | 2019-09-02 13:12:24 +0100 | |
| commit | 72e1d71a0a5498f655bdb18a6361de132e621efa (patch) | |
| tree | de22a18ff4413a8c18d9342608b16892c5decc86 | |
| parent | Don't rely on pulling timestamp out of pong (diff) | |
| signature | ||
Show mumble server version
| -rw-r--r-- | modules/mumble.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/mumble.py b/modules/mumble.py index 762d30b0..f2625ee9 100644 --- a/modules/mumble.py +++ b/modules/mumble.py @@ -25,10 +25,12 @@ class Module(ModuleManager.BaseModule): pong_packet = s.recv(24) pong = struct.unpack(">bbbbQiii", pong_packet) + version = ".".join(str(v) for v in pong[1:4]) ping = (datetime.datetime.utcnow().microsecond-timestamp)/1000 users = pong[5] max_users = pong[6] bandwidth = pong[7]/1000 # kbit/s - event["stdout"].write("%s: %d/%d users, %.1fms ping, %dkbit/s bandwidth" - % (server, users, max_users, ping, bandwidth)) + event["stdout"].write( + "%s (v%s): %d/%d users, %.1fms ping, %dkbit/s bandwidth" + % (server, version, users, max_users, ping, bandwidth)) |
