[Fix] Receiving voice packets (use system-assigned port) (#2857)
* Voice receive fix (use system-selected port) * Update SocketGuild.cs --------- Co-authored-by: Misha133 <mihagribkov133@gmail.com>
This commit is contained in:
@@ -1744,11 +1744,9 @@ namespace Discord.WebSocket
|
||||
|
||||
if (external)
|
||||
{
|
||||
#pragma warning disable IDISP001
|
||||
var _ = promise.TrySetResultAsync(null);
|
||||
_ = promise.TrySetResultAsync(null);
|
||||
await Discord.ApiClient.SendVoiceStateUpdateAsync(_voiceStateUpdateParams).ConfigureAwait(false);
|
||||
return null;
|
||||
#pragma warning restore IDISP001
|
||||
}
|
||||
|
||||
if (_audioClient == null)
|
||||
@@ -1766,19 +1764,15 @@ namespace Discord.WebSocket
|
||||
await promise.TrySetExceptionAsync(ex);
|
||||
else
|
||||
await promise.TrySetCanceledAsync();
|
||||
return;
|
||||
}
|
||||
};
|
||||
audioClient.Connected += () =>
|
||||
{
|
||||
#pragma warning disable IDISP001
|
||||
var _ = promise.TrySetResultAsync(_audioClient);
|
||||
#pragma warning restore IDISP001
|
||||
_ = promise.TrySetResultAsync(_audioClient);
|
||||
return Task.Delay(0);
|
||||
};
|
||||
#pragma warning disable IDISP003
|
||||
|
||||
_audioClient = audioClient;
|
||||
#pragma warning restore IDISP003
|
||||
}
|
||||
|
||||
await Discord.ApiClient.SendVoiceStateUpdateAsync(_voiceStateUpdateParams).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user