From f0060f95364404edaedb12259c0ef291ac5d1fe2 Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 12 Feb 2016 11:29:13 -0400 Subject: [PATCH 1/5] Swapped explicitness of ServiceManager's GetEnumerators --- src/Discord.Net/ServiceManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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(); } } From 45ee58a4d5b2f730ee81aed1db412f2647544cc3 Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 12 Feb 2016 20:49:11 -0400 Subject: [PATCH 2/5] Made large_threshold mandatory --- .../API/Client/GatewaySocket/Commands/Identify.cs | 2 +- src/Discord.Net/DiscordClient.cs | 7 +------ src/Discord.Net/DiscordConfig.cs | 7 ++----- src/Discord.Net/Net/WebSockets/GatewaySocket.cs | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) 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); From 8e8c2cc7fb7a7d4b14688e319f645838c6f3cfda Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 12 Feb 2016 22:08:56 -0400 Subject: [PATCH 3/5] Don't automatically unwhitelist a server on leave --- src/Discord.Net.Modules/ModuleManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }; From 34fd47bb5dc364481c071d2a5425480d197126b2 Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 12 Feb 2016 22:09:02 -0400 Subject: [PATCH 4/5] 0.9-rc3 --- README.md | 2 +- src/Discord.Net.Audio/project.json | 4 +-- src/Discord.Net.Commands/project.json | 42 ++++++++++++------------- src/Discord.Net.Modules/project.json | 44 +++++++++++++-------------- src/Discord.Net/project.json | 2 +- 5 files changed, 47 insertions(+), 47 deletions(-) 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/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/project.json b/src/Discord.Net/project.json index 00678503b..9402eb438 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", "description": "An unofficial .Net API wrapper for the Discord client.", "authors": [ "RogueException" From 206621110d698b48de6e2dd12e407561c73b78ee Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 12 Feb 2016 23:02:56 -0400 Subject: [PATCH 5/5] Fix nuget GAC issues --- src/Discord.Net/project.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net/project.json b/src/Discord.Net/project.json index 9402eb438..90698d5c7 100644 --- a/src/Discord.Net/project.json +++ b/src/Discord.Net/project.json @@ -1,5 +1,5 @@ { - "version": "0.9.0-rc3", + "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",