Browse Source

Moved SSL workaround to Config.UseAlternateEndpoint

tags/docs-0.9
RogueException 9 years ago
parent
commit
cfd9496972
2 changed files with 10 additions and 4 deletions
  1. +2
    -1
      src/Discord.Net/DiscordClient.cs
  2. +8
    -3
      src/Discord.Net/DiscordClientConfig.cs

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

@@ -253,7 +253,8 @@ namespace Discord


_api.Token = token; _api.Token = token;
string gateway = (await _api.Gateway().ConfigureAwait(false)).Url; string gateway = (await _api.Gateway().ConfigureAwait(false)).Url;
gateway = gateway.Replace("discord.gg", "discordapp.net"); //Temporary SSL workaround
if (_config.UseAlternateEndpoint)
gateway = gateway.Replace("discord.gg", "discordapp.net"); //Temporary SSL workaround
if (_config.LogLevel >= LogMessageSeverity.Verbose) if (_config.LogLevel >= LogMessageSeverity.Verbose)
RaiseOnLog(LogMessageSeverity.Verbose, LogMessageSource.Client, $"Websocket endpoint: {gateway}"); RaiseOnLog(LogMessageSeverity.Verbose, LogMessageSource.Client, $"Websocket endpoint: {gateway}");




+ 8
- 3
src/Discord.Net/DiscordClientConfig.cs View File

@@ -49,6 +49,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) Enables the client to be simultaneously connected to multiple channels at once (Discord still limits you to one channel per server). </summary>
public bool EnableVoiceMultiserver { get { return _enableVoiceMultiserver; } set { SetValue(ref _enableVoiceMultiserver, value); } }
private bool _enableVoiceMultiserver = false;
#else #else
internal DiscordVoiceMode VoiceMode => DiscordVoiceMode.Disabled; internal DiscordVoiceMode VoiceMode => DiscordVoiceMode.Disabled;
internal bool EnableVoiceEncryption => false; internal bool EnableVoiceEncryption => false;
@@ -60,15 +63,17 @@ namespace Discord
/// <summary> (Experimental) Maintains the LastActivity property for users, showing when they last made an action (sent message, joined server, typed, etc). </summary> /// <summary> (Experimental) Maintains the LastActivity property for users, showing when they last made an action (sent message, joined server, typed, etc). </summary>
public bool TrackActivity { get { return _trackActivity; } set { SetValue(ref _trackActivity, value); } } public bool TrackActivity { get { return _trackActivity; } set { SetValue(ref _trackActivity, value); } }
private bool _trackActivity = true; private bool _trackActivity = true;
/// <summary> (Experimental) Uses a temporary workaround to the SSL issues via an alternate endpoint provided by the Discord developers. This option will be removed when the certificate chain is fixed on the main endpoints. </summary>
public bool UseAlternateEndpoint { get { return _useAlternateEndpoint; } set { SetValue(ref _useAlternateEndpoint, value); } }
private bool _useAlternateEndpoint = false;


/// <summary> (Experimental) Enables the client to be simultaneously connected to multiple channels at once (Discord still limits you to one channel per server). </summary>
public bool EnableVoiceMultiserver { get { return _enableVoiceMultiserver; } set { SetValue(ref _enableVoiceMultiserver, value); } }
private bool _enableVoiceMultiserver = false;
//Internals
internal bool VoiceOnly { get { return _voiceOnly; } set { SetValue(ref _voiceOnly, value); } } internal bool VoiceOnly { get { return _voiceOnly; } set { SetValue(ref _voiceOnly, value); } }
private bool _voiceOnly; private bool _voiceOnly;
internal uint VoiceClientId { get { return _voiceClientId; } set { SetValue(ref _voiceClientId, value); } } internal uint VoiceClientId { get { return _voiceClientId; } set { SetValue(ref _voiceClientId, value); } }
private uint _voiceClientId; private uint _voiceClientId;



internal string UserAgent internal string UserAgent
{ {
get get


Loading…
Cancel
Save