You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

DiscordRpcConfig.cs 1.1 KiB

8 years ago
123456789101112131415161718192021222324252627282930313233
  1. using Discord.Net.WebSockets;
  2. using Discord.Rest;
  3. using System;
  4. namespace Discord.Rpc
  5. {
  6. public class DiscordRpcConfig : DiscordRestConfig
  7. {
  8. public const int RpcAPIVersion = 1;
  9. public const int PortRangeStart = 6463;
  10. public const int PortRangeEnd = 6472;
  11. /// <summary> Gets or sets the time, in milliseconds, to wait for a connection to complete before aborting. </summary>
  12. public int ConnectionTimeout { get; set; } = 30000;
  13. /// <summary> Gets or sets the provider used to generate new websocket connections. </summary>
  14. public WebSocketProvider WebSocketProvider { get; set; }
  15. public DiscordRpcConfig()
  16. {
  17. #if FILESYSTEM
  18. WebSocketProvider = () => new DefaultWebSocketClient();
  19. #else
  20. WebSocketProvider = () =>
  21. {
  22. throw new InvalidOperationException("The default websocket provider is not supported on this platform.\n" +
  23. "You must specify a WebSocketProvider or target a runtime supporting .NET Standard 1.3, such as .NET Framework 4.6+.");
  24. };
  25. #endif
  26. }
  27. }
  28. }