Lorenzo
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
3 deletions
-
discord/gateway.py
|
@ -721,9 +721,7 @@ class DiscordVoiceWebSocket(websockets.client.WebSocketClientProtocol): |
|
|
ip_end = recv.index(0, ip_start) |
|
|
ip_end = recv.index(0, ip_start) |
|
|
state.ip = recv[ip_start:ip_end].decode('ascii') |
|
|
state.ip = recv[ip_start:ip_end].decode('ascii') |
|
|
|
|
|
|
|
|
# the port is a little endian unsigned short in the last two bytes |
|
|
state.port = struct.unpack_from('>H', recv, len(recv) - 2)[0] |
|
|
# yes, this is different endianness from everything else |
|
|
|
|
|
state.port = struct.unpack_from('<H', recv, len(recv) - 2)[0] |
|
|
|
|
|
log.debug('detected ip: %s port: %s', state.ip, state.port) |
|
|
log.debug('detected ip: %s port: %s', state.ip, state.port) |
|
|
|
|
|
|
|
|
# there *should* always be at least one supported mode (xsalsa20_poly1305) |
|
|
# there *should* always be at least one supported mode (xsalsa20_poly1305) |
|
|