Fixed audio and a few ConnectionManager issues
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
<Compile Include="..\Discord.Net.WebSocket\Net\DefaultWebSocketClient.cs">
|
||||
<Link>Net\DefaultWebSocketClient.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Discord.Net.WebSocket\ConnectionManager.cs">
|
||||
<Link>ConnectionManager.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" />
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace Discord.Rpc
|
||||
remove { _connectedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<Task>> _connectedEvent = new AsyncEvent<Func<Task>>();
|
||||
public event Func<Exception, bool, Task> Disconnected
|
||||
public event Func<Exception, Task> Disconnected
|
||||
{
|
||||
add { _disconnectedEvent.Add(value); }
|
||||
remove { _disconnectedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<Exception, bool, Task>> _disconnectedEvent = new AsyncEvent<Func<Exception, bool, Task>>();
|
||||
private readonly AsyncEvent<Func<Exception, Task>> _disconnectedEvent = new AsyncEvent<Func<Exception, Task>>();
|
||||
public event Func<Task> Ready
|
||||
{
|
||||
add { _readyEvent.Add(value); }
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace Discord.Rpc
|
||||
_rpcLogger = LogManager.CreateLogger("RPC");
|
||||
_connection = new ConnectionManager(_stateLock, _rpcLogger, config.ConnectionTimeout,
|
||||
OnConnectingAsync, OnDisconnectingAsync, x => ApiClient.Disconnected += x);
|
||||
_connection.Connected += () => _connectedEvent.InvokeAsync();
|
||||
_connection.Disconnected += (ex, recon) => _disconnectedEvent.InvokeAsync(ex);
|
||||
|
||||
_serializer = new JsonSerializer { ContractResolver = new DiscordContractResolver() };
|
||||
_serializer.Error += (s, e) =>
|
||||
|
||||
Reference in New Issue
Block a user