Browse Source

Add UseLargeThreshold config option

tags/docs-0.9
RogueException 9 years ago
parent
commit
3fdd39c462
2 changed files with 5 additions and 1 deletions
  1. +3
    -0
      src/Discord.Net/DiscordWSClientConfig.cs
  2. +2
    -1
      src/Discord.Net/Net/WebSockets/DataWebSocket.cs

+ 3
- 0
src/Discord.Net/DiscordWSClientConfig.cs View File

@@ -38,6 +38,9 @@ namespace Discord
/// <summary> (Experimental) Enables the voice websocket and UDP client. This option requires the libsodium .dll or .so be in the local lib/ folder. </summary> /// <summary> (Experimental) Enables the voice websocket and UDP client. This option requires the libsodium .dll or .so be in the local lib/ folder. </summary>
public bool EnableVoiceEncryption { get { return _enableVoiceEncryption; } set { SetValue(ref _enableVoiceEncryption, value); } } public bool EnableVoiceEncryption { get { return _enableVoiceEncryption; } set { SetValue(ref _enableVoiceEncryption, value); } }
private bool _enableVoiceEncryption = true; private bool _enableVoiceEncryption = true;
/// <summary> (Experimental) Instructs Discord to not send send information about offline users, for servers with more than 50 users. </summary>
public bool UseLargeThreshold { get { return _useLargeThreshold; } set { SetValue(ref _useLargeThreshold, value); } }
private bool _useLargeThreshold = false;


//Internals //Internals
internal bool VoiceOnly { get { return _voiceOnly; } set { SetValue(ref _voiceOnly, value); } } internal bool VoiceOnly { get { return _voiceOnly; } set { SetValue(ref _voiceOnly, value); } }


+ 2
- 1
src/Discord.Net/Net/WebSockets/DataWebSocket.cs View File

@@ -26,7 +26,8 @@ namespace Discord.Net.WebSockets
LoginCommand msg = new LoginCommand(); LoginCommand msg = new LoginCommand();
msg.Payload.Token = token; msg.Payload.Token = token;
msg.Payload.Properties["$device"] = "Discord.Net"; msg.Payload.Properties["$device"] = "Discord.Net";
msg.Payload.LargeThreshold = 50;
if (_client.Config.UseLargeThreshold)
msg.Payload.LargeThreshold = 50;
msg.Payload.Compress = true; msg.Payload.Compress = true;
QueueMessage(msg); QueueMessage(msg);
} }


Loading…
Cancel
Save