diff --git a/README.md b/README.md index 19d082d17..0cf8de14e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Discord.Net v0.9.0 +# Discord.Net v0.9.0-rc3 An unofficial .Net API Wrapper for the Discord client (http://discordapp.com). Check out the [documentation](https://discordnet.readthedocs.org/en/latest/) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx). diff --git a/src/Discord.Net.Audio/project.json b/src/Discord.Net.Audio/project.json index a0bfa7a19..32a2b671d 100644 --- a/src/Discord.Net.Audio/project.json +++ b/src/Discord.Net.Audio/project.json @@ -1,5 +1,5 @@ { - "version": "0.9.0", + "version": "0.9.0-rc3", "description": "A Discord.Net extension adding voice support.", "authors": [ "RogueException" ], "tags": [ "discord", "discordapp" ], @@ -18,7 +18,7 @@ }, "dependencies": { - "Discord.Net": "0.9.0" + "Discord.Net": "0.9.0-rc3" }, "frameworks": { "net45": { }, diff --git a/src/Discord.Net.Commands/project.json b/src/Discord.Net.Commands/project.json index 1637df718..7a42cd817 100644 --- a/src/Discord.Net.Commands/project.json +++ b/src/Discord.Net.Commands/project.json @@ -1,25 +1,25 @@ { - "version": "0.9.0", - "description": "A Discord.Net extension adding basic command support.", - "authors": [ "RogueException" ], - "tags": [ "discord", "discordapp" ], - "projectUrl": "https://github.com/RogueException/Discord.Net", - "licenseUrl": "http://opensource.org/licenses/MIT", - "repository": { - "type": "git", - "url": "git://github.com/RogueException/Discord.Net" - }, - "compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ], + "version": "0.9.0-rc3", + "description": "A Discord.Net extension adding basic command support.", + "authors": [ "RogueException" ], + "tags": [ "discord", "discordapp" ], + "projectUrl": "https://github.com/RogueException/Discord.Net", + "licenseUrl": "http://opensource.org/licenses/MIT", + "repository": { + "type": "git", + "url": "git://github.com/RogueException/Discord.Net" + }, + "compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ], - "compilationOptions": { - "warningsAsErrors": true - }, + "compilationOptions": { + "warningsAsErrors": true + }, - "dependencies": { - "Discord.Net": "0.9.0" - }, - "frameworks": { - "net45": { }, - "dotnet5.4": { } - } + "dependencies": { + "Discord.Net": "0.9.0-rc3" + }, + "frameworks": { + "net45": { }, + "dotnet5.4": { } + } } diff --git a/src/Discord.Net.Modules/ModuleManager.cs b/src/Discord.Net.Modules/ModuleManager.cs index f6665bfb3..c2a8d400f 100644 --- a/src/Discord.Net.Modules/ModuleManager.cs +++ b/src/Discord.Net.Modules/ModuleManager.cs @@ -98,7 +98,7 @@ namespace Discord.Modules client.RoleDeleted += (s, e) => { if (HasIndirectServer(e.Server)) RoleDeleted(s, e); }; client.JoinedServer += (s, e) => { if (_allowAll) JoinedServer(s, e); }; - client.LeftServer += (s, e) => { if (HasIndirectServer(e.Server)) { DisableServer(e.Server); LeftServer(s, e); } }; + client.LeftServer += (s, e) => { if (HasIndirectServer(e.Server)) LeftServer(s, e); }; client.ServerUpdated += (s, e) => { if (HasIndirectServer(e.After)) ServerUpdated(s, e); }; client.ServerUnavailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerUnavailable(s, e); }; client.ServerAvailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerAvailable(s, e); }; diff --git a/src/Discord.Net.Modules/project.json b/src/Discord.Net.Modules/project.json index e5a1314a9..c40a4ad66 100644 --- a/src/Discord.Net.Modules/project.json +++ b/src/Discord.Net.Modules/project.json @@ -1,26 +1,26 @@ { - "version": "0.9.0", - "description": "A Discord.Net extension adding basic plugin support.", - "authors": [ "RogueException" ], - "tags": [ "discord", "discordapp" ], - "projectUrl": "https://github.com/RogueException/Discord.Net", - "licenseUrl": "http://opensource.org/licenses/MIT", - "repository": { - "type": "git", - "url": "git://github.com/RogueException/Discord.Net" - }, - "compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ], + "version": "0.9.0-rc3", + "description": "A Discord.Net extension adding basic plugin support.", + "authors": [ "RogueException" ], + "tags": [ "discord", "discordapp" ], + "projectUrl": "https://github.com/RogueException/Discord.Net", + "licenseUrl": "http://opensource.org/licenses/MIT", + "repository": { + "type": "git", + "url": "git://github.com/RogueException/Discord.Net" + }, + "compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ], - "compilationOptions": { - "warningsAsErrors": true - }, + "compilationOptions": { + "warningsAsErrors": true + }, - "dependencies": { - "Discord.Net": "0.9.0", - "Discord.Net.Commands": "0.9.0" - }, - "frameworks": { - "net45": { }, - "dotnet5.4": { } - } + "dependencies": { + "Discord.Net": "0.9.0-rc3", + "Discord.Net.Commands": "0.9.0-rc3" + }, + "frameworks": { + "net45": { }, + "dotnet5.4": { } + } } diff --git a/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs b/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs index 2a56143c8..8437f595c 100644 --- a/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs +++ b/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs @@ -17,7 +17,7 @@ namespace Discord.API.Client.GatewaySocket [JsonProperty("properties")] public Dictionary Properties { get; set; } [JsonProperty("large_threshold", NullValueHandling = NullValueHandling.Ignore)] - public int? LargeThreshold { get; set; } + public int LargeThreshold { get; set; } [JsonProperty("compress")] public bool UseCompression { get; set; } } diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs index 2aa3533ea..dd2706c85 100644 --- a/src/Discord.Net/DiscordClient.cs +++ b/src/Discord.Net/DiscordClient.cs @@ -896,12 +896,7 @@ namespace Discord break; } else - { - if (Config.UseLargeThreshold) - user = server.AddUser(data.User.Id); - else - user = server.GetUser(data.User.Id); - } + user = server.AddUser(data.User.Id); } if (user != null) diff --git a/src/Discord.Net/DiscordConfig.cs b/src/Discord.Net/DiscordConfig.cs index c22b60163..453f0952d 100644 --- a/src/Discord.Net/DiscordConfig.cs +++ b/src/Discord.Net/DiscordConfig.cs @@ -34,8 +34,6 @@ namespace Discord /// Gets or sets whether an encrypted login token should be saved to temp dir after successful login. public bool CacheToken { get; set; } = true; - /// Gets or sets whether Discord should send information about offline users, for servers with more than 100 users. - public bool UseLargeThreshold { get; set; } = false; /// Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. public int MessageCacheSize { get; set; } = 100; /// Gets or sets whether the permissions cache should be used. This makes operations such as User.GetPermissions(Channel), User.ServerPermissions and Channel.Members @@ -74,7 +72,7 @@ namespace Discord public int ReconnectDelay { get; } public int FailedReconnectDelay { get; } - public bool UseLargeThreshold { get; } + public int LargeThreshold { get; } = 250; public int MessageCacheSize { get; } public bool UsePermissionsCache { get; } public bool EnablePreUpdateEvents { get; } @@ -90,8 +88,7 @@ namespace Discord ConnectionTimeout = builder.ConnectionTimeout; ReconnectDelay = builder.ReconnectDelay; FailedReconnectDelay = builder.FailedReconnectDelay; - - UseLargeThreshold = builder.UseLargeThreshold; + MessageCacheSize = builder.MessageCacheSize; UsePermissionsCache = builder.UsePermissionsCache; EnablePreUpdateEvents = builder.EnablePreUpdateEvents; diff --git a/src/Discord.Net/Net/WebSockets/GatewaySocket.cs b/src/Discord.Net/Net/WebSockets/GatewaySocket.cs index 5ce370b51..bccdf10cc 100644 --- a/src/Discord.Net/Net/WebSockets/GatewaySocket.cs +++ b/src/Discord.Net/Net/WebSockets/GatewaySocket.cs @@ -161,7 +161,7 @@ namespace Discord.Net.WebSockets Version = 3, Token = token, Properties = props, - LargeThreshold = _config.UseLargeThreshold ? 100 : (int?)null, + LargeThreshold = _config.LargeThreshold, UseCompression = true }; QueueMessage(msg); diff --git a/src/Discord.Net/ServiceManager.cs b/src/Discord.Net/ServiceManager.cs index e874b87e4..8bb7a678a 100644 --- a/src/Discord.Net/ServiceManager.cs +++ b/src/Discord.Net/ServiceManager.cs @@ -38,8 +38,7 @@ namespace Discord return singletonT; } - IEnumerator IEnumerable.GetEnumerator() => _services.Values.GetEnumerator(); - - public IEnumerator GetEnumerator() => _services.Values.GetEnumerator(); + public IEnumerator GetEnumerator() => _services.Values.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => _services.Values.GetEnumerator(); } } diff --git a/src/Discord.Net/project.json b/src/Discord.Net/project.json index 00678503b..90698d5c7 100644 --- a/src/Discord.Net/project.json +++ b/src/Discord.Net/project.json @@ -1,5 +1,5 @@ { - "version": "0.9.0", + "version": "0.9.0-rc3-2", "description": "An unofficial .Net API wrapper for the Discord client.", "authors": [ "RogueException" @@ -63,8 +63,14 @@ }, "net45": { "frameworkAssemblies": { - "System.Runtime": "4.0.0.0", - "System.Threading.Tasks": "4.0.0.0" + "System.Runtime": { + "type": "build", + "version": "" + }, + "System.Threading.Tasks": { + "type": "build", + "version": "" + } }, "dependencies": { "WebSocket4Net": "0.14.1",