1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-04 04:42:55 +08:00

Merge branch 'master' into multi-queueing-modes

This commit is contained in:
Dan Balasescu 2021-11-19 18:58:15 +09:00
commit de0e8ad822
6 changed files with 56 additions and 21 deletions

View File

@ -38,7 +38,7 @@ jobs:
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf run: dotnet build -c Debug -warnaserror osu.Desktop.slnf
- name: Test - name: Test
run: dotnet test $pwd/*.Tests/bin/Debug/*/*.Tests.dll --logger "trx;LogFileName=TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx" run: dotnet test $pwd/*.Tests/bin/Debug/*/*.Tests.dll --blame-crash --blame-hang --blame-hang-timeout 5m --logger "trx;LogFileName=TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx"
shell: pwsh shell: pwsh
# Attempt to upload results even if test fails. # Attempt to upload results even if test fails.
@ -48,7 +48,7 @@ jobs:
if: ${{ always() }} if: ${{ always() }}
with: with:
name: osu-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}} name: osu-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}}
path: ${{github.workspace}}/TestResults/TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx path: ${{github.workspace}}/TestResults/**/*
build-only-android: build-only-android:
name: Build only (Android) name: Build only (Android)

View File

@ -168,6 +168,28 @@ namespace osu.Game.Rulesets.Catch.Tests
checkHyperDash(false); checkHyperDash(false);
} }
[Test]
public void TestLastBananaShouldClearPlateOnMiss()
{
AddStep("catch fruit", () => attemptCatch(new Fruit()));
checkPlate(1);
AddStep("miss banana", () => attemptCatch(new Banana { X = 100 }));
checkPlate(1);
AddStep("miss last banana", () => attemptCatch(new Banana { LastInCombo = true, X = 100 }));
checkPlate(0);
}
[Test]
public void TestLastBananaShouldClearPlateOnCatch()
{
AddStep("catch fruit", () => attemptCatch(new Fruit()));
checkPlate(1);
AddStep("catch banana", () => attemptCatch(new Banana()));
checkPlate(2);
AddStep("catch last banana", () => attemptCatch(new Banana { LastInCombo = true }));
checkPlate(0);
}
[Test] [Test]
public void TestCatcherRandomStacking() public void TestCatcherRandomStacking()
{ {

View File

@ -210,6 +210,7 @@ namespace osu.Game.Rulesets.Catch.UI
catchResult.CatcherAnimationState = CurrentState; catchResult.CatcherAnimationState = CurrentState;
catchResult.CatcherHyperDash = HyperDashing; catchResult.CatcherHyperDash = HyperDashing;
// Ignore JuiceStreams and BananaShowers
if (!(drawableObject is DrawablePalpableCatchHitObject palpableObject)) return; if (!(drawableObject is DrawablePalpableCatchHitObject palpableObject)) return;
var hitObject = palpableObject.HitObject; var hitObject = palpableObject.HitObject;
@ -244,6 +245,14 @@ namespace osu.Game.Rulesets.Catch.UI
CurrentState = hitObject.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle; CurrentState = hitObject.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle;
else if (!(hitObject is Banana)) else if (!(hitObject is Banana))
CurrentState = CatcherAnimationState.Fail; CurrentState = CatcherAnimationState.Fail;
if (palpableObject.HitObject.LastInCombo)
{
if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result))
Explode();
else
Drop();
}
} }
public void OnRevertResult(DrawableCatchHitObject drawableObject, JudgementResult result) public void OnRevertResult(DrawableCatchHitObject drawableObject, JudgementResult result)

View File

@ -6,11 +6,9 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Catch.Replays;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;
using osuTK; using osuTK;
@ -72,18 +70,6 @@ namespace osu.Game.Rulesets.Catch.UI
public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result) public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result)
{ {
Catcher.OnNewResult(hitObject, result); Catcher.OnNewResult(hitObject, result);
if (!result.Type.IsScorable())
return;
if (hitObject.HitObject.LastInCombo)
{
if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result))
Catcher.Explode();
else
Catcher.Drop();
}
comboDisplay.OnNewResult(hitObject, result); comboDisplay.OnNewResult(hitObject, result);
} }

View File

@ -428,7 +428,7 @@ namespace osu.Game.Tests.Visual.Background
public float CurrentDim => dimmable.DimLevel; public float CurrentDim => dimmable.DimLevel;
public Vector2 CurrentBlur => Background.BlurSigma; public Vector2 CurrentBlur => Background?.BlurSigma ?? Vector2.Zero;
private TestDimmableBackground dimmable; private TestDimmableBackground dimmable;

View File

@ -1,7 +1,10 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.SignalR;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Screens; using osu.Framework.Screens;
@ -69,13 +72,28 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
loadingLayer.Hide(); loadingLayer.Hide();
if (t.IsCompletedSuccessfully) if (t.IsFaulted)
this.Exit();
else
{ {
Logger.Log($"Could not use current beatmap ({t.Exception?.Message})", level: LogLevel.Important); Exception exception = t.Exception;
if (exception is AggregateException ae)
exception = ae.InnerException;
Debug.Assert(exception != null);
string message = exception is HubException
// HubExceptions arrive with additional message context added, but we want to display the human readable message:
// "An unexpected error occurred invoking 'AddPlaylistItem' on the server.InvalidStateException: Can't enqueue more than 3 items at once."
// We generally use the message field for a user-parseable error (eventually to be replaced), so drop the first part for now.
? exception.Message.Substring(exception.Message.IndexOf(':') + 1).Trim()
: exception.Message;
Logger.Log(message, level: LogLevel.Important);
Carousel.AllowSelection = true; Carousel.AllowSelection = true;
return;
} }
this.Exit();
}); });
}); });
} }