Added support for .NET Standard 1.1 and 1.2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Discord.Net.WebSockets;
|
||||
using Discord.Rest;
|
||||
using System;
|
||||
|
||||
namespace Discord.Rpc
|
||||
{
|
||||
@@ -14,6 +15,19 @@ namespace Discord.Rpc
|
||||
public int ConnectionTimeout { get; set; } = 30000;
|
||||
|
||||
/// <summary> Gets or sets the provider used to generate new websocket connections. </summary>
|
||||
public WebSocketProvider WebSocketProvider { get; set; } = () => new DefaultWebSocketClient();
|
||||
public WebSocketProvider WebSocketProvider { get; set; }
|
||||
|
||||
public DiscordRpcConfig()
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
WebSocketProvider = () => new DefaultWebSocketClient();
|
||||
#else
|
||||
WebSocketProvider = () =>
|
||||
{
|
||||
throw new InvalidOperationException("The default websocket provider is not supported on this platform.\n" +
|
||||
"You must specify a WebSocketProvider or target a runtime supporting .NET Standard 1.3, such as .NET Framework 4.6+.");
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user