1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:03:11 +08:00

Merge branch 'master' into mvp-safe-area-support

This commit is contained in:
Dean Herbert 2022-02-04 20:05:35 +09:00 committed by GitHub
commit 98f61415c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 4 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.128.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.204.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -871,6 +871,53 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddUntilStep("queue is empty", () => this.ChildrenOfType<MultiplayerQueueList>().Single().Items.Count == 0);
}
[Test]
public void TestGameplayStartsWhileInSpectatorScreen()
{
createRoom(() => new Room
{
Name = { Value = "Test Room" },
Playlist =
{
new PlaylistItem
{
Beatmap = { Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo },
Ruleset = { Value = new OsuRuleset().RulesetInfo },
}
}
});
AddStep("join other user and make host", () =>
{
client.AddUser(new APIUser { Id = 1234 });
client.TransferHost(1234);
});
AddStep("set local user spectating", () => client.ChangeUserState(API.LocalUser.Value.OnlineID, MultiplayerUserState.Spectating));
AddUntilStep("wait for spectating state", () => client.LocalUser?.State == MultiplayerUserState.Spectating);
runGameplay();
AddStep("exit gameplay for other user", () => client.ChangeUserState(1234, MultiplayerUserState.Idle));
AddUntilStep("wait for room to be idle", () => client.Room?.State == MultiplayerRoomState.Open);
runGameplay();
void runGameplay()
{
AddStep("start match by other user", () =>
{
client.ChangeUserState(1234, MultiplayerUserState.Ready);
client.StartMatch();
});
AddUntilStep("wait for loading", () => client.Room?.State == MultiplayerRoomState.WaitingForLoad);
AddStep("set player loaded", () => client.ChangeUserState(1234, MultiplayerUserState.Loaded));
AddUntilStep("wait for gameplay to start", () => client.Room?.State == MultiplayerRoomState.Playing);
AddUntilStep("wait for local user to enter spectator", () => multiplayerComponents.CurrentScreen is MultiSpectatorScreen);
}
}
private void enterGameplay()
{
pressReadyButton();

View File

@ -457,6 +457,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
return;
}
// The beatmap is queried asynchronously when the selected item changes.
// This is an issue with MultiSpectatorScreen which is effectively in an always "ready" state and receives LoadRequested() callbacks
// even when it is not truly ready (i.e. the beatmap hasn't been selected by the client yet). For the time being, a simple fix to this is to ignore the callback.
// Note that spectator will be entered automatically when the client is capable of doing so via beatmap availability callbacks (see: updateBeatmapAvailability()).
if (client.LocalUser?.State == MultiplayerUserState.Spectating && (SelectedItem.Value == null || Beatmap.IsDefault))
return;
StartPlay();
readyClickOperation?.Dispose();

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.8.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.128.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.204.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" />
<PackageReference Include="Sentry" Version="3.13.0" />
<PackageReference Include="SharpCompress" Version="0.30.1" />

View File

@ -60,7 +60,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.128.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.204.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
@ -83,7 +83,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.128.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.204.0" />
<PackageReference Include="SharpCompress" Version="0.30.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />