diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7a5b7502..a1074572 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,13 +3,13 @@ "isRoot": true, "tools": { "jetbrains.resharper.globaltools": { - "version": "2022.3.2", + "version": "2023.3.3", "commands": [ "jb" ] }, "nvika": { - "version": "2.2.0", + "version": "3.0.0", "commands": [ "nvika" ] @@ -21,4 +21,4 @@ ] } } -} +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7395e186..5fa59283 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,19 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - # FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side. - # https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e - - name: Install .NET 3.1.x LTS - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "3.1.x" + uses: actions/checkout@v3 - - name: Install .NET 6.0.x - uses: actions/setup-dotnet@v1 + - name: Install .NET 8.0.x + uses: actions/setup-dotnet@v3 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Restore Tools run: dotnet tool restore @@ -56,10 +49,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install .NET 6.0.x + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Docker compose run: docker compose up -d diff --git a/osu.Server.Queues.ScoreStatisticsProcessor.Tests/osu.Server.Queues.ScoreStatisticsProcessor.Tests.csproj b/osu.Server.Queues.ScoreStatisticsProcessor.Tests/osu.Server.Queues.ScoreStatisticsProcessor.Tests.csproj index 75a4a7e7..fa296a62 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor.Tests/osu.Server.Queues.ScoreStatisticsProcessor.Tests.csproj +++ b/osu.Server.Queues.ScoreStatisticsProcessor.Tests/osu.Server.Queues.ScoreStatisticsProcessor.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable false diff --git a/osu.Server.Queues.ScoreStatisticsProcessor.sln.DotSettings b/osu.Server.Queues.ScoreStatisticsProcessor.sln.DotSettings index ae6804e2..6c88080c 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor.sln.DotSettings +++ b/osu.Server.Queues.ScoreStatisticsProcessor.sln.DotSettings @@ -127,6 +127,8 @@ HINT HINT WARNING + HINT + HINT WARNING HINT HINT @@ -142,6 +144,7 @@ WARNING WARNING WARNING + HINT WARNING WARNING WARNING diff --git a/osu.Server.Queues.ScoreStatisticsProcessor/Dockerfile b/osu.Server.Queues.ScoreStatisticsProcessor/Dockerfile index 93326abc..8fb247f2 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor/Dockerfile +++ b/osu.Server.Queues.ScoreStatisticsProcessor/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers @@ -12,7 +12,7 @@ RUN dotnet publish -c Release -o out RUN rm -rf ./out/runtimes ./out/osu.Game.Resources.dll # Build runtime image -FROM mcr.microsoft.com/dotnet/runtime:6.0 +FROM mcr.microsoft.com/dotnet/runtime:8.0 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "osu.Server.Queues.ScoreStatisticsProcessor.dll"] diff --git a/osu.Server.Queues.ScoreStatisticsProcessor/Processors/ScorePerformanceProcessor.cs b/osu.Server.Queues.ScoreStatisticsProcessor/Processors/ScorePerformanceProcessor.cs index 95563c86..cb53b347 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor/Processors/ScorePerformanceProcessor.cs +++ b/osu.Server.Queues.ScoreStatisticsProcessor/Processors/ScorePerformanceProcessor.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Dapper; @@ -9,9 +10,7 @@ using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; using osu.Game.Rulesets.Difficulty; -using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Osu.Mods; using osu.Game.Scoring; using osu.Server.Queues.ScoreStatisticsProcessor.Helpers; using osu.Server.Queues.ScoreStatisticsProcessor.Models; @@ -199,56 +198,13 @@ Task markNonRanked() /// public static bool AllModsValidForPerformance(SoloScoreInfo score, Mod[] mods) { - foreach (var m in mods) - { - switch (m) - { - // Overrides for mods which would otherwise be allowed by the block below. - case ManiaModHardRock: - case ManiaModKey1: - case ManiaModKey2: - case ManiaModKey3: - case ManiaModKey10: - return false; - - // The mods which are allowed. - case ModEasy: - case ModNoFail: - case ModSuddenDeath: - case ModPerfect: - case ModHardRock: - case ModHidden: - case ModFlashlight: - case ModMuted: - case ModNightcore: - case ModDoubleTime: - case ModDaycore: - case ModHalfTime: - // osu!-specific: - case OsuModSpunOut: - case OsuModTouchDevice: - // mania-specific: - case ManiaKeyMod: - case ManiaModMirror: - break; - - // Classic mod is only allowed on legacy scores. - case ModClassic: - if (!score.IsLegacyScore) - return false; - - break; - - // Any other mods not in the above list aren't allowed. - default: - return false; - } + IEnumerable modsToCheck = mods; - if (!m.UsesDefaultConfiguration) - return false; - } + // Classic mod is only allowed on legacy scores. + if (score.IsLegacyScore) + modsToCheck = mods.Where(mod => mod is not ModClassic); - return true; + return modsToCheck.All(m => m.Ranked); } } } diff --git a/osu.Server.Queues.ScoreStatisticsProcessor/osu.Server.Queues.ScoreStatisticsProcessor.csproj b/osu.Server.Queues.ScoreStatisticsProcessor/osu.Server.Queues.ScoreStatisticsProcessor.csproj index e092de1f..507487c9 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor/osu.Server.Queues.ScoreStatisticsProcessor.csproj +++ b/osu.Server.Queues.ScoreStatisticsProcessor/osu.Server.Queues.ScoreStatisticsProcessor.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable osu.Server.Queues.ScoreStatisticsProcessor osu.Server.Queues.ScoreStatisticsProcessor @@ -12,11 +12,11 @@ - - - - - + + + + +