Browse Source

[voice] use IP from voice ready for UDP connection

pull/93/head
andrei 7 years ago
parent
commit
2a116631b9
  1. 6
      disco/voice/client.py

6
disco/voice/client.py

@ -67,6 +67,7 @@ class VoiceClient(LoggingClass):
self.token = None self.token = None
self.endpoint = None self.endpoint = None
self.ssrc = None self.ssrc = None
self.ip = None
self.port = None self.port = None
self.mode = None self.mode = None
self.udp = None self.udp = None
@ -123,6 +124,7 @@ class VoiceClient(LoggingClass):
self.log.info('[%s] Recived Voice READY payload, attempting to negotiate voice connection w/ remote', self) self.log.info('[%s] Recived Voice READY payload, attempting to negotiate voice connection w/ remote', self)
self.set_state(VoiceState.CONNECTING) self.set_state(VoiceState.CONNECTING)
self.ssrc = data['ssrc'] self.ssrc = data['ssrc']
self.ip = data['ip']
self.port = data['port'] self.port = data['port']
for mode in self.SUPPORTED_MODES: for mode in self.SUPPORTED_MODES:
@ -133,9 +135,9 @@ class VoiceClient(LoggingClass):
else: else:
raise Exception('Failed to find a supported voice mode') raise Exception('Failed to find a supported voice mode')
self.log.debug('[%s] Attempting IP discovery over UDP to %s:%s', self, self.endpoint, self.port) self.log.debug('[%s] Attempting IP discovery over UDP to %s:%s', self, self.ip, self.port)
self.udp = UDPVoiceClient(self) self.udp = UDPVoiceClient(self)
ip, port = self.udp.connect(self.endpoint, self.port) ip, port = self.udp.connect(self.ip, self.port)
if not ip: if not ip:
self.log.error('Failed to discover our IP, perhaps a NAT or firewall is fucking us') self.log.error('Failed to discover our IP, perhaps a NAT or firewall is fucking us')

Loading…
Cancel
Save