diff --git a/Clients/CirrusCiClient/CirrusCiClient.csproj b/Clients/CirrusCiClient/CirrusCiClient.csproj index 7f0e683c..d281a3fe 100644 --- a/Clients/CirrusCiClient/CirrusCiClient.csproj +++ b/Clients/CirrusCiClient/CirrusCiClient.csproj @@ -1,20 +1,21 @@ - - net6.0 - enable - true - - - - - - - - - - - - all - - - \ No newline at end of file + + + net5.0 + enable + false + + + + + + + + + + + + + + + diff --git a/Clients/CompatApiClient/CompatApiClient.csproj b/Clients/CompatApiClient/CompatApiClient.csproj index 9fe5222f..8c677e54 100644 --- a/Clients/CompatApiClient/CompatApiClient.csproj +++ b/Clients/CompatApiClient/CompatApiClient.csproj @@ -1,7 +1,7 @@ - net6.0 + net5.0 enable @@ -15,9 +15,9 @@ - - - + + + diff --git a/Clients/GithubClient/GithubClient.csproj b/Clients/GithubClient/GithubClient.csproj index b34c5e44..48c5d189 100644 --- a/Clients/GithubClient/GithubClient.csproj +++ b/Clients/GithubClient/GithubClient.csproj @@ -1,17 +1,18 @@ + - net6.0 + net5.0 latest enable + - + - - all - + - \ No newline at end of file + + diff --git a/Clients/IrdLibraryClient/IrdLibraryClient.csproj b/Clients/IrdLibraryClient/IrdLibraryClient.csproj index 3ab0130d..990f625b 100644 --- a/Clients/IrdLibraryClient/IrdLibraryClient.csproj +++ b/Clients/IrdLibraryClient/IrdLibraryClient.csproj @@ -1,19 +1,20 @@ + - net6.0 + net5.0 latest enable + - - - - - all - + + + + - \ No newline at end of file + + diff --git a/Clients/MediafireClient/MediafireClient.csproj b/Clients/MediafireClient/MediafireClient.csproj index cdc067ad..b16a631e 100644 --- a/Clients/MediafireClient/MediafireClient.csproj +++ b/Clients/MediafireClient/MediafireClient.csproj @@ -1,14 +1,12 @@ - - net6.0 - enable - - - - - - - all - - - \ No newline at end of file + + + net5.0 + enable + + + + + + + diff --git a/Clients/OneDriveClient/OneDriveClient.csproj b/Clients/OneDriveClient/OneDriveClient.csproj index cdc067ad..b769db4c 100644 --- a/Clients/OneDriveClient/OneDriveClient.csproj +++ b/Clients/OneDriveClient/OneDriveClient.csproj @@ -1,14 +1,12 @@ + - net6.0 + net5.0 enable + - - - all - - - \ No newline at end of file + + diff --git a/Clients/PsnClient/PsnClient.csproj b/Clients/PsnClient/PsnClient.csproj index c4ed2dec..0fa241be 100644 --- a/Clients/PsnClient/PsnClient.csproj +++ b/Clients/PsnClient/PsnClient.csproj @@ -1,23 +1,26 @@  + - net6.0 + net5.0 enable + + + - - - - all - + + + - \ No newline at end of file + + diff --git a/Clients/YandexDiskClient/YandexDiskClient.csproj b/Clients/YandexDiskClient/YandexDiskClient.csproj index cdc067ad..b16a631e 100644 --- a/Clients/YandexDiskClient/YandexDiskClient.csproj +++ b/Clients/YandexDiskClient/YandexDiskClient.csproj @@ -1,14 +1,12 @@ - - net6.0 - enable - - - - - - - all - - - \ No newline at end of file + + + net5.0 + enable + + + + + + + diff --git a/CompatBot/Commands/BotStats.cs b/CompatBot/Commands/BotStats.cs index f57598ca..a81af70f 100644 --- a/CompatBot/Commands/BotStats.cs +++ b/CompatBot/Commands/BotStats.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using CompatApiClient; @@ -14,6 +13,7 @@ using CompatBot.Utils; using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.Entities; +using Microsoft.DotNet.PlatformAbstractions; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; @@ -44,7 +44,7 @@ namespace CompatBot.Commands .AddField(".NET Info", $"{System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}\n" + $"{(System.Runtime.GCSettings.IsServerGC ? "Server" : "Workstation")} GC Mode", true) .AddField("Runtime Info", $"Confinement: {SandboxDetector.Detect()}\n" + - $"OS: {RuntimeInformation.OSDescription} {Environment.OSVersion}\n" + + $"OS: {RuntimeEnvironment.OperatingSystem} {RuntimeEnvironment.OperatingSystemVersion}\n" + $"CPUs: {Environment.ProcessorCount}\n" + $"Time zones: {TimeParser.TimeZoneMap.Count} out of {TimeParser.TimeZoneAcronyms.Count} resolved, {TimeZoneInfo.GetSystemTimeZones().Count} total", true); AppendPiracyStats(embed); diff --git a/CompatBot/Commands/Misc.cs b/CompatBot/Commands/Misc.cs index 19fe2403..85f53674 100644 --- a/CompatBot/Commands/Misc.cs +++ b/CompatBot/Commands/Misc.cs @@ -136,7 +136,6 @@ namespace CompatBot.Commands public async Task About(CommandContext ctx) { var hcorion = ctx.Client.GetEmoji(":hcorion:", DiscordEmoji.FromUnicode("🍁")); - var clienthax = ctx.Client.GetEmoji(":gooseknife:", DiscordEmoji.FromUnicode("🐱")); var embed = new DiscordEmbedBuilder { Title = "RPCS3 Compatibility Bot", @@ -144,9 +143,7 @@ namespace CompatBot.Commands Color = DiscordColor.Purple, }.AddField("Made by", "💮 13xforever\n" + - "🇭🇷 Roberto Anić Banić aka nicba1010\n" + - $"{clienthax} clienthax\n" - ) + "🇭🇷 Roberto Anić Banić aka nicba1010") .AddField("People who ~~broke~~ helped test the bot", "🐱 Juhn\n" + $"{hcorion} hcorion\n" + diff --git a/CompatBot/CompatBot.csproj b/CompatBot/CompatBot.csproj index 640636cf..c324a8b1 100644 --- a/CompatBot/CompatBot.csproj +++ b/CompatBot/CompatBot.csproj @@ -1,7 +1,8 @@  + Exe - net6.0 + net5.0 true CompatBot c2e6548b-b215-4a18-a010-958ef294b310 @@ -12,65 +13,78 @@ enable false + + + + Always + PreserveNewest + + - - - + + + + - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + + + - - - - + + + + + - + + - - - all - + + + @@ -83,4 +97,5 @@ - \ No newline at end of file + + diff --git a/CompatBot/EventHandlers/LogParsing/SourceHandlers/MegaHandler.cs b/CompatBot/EventHandlers/LogParsing/SourceHandlers/MegaHandler.cs index 1f72b1d4..7374c320 100644 --- a/CompatBot/EventHandlers/LogParsing/SourceHandlers/MegaHandler.cs +++ b/CompatBot/EventHandlers/LogParsing/SourceHandlers/MegaHandler.cs @@ -74,7 +74,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers { private readonly IMegaApiClient client; private readonly Uri uri; - private readonly INode node; + private readonly INodeInfo node; private readonly IArchiveHandler handler; public string SourceType => "Mega"; @@ -83,7 +83,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers public long SourceFilePosition => handler.SourcePosition; public long LogFileSize => handler.LogSize; - internal MegaSource(IMegaApiClient client, Uri uri, INode node, IArchiveHandler handler) + internal MegaSource(IMegaApiClient client, Uri uri, INodeInfo node, IArchiveHandler handler) { this.client = client; this.uri = uri; diff --git a/CompatBot/Utils/Extensions/EnumerableExtensions.cs b/CompatBot/Utils/Extensions/EnumerableExtensions.cs index 1a10efd5..93be3457 100644 --- a/CompatBot/Utils/Extensions/EnumerableExtensions.cs +++ b/CompatBot/Utils/Extensions/EnumerableExtensions.cs @@ -56,5 +56,7 @@ namespace CompatBot.Utils .Select(g => g.Select(x => x.item)); } + public static IEnumerable DistinctBy(this IEnumerable items, Func property) + => items.GroupBy(property).Select(x => x.First()); } } diff --git a/CompatBot/Utils/OpenSslConfigurator.cs b/CompatBot/Utils/OpenSslConfigurator.cs index 84dd2616..1113891e 100644 --- a/CompatBot/Utils/OpenSslConfigurator.cs +++ b/CompatBot/Utils/OpenSslConfigurator.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Microsoft.DotNet.PlatformAbstractions; @@ -11,7 +10,7 @@ namespace CompatBot.Utils { public static async Task CheckAndFixSystemConfigAsync() { - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Linux) return; try diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs index 9361fbdd..7d152a70 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs @@ -5,7 +5,6 @@ using System.ComponentModel; using System.Globalization; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -624,7 +623,7 @@ namespace CompatBot.Utils.ResultFormatters else notes.Add($"ℹ [Error 0x{code:x}]({link}): {error.description}"); } - else if (items["os_type"] == "Linux" && RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + else if (items["os_type"] == "Linux" && RuntimeEnvironment.OperatingSystemPlatform == Platform.Linux) foreach (var code in win32ErrorCodes) { try diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs index d09fb079..addf3c86 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; -using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading.Tasks; using CompatApiClient; @@ -320,7 +319,7 @@ namespace CompatBot.Utils.ResultFormatters { var items = state.CompletedCollection!; var multiItems = state.CompleteMultiValueCollection!; - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Linux) { var itemKeys = items.AllKeys; foreach (var key in itemKeys) diff --git a/HomoglyphConverter/HomoglyphConverter.csproj b/HomoglyphConverter/HomoglyphConverter.csproj index 42039e39..537fa2bf 100644 --- a/HomoglyphConverter/HomoglyphConverter.csproj +++ b/HomoglyphConverter/HomoglyphConverter.csproj @@ -1,7 +1,7 @@ - net6.0 + net5.0 latest enable false diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 0bba9f62..536ff9a5 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,28 +1,31 @@  + - net6.0 + net5.0 + false + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - + + Always - \ No newline at end of file + + diff --git a/discord-bot-net.sln b/discord-bot-net.sln index 5388d400..1574bb75 100644 --- a/discord-bot-net.sln +++ b/discord-bot-net.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28917.181 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompatBot", "CompatBot\CompatBot.csproj", "{6D9CA448-60C1-4D66-91D6-EC6C586508E6}" EndProject @@ -23,13 +23,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .cirrus.yml = .cirrus.yml azure-pipelines.yml = azure-pipelines.yml - .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml CONTRIBUTING.md = CONTRIBUTING.md docker-compose.example.yml = docker-compose.example.yml Dockerfile = Dockerfile nuget.config = nuget.config README.md = README.md SECURITY.md = SECURITY.md + .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneDriveClient", "Clients\OneDriveClient\OneDriveClient.csproj", "{5C4BCF33-2EC6-455F-B026-8A0001B7B7AD}"