Readded basic voice support

This commit is contained in:
RogueException
2015-12-30 05:12:54 -04:00
parent 860360654f
commit 23639b227a
7 changed files with 95 additions and 86 deletions

View File

@@ -63,10 +63,8 @@ namespace Discord.Net.WebSockets
_sendBuffer = new VoiceBuffer((int)Math.Ceiling(_config.BufferLength / (double)_encoder.FrameLength), _encoder.FrameSize);
}
public async Task Connect()
{
await BeginConnect().ConfigureAwait(false);
}
public Task Connect()
=> BeginConnect();
public async Task Reconnect()
{
try
@@ -473,21 +471,6 @@ namespace Discord.Net.WebSockets
{
_sendBuffer.Wait(CancelToken);
}
public Task WaitForConnection(int timeout)
{
return Task.Run(() =>
{
try
{
if (!_connectedEvent.Wait(timeout, CancelToken))
throw new TimeoutException();
}
catch (OperationCanceledException)
{
_taskManager.ThrowException();
}
});
}
public override void SendHeartbeat()
=> QueueMessage(new HeartbeatCommand());