fix: use ip discovery address as string, not as Vec<u8>
This commit is contained in:
parent
d57ac93913
commit
b48bacfe1d
|
@ -39,10 +39,9 @@ pub enum VoiceProtocol {
|
|||
///
|
||||
/// See <https://discord-userdoccers.vercel.app/topics/voice-connections#protocol-data-structure>
|
||||
pub struct SelectProtocolData {
|
||||
/// Our external ip
|
||||
// FIXME: This is a string
|
||||
pub address: Vec<u8>,
|
||||
/// Our external udp port
|
||||
/// Our external ip we got from ip discovery
|
||||
pub address: String,
|
||||
/// Our external udp port we got from id discovery
|
||||
pub port: u16,
|
||||
/// The mode of encryption to use
|
||||
pub mode: VoiceEncryptionMode,
|
||||
|
|
|
@ -111,6 +111,8 @@ impl Observer<VoiceReady> for VoiceHandler {
|
|||
|
||||
*self.voice_udp_connection.lock().await = Some(udp_handle.clone());
|
||||
|
||||
let string_ip_address = String::from_utf8(ip_discovery.address).expect("Ip discovery gave non string ip");
|
||||
|
||||
self.voice_gateway_connection
|
||||
.lock()
|
||||
.await
|
||||
|
@ -119,7 +121,7 @@ impl Observer<VoiceReady> for VoiceHandler {
|
|||
.send_select_protocol(SelectProtocol {
|
||||
protocol: VoiceProtocol::Udp,
|
||||
data: SelectProtocolData {
|
||||
address: ip_discovery.address,
|
||||
address: string_ip_address,
|
||||
port: ip_discovery.port,
|
||||
mode: VoiceEncryptionMode::Xsalsa20Poly1305,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue