More cleanup and internal reordering
This commit is contained in:
20
src/Discord.Net.Audio/API/Messages/GatewaySocket.cs
Normal file
20
src/Discord.Net.Audio/API/Messages/GatewaySocket.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Discord.Audio
|
||||
_voiceSocket.ParentCancelToken = _cancelToken;
|
||||
};*/
|
||||
|
||||
_gatewaySocket.ReceivedEvent += async (s, e) =>
|
||||
_gatewaySocket.ReceivedDispatch += async (s, e) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user