api: upgrade audio client to VoiceWS v3

This commit is contained in:
Christopher F
2018-05-28 15:35:59 -04:00
parent 64d8938ed5
commit 9ba38d7796
4 changed files with 35 additions and 9 deletions

View File

@@ -0,0 +1,10 @@
using Newtonsoft.Json;
namespace Discord.API.Voice
{
internal class HelloEvent
{
[JsonProperty("heartbeat_interval")]
public int HeartbeatInterval { get; set; }
}
}

View File

@@ -1,5 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
using Newtonsoft.Json;
using System;
namespace Discord.API.Voice
{
@@ -14,6 +15,7 @@ namespace Discord.API.Voice
[JsonProperty("modes")]
public string[] Modes { get; set; }
[JsonProperty("heartbeat_interval")]
[Obsolete("This field is errorneous and should not be used", true)]
public int HeartbeatInterval { get; set; }
}
}

View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
namespace Discord.API.Voice
{
internal enum VoiceOpCode : byte
@@ -11,11 +11,19 @@ namespace Discord.API.Voice
Ready = 2,
/// <summary> C→S - Used to keep the connection alive and measure latency. </summary>
Heartbeat = 3,
/// <summary> C←S - Used to reply to a client's heartbeat. </summary>
HeartbeatAck = 3,
/// <summary> C←S - Used to provide an encryption key to the client. </summary>
SessionDescription = 4,
/// <summary> C↔S - Used to inform that a certain user is speaking. </summary>
Speaking = 5
Speaking = 5,
/// <summary> C←S - Used to reply to a client's heartbeat. </summary>
HeartbeatAck = 6,
/// <summary> C→S - Used to resume a connection. </summary>
Resume = 7,
/// <summary> C←S - Used to inform the client the heartbeat interval. </summary>
Hello = 8,
/// <summary> C←S - Used to acknowledge a resumed connection. </summary>
Resumed = 9,
/// <summary> C←S - Used to notify that a client has disconnected. </summary>
ClientDisconnect = 13,
}
}