We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5bc957 commit 3193351Copy full SHA for 3193351
modules/mumble.py
@@ -40,8 +40,8 @@ def mumble(self, event):
40
else:
41
port = DEFAULT_PORT
42
43
- timestamp = datetime.datetime.utcnow().microsecond
44
- ping_packet = struct.pack(">iQ", 0, timestamp)
+ timestamp = datetime.datetime.utcnow()
+ ping_packet = struct.pack(">iQ", 0, 123)
45
s = socket.socket(type=socket.SOCK_DGRAM)
46
s.settimeout(5)
47
@@ -61,7 +61,7 @@ def mumble(self, event):
61
pong = struct.unpack(">bbbbQiii", pong_packet)
62
63
version = ".".join(str(v) for v in pong[1:4])
64
- ping = (datetime.datetime.utcnow().microsecond-timestamp)/1000
+ ping = (datetime.datetime.utcnow()-timestamp).total_seconds()*1000
65
users = pong[5]
66
max_users = pong[6]
67
bandwidth = pong[7]/1000 # kbit/s
0 commit comments