[Feature] Voice reconnection and resuming (#2873)
* Voice receive fix (use system-selected port) * Update SocketGuild.cs * Reconnect voice after moved, resume voice connection, don't invoke Disconnected event when is going to reconnect * no more collection primitives * Disconnected event rallback & dispose audio client after finished * Update src/Discord.Net.WebSocket/Audio/AudioClient.cs * Update src/Discord.Net.WebSocket/Audio/AudioClient.cs ---------
This commit is contained in:
@@ -166,6 +166,16 @@ namespace Discord.Audio
|
||||
});
|
||||
}
|
||||
|
||||
public Task SendResume(string token, string sessionId)
|
||||
{
|
||||
return SendAsync(VoiceOpCode.Resume, new ResumeParams
|
||||
{
|
||||
ServerId = GuildId,
|
||||
SessionId = sessionId,
|
||||
Token = token
|
||||
});
|
||||
}
|
||||
|
||||
public async Task ConnectAsync(string url)
|
||||
{
|
||||
await _connectionLock.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user