diff options
| author | 2019-12-13 06:37:57 +0000 | |
|---|---|---|
| committer | 2019-12-13 06:37:57 +0000 | |
| commit | 31933513d9b15f8c1b5d1ac9a4ab749de4d41507 (patch) | |
| tree | 12d174c50bdd3cf1ad4fb99098caff5186a47d8f /modules | |
| parent | `s_line`, not `s` (diff) | |
| signature | ||
don't use dt.microseconds - only covers within the current second
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mumble.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/mumble.py b/modules/mumble.py index 9764a0d3..29c8f1ef 100644 --- a/modules/mumble.py +++ b/modules/mumble.py @@ -40,8 +40,8 @@ class Module(ModuleManager.BaseModule): else: port = DEFAULT_PORT - timestamp = datetime.datetime.utcnow().microsecond - ping_packet = struct.pack(">iQ", 0, timestamp) + timestamp = datetime.datetime.utcnow() + ping_packet = struct.pack(">iQ", 0, 123) s = socket.socket(type=socket.SOCK_DGRAM) s.settimeout(5) @@ -61,7 +61,7 @@ class Module(ModuleManager.BaseModule): pong = struct.unpack(">bbbbQiii", pong_packet) version = ".".join(str(v) for v in pong[1:4]) - ping = (datetime.datetime.utcnow().microsecond-timestamp)/1000 + ping = (datetime.datetime.utcnow()-timestamp).total_seconds()*1000 users = pong[5] max_users = pong[6] bandwidth = pong[7]/1000 # kbit/s |
