More cleanup and internal reordering

This commit is contained in:
RogueException
2015-12-06 21:16:58 -04:00
parent d512d96408
commit 2cdc0ad371
26 changed files with 188 additions and 191 deletions

View File

@@ -0,0 +1,20 @@
//Ignore unused/unassigned variable warnings
#pragma warning disable CS0649
#pragma warning disable CS0169
using Discord.API.Converters;
using Newtonsoft.Json;
namespace Discord.Audio.API
{
internal sealed class VoiceServerUpdateEvent
{
[JsonProperty("guild_id")]
[JsonConverter(typeof(LongStringConverter))]
public long ServerId;
[JsonProperty("endpoint")]
public string Endpoint;
[JsonProperty("token")]
public string Token;
}
}

View File

@@ -149,7 +149,7 @@ namespace Discord.Audio
{
int id = unchecked(++_nextClientId);
var logger = Client.Log().CreateLogger($"Voice #{id}");
GatewayWebSocket dataSocket = null;
GatewayWebSocket gatewaySocket = null;
var voiceSocket = new VoiceWebSocket(Client.Config, _config, logger);
var voiceClient = new DiscordAudioClient(this, id, logger, gatewaySocket, voiceSocket);
voiceClient.SetServerId(server.Id);

View File

@@ -59,7 +59,7 @@ namespace Discord.Audio
_voiceSocket.ParentCancelToken = _cancelToken;
};*/
_gatewaySocket.ReceivedEvent += async (s, e) =>
_gatewaySocket.ReceivedDispatch += async (s, e) =>
{
try
{

View File

@@ -527,9 +527,9 @@ namespace Discord.Net.WebSockets
QueueMessage(isTalking);
}
protected override object GetKeepAlive()
public override void SendHeartbeat()
{
return new VoiceKeepAliveCommand();
QueueMessage(new VoiceKeepAliveCommand());
}
public void WaitForQueue()