Added support for .NET Standard 1.1 and 1.2

This commit is contained in:
RogueException
2016-12-16 05:51:07 -04:00
parent a1addd4016
commit 8f87b2cc71
49 changed files with 533 additions and 348 deletions

View File

@@ -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
}
}
}