diff --git a/Discord.Net.sln b/Discord.Net.sln index 1c32308ff..23bc6153b 100644 --- a/Discord.Net.sln +++ b/Discord.Net.sln @@ -39,8 +39,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {ACFB060B-EC8A-4926-B293-04C01E17EE23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ACFB060B-EC8A-4926-B293-04C01E17EE23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACFB060B-EC8A-4926-B293-04C01E17EE23}.FullDebug|Any CPU.ActiveCfg = FullDebug|Any CPU - {ACFB060B-EC8A-4926-B293-04C01E17EE23}.FullDebug|Any CPU.Build.0 = FullDebug|Any CPU + {ACFB060B-EC8A-4926-B293-04C01E17EE23}.FullDebug|Any CPU.ActiveCfg = Debug|Any CPU + {ACFB060B-EC8A-4926-B293-04C01E17EE23}.FullDebug|Any CPU.Build.0 = Debug|Any CPU {ACFB060B-EC8A-4926-B293-04C01E17EE23}.Release|Any CPU.ActiveCfg = Release|Any CPU {ACFB060B-EC8A-4926-B293-04C01E17EE23}.Release|Any CPU.Build.0 = Release|Any CPU {19793545-EF89-48F4-8100-3EBAAD0A9141}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/README.md b/README.md index 625a06d10..ccea51b1b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Check out the [documentation](https://discordnet.readthedocs.org/en/latest/) or ### Current Features - Using Discord API v3 -- Supports .Net 4.5 and DNX 4.5.1 +- Supports .Net Framework 4.5 and .Net Core 5.0 - Server Management (Servers, Channels, Messages, Invites, Roles, Users) - Send/Receieve Messages (Including mentions and formatting) - Basic Voice Support (Outgoing only) @@ -17,4 +17,4 @@ You can download Discord.Net from NuGet: - [Discord.Net.Commands](https://www.nuget.org/packages/Discord.Net.Commands/) ### Known Issues -- DNX Core 5.0 is experiencing several network-related issues and support has been temporarily dropped. +- .Net Core 5.0 is experiencing several network-related issues and support has been temporarily dropped. diff --git a/global.json b/global.json index 546df03c7..6365fa817 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src" ], "sdk": { - "version": "1.0.0-beta6" + "version": "1.0.0-rc1-final" } } \ No newline at end of file diff --git a/src/Discord.Net.Commands/project.json b/src/Discord.Net.Commands/project.json index 78c853625..cb01c9677 100644 --- a/src/Discord.Net.Commands/project.json +++ b/src/Discord.Net.Commands/project.json @@ -19,7 +19,6 @@ "frameworks": { "net45": { }, - "dnx451": { }, - "dnxcore50": { } + "dotnet5.4": { } } } diff --git a/src/Discord.Net.Modules/project.json b/src/Discord.Net.Modules/project.json index dc45d5e77..5b962422b 100644 --- a/src/Discord.Net.Modules/project.json +++ b/src/Discord.Net.Modules/project.json @@ -20,7 +20,6 @@ "frameworks": { "net45": { }, - "dnx451": { }, - "dnxcore50": { } + "dotnet5.4": { } } } diff --git a/src/Discord.Net.Net45/Discord.Net.csproj b/src/Discord.Net.Net45/Discord.Net.csproj index f00b52c0d..1f001d361 100644 --- a/src/Discord.Net.Net45/Discord.Net.csproj +++ b/src/Discord.Net.Net45/Discord.Net.csproj @@ -61,8 +61,8 @@ - - ..\..\packages\WebSocketSharp.1.0.3-rc9\lib\websocket-sharp.dll + + ..\..\..\DiscordBot\packages\WebSocketSharp.1.0.3-rc10\lib\websocket-sharp.dll True diff --git a/src/Discord.Net.Net45/packages.config b/src/Discord.Net.Net45/packages.config index c5325909b..ca992a939 100644 --- a/src/Discord.Net.Net45/packages.config +++ b/src/Discord.Net.Net45/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/Discord.Net/Net/Rest/RestClient.cs b/src/Discord.Net/Net/Rest/RestClient.cs index a7dfc8fe9..cf33c6451 100644 --- a/src/Discord.Net/Net/Rest/RestClient.cs +++ b/src/Discord.Net/Net/Rest/RestClient.cs @@ -16,8 +16,8 @@ namespace Discord.Net.Rest public RestClient(DiscordAPIClientConfig config) { _config = config; -#if !DNXCORE50 - _engine = new SharpRestEngine(config); +#if !DOTNET5_4 + _engine = new RestSharpEngine(config); #else //_engine = new BuiltInRestEngine(config); #endif diff --git a/src/Discord.Net/Net/Rest/SharpRestEngine.cs b/src/Discord.Net/Net/Rest/SharpRestEngine.cs index 72a3d7281..64382eaca 100644 --- a/src/Discord.Net/Net/Rest/SharpRestEngine.cs +++ b/src/Discord.Net/Net/Rest/SharpRestEngine.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 +#if !DOTNET5_4 using Discord.API; using RestSharp; using System; @@ -8,12 +8,12 @@ using System.Threading.Tasks; namespace Discord.Net.Rest { - internal sealed class SharpRestEngine : IRestEngine + internal sealed class RestSharpEngine : IRestEngine { private readonly DiscordAPIClientConfig _config; private readonly RestSharp.RestClient _client; - public SharpRestEngine(DiscordAPIClientConfig config) + public RestSharpEngine(DiscordAPIClientConfig config) { _config = config; _client = new RestSharp.RestClient(Endpoints.BaseApi) diff --git a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs index 7287f477e..a060f78d1 100644 --- a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs +++ b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs @@ -135,7 +135,7 @@ namespace Discord.Net.WebSockets else //Dont make an OS thread if we only want to capture one packet... tasks.Add(Task.Run(() => ReceiveVoiceAsync(_cancelToken))); -#if !DNXCORE50 +#if !DOTNET5_4 tasks.Add(WatcherAsync()); #endif if (tasks.Count > 0) @@ -199,10 +199,10 @@ namespace Discord.Net.WebSockets Thread.Sleep(1); if (_udp.Available > 0) { -#if !DNXCORE50 +#if !DOTNET5_4 packet = _udp.Receive(ref endpoint); #else - //TODO: Is this really the only way to end a Receive call in DNXCore? + //TODO: Is this really the only way to end a Receive call in DOTNET5_4? var receiveTask = _udp.ReceiveAsync(); var task = Task.WhenAny(closeTask, receiveTask).Result; if (task == closeTask) @@ -221,7 +221,7 @@ namespace Discord.Net.WebSockets return; int port = packet[68] | packet[69] << 8; - string ip = Encoding.ASCII.GetString(packet, 4, 70 - 6).TrimEnd('\0'); + string ip = Encoding.UTF8.GetString(packet, 4, 70 - 6).TrimEnd('\0'); var login2 = new VoiceLogin2Command(); login2.Payload.Protocol = "udp"; @@ -423,7 +423,7 @@ namespace Discord.Net.WebSockets catch (OperationCanceledException) { } catch (InvalidOperationException) { } //Includes ObjectDisposedException } -#if !DNXCORE50 +#if !DOTNET5_4 //Closes the UDP socket when _disconnectToken is triggered, since UDPClient doesn't allow passing a canceltoken private Task WatcherAsync() { diff --git a/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs b/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs index 4d29b720b..6062265ae 100644 --- a/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs +++ b/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs @@ -1,6 +1,5 @@ -#if DNXCORE50zzz -using Discord.Helpers; -using System; +#if DOTNET5_4 +/*using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; @@ -149,5 +148,5 @@ namespace Discord.Net.WebSockets _sendQueue.Enqueue(message); } } -} +}*/ #endif \ No newline at end of file diff --git a/src/Discord.Net/Net/WebSockets/WebSocket.cs b/src/Discord.Net/Net/WebSockets/WebSocket.cs index b1115a2de..cd45cd20b 100644 --- a/src/Discord.Net/Net/WebSockets/WebSocket.cs +++ b/src/Discord.Net/Net/WebSockets/WebSocket.cs @@ -52,7 +52,7 @@ namespace Discord.Net.WebSockets _cancelToken = new CancellationToken(true); _connectedEvent = new ManualResetEventSlim(false); -#if !DNXCORE50 +#if !DOTNET5_4 _engine = new WebSocketSharpEngine(this, client.Config); #else //_engine = new BuiltInWebSocketEngine(this, client.Config); diff --git a/src/Discord.Net/Net/WebSockets/WebSocketSharpEngine.cs b/src/Discord.Net/Net/WebSockets/WebSocketSharpEngine.cs index 870ed84f0..0b3cf001e 100644 --- a/src/Discord.Net/Net/WebSockets/WebSocketSharpEngine.cs +++ b/src/Discord.Net/Net/WebSockets/WebSocketSharpEngine.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 +#if !DOTNET5_4 using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -40,13 +40,13 @@ namespace Discord.Net.WebSockets _webSocket = new WSSharpNWebSocket(host); _webSocket.EmitOnPing = false; _webSocket.EnableRedirection = true; - _webSocket.Compression = WebSocketSharp.CompressionMethod.Deflate; + _webSocket.Compression = WebSocketSharp.CompressionMethod.Deflate; _webSocket.SetProxy(_config.ProxyUrl, _config.ProxyCredentials?.UserName, _config.ProxyCredentials?.Password); _webSocket.OnMessage += (s, e) => { - if (e.Type == WebSocketSharp.Opcode.Binary) + if (e.IsBinary) RaiseBinaryMessage(e.RawData); - else if (e.Type == WebSocketSharp.Opcode.Text) + else if (e.IsText) RaiseTextMessage(e.Data); }; _webSocket.OnError += async (s, e) => diff --git a/src/Discord.Net/project.json b/src/Discord.Net/project.json index 812ff4123..7a00691da 100644 --- a/src/Discord.Net/project.json +++ b/src/Discord.Net/project.json @@ -18,7 +18,7 @@ "allowUnsafe": true }, "configurations": { - "FullDebug": { + "TestResponses": { "compilationOptions": { "define": [ "DEBUG", @@ -29,15 +29,15 @@ } }, - "dependencies": { - "Newtonsoft.Json": "7.0.1" - }, + "dependencies": { + "Newtonsoft.Json": "7.0.1" + }, "frameworks": { "net45": { "dependencies": { - "RestSharp": "105.2.3", - "WebSocketSharp": "1.0.3-rc9" + "WebSocketSharp": "1.0.3-rc10", + "RestSharp": "105.2.3" } }, "dotnet5.4": { @@ -47,7 +47,7 @@ "System.IO.Compression": "4.1.0-beta-23516", "System.Linq": "4.0.1-beta-23516", "System.Net.NameResolution": "4.0.0-beta-23516", - "System.Net.Sockets": "4.1.0-beta-23516", + "System.Net.Sockets": "4.1.0-beta-23409", "System.Net.Requests": "4.0.11-beta-23516", "System.Net.WebSockets.Client": "4.0.0-beta-23516", "System.Runtime.InteropServices": "4.0.21-beta-23516",