From ce6413f53e95ee1c034a94d6682bcd0c8361fc8a Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 2 Sep 2019 12:49:58 +0100 Subject: [PATCH] Don't rely on pulling timestamp out of pong --- modules/mumble.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mumble.py b/modules/mumble.py index ce3638ca..762d30b0 100644 --- a/modules/mumble.py +++ b/modules/mumble.py @@ -17,14 +17,15 @@ class Module(ModuleManager.BaseModule): else: port = DEFAULT_PORT - ping_packet = struct.pack(">iQ", 0, datetime.datetime.now().microsecond) + timestamp = datetime.datetime.utcnow().microsecond + ping_packet = struct.pack(">iQ", 0, timestamp) s = socket.socket(type=socket.SOCK_DGRAM) s.sendto(ping_packet, (server, port)) pong_packet = s.recv(24) pong = struct.unpack(">bbbbQiii", pong_packet) - ping = (datetime.datetime.now().microsecond - pong[4])/1000 + ping = (datetime.datetime.utcnow().microsecond-timestamp)/1000 users = pong[5] max_users = pong[6] bandwidth = pong[7]/1000 # kbit/s