Started adding IAudioClient incoming stream creation/destruction events

This commit is contained in:
RogueException
2017-03-31 03:59:12 -03:00
parent 5e94b97024
commit 158ce0f922
13 changed files with 94 additions and 58 deletions

View File

@@ -1414,7 +1414,7 @@ namespace Discord.WebSocket
if (data.ChannelId != null)
{
before = guild.GetVoiceState(data.UserId)?.Clone() ?? SocketVoiceState.Default;
after = guild.AddOrUpdateVoiceState(State, data);
after = await guild.AddOrUpdateVoiceStateAsync(State, data).ConfigureAwait(false);
/*if (data.UserId == CurrentUser.Id)
{
var _ = guild.FinishJoinAudioChannel().ConfigureAwait(false);
@@ -1471,7 +1471,7 @@ namespace Discord.WebSocket
if (guild != null)
{
string endpoint = data.Endpoint.Substring(0, data.Endpoint.LastIndexOf(':'));
var _ = guild.FinishConnectAudio(_nextAudioId++, endpoint, data.Token).ConfigureAwait(false);
var _ = guild.FinishConnectAudio(endpoint, data.Token).ConfigureAwait(false);
}
else
{
@@ -1725,6 +1725,8 @@ namespace Discord.WebSocket
}
}
internal int GetAudioId() => _nextAudioId++;
//IDiscordClient
async Task<IApplication> IDiscordClient.GetApplicationInfoAsync(RequestOptions options)
=> await GetApplicationInfoAsync().ConfigureAwait(false);