mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Merge pull request #26357 from bdach/score-submission-intermittent-fail
Fix player submission test intermittent failures due to audio playback discrepancy logic kicking in
This commit is contained in:
commit
8b8f7953ec
@ -21,6 +21,7 @@ using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.Taiko;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
|
||||
@ -359,6 +360,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AllowImportCompletion = new SemaphoreSlim(1);
|
||||
}
|
||||
|
||||
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart)
|
||||
{
|
||||
ShouldValidatePlaybackRate = false,
|
||||
};
|
||||
|
||||
protected override async Task ImportScore(Score score)
|
||||
{
|
||||
ScoreImportStarted = true;
|
||||
|
@ -40,6 +40,12 @@ namespace osu.Game.Screens.Play
|
||||
Precision = 0.1,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Whether the audio playback rate should be validated.
|
||||
/// Mostly disabled for tests.
|
||||
/// </summary>
|
||||
internal bool ShouldValidatePlaybackRate { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the audio playback is within acceptable ranges.
|
||||
/// Will become false if audio playback is not going as expected.
|
||||
@ -223,6 +229,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void checkPlaybackValidity()
|
||||
{
|
||||
if (!ShouldValidatePlaybackRate)
|
||||
return;
|
||||
|
||||
if (GameplayClock.IsRunning)
|
||||
{
|
||||
elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime;
|
||||
|
Loading…
Reference in New Issue
Block a user