1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 13:47:21 +08:00

Merge branch 'master' into changelog-refactor

This commit is contained in:
Dean Herbert 2020-12-28 11:00:14 +09:00 committed by GitHub
commit 1b7c72f03b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
120 changed files with 505 additions and 367 deletions

View File

@ -20,14 +20,17 @@ using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
using osu.Game.Tests.Visual.Multiplayer;
using osu.Game.Tests.Visual.Online; using osu.Game.Tests.Visual.Online;
namespace osu.Game.Tests.Visual.Gameplay namespace osu.Game.Tests.Visual.Gameplay
{ {
public class TestSceneMultiplayerGameplayLeaderboard : OsuTestScene public class TestSceneMultiplayerGameplayLeaderboard : MultiplayerTestScene
{ {
private const int users = 16;
[Cached(typeof(SpectatorStreamingClient))] [Cached(typeof(SpectatorStreamingClient))]
private TestMultiplayerStreaming streamingClient = new TestMultiplayerStreaming(16); private TestMultiplayerStreaming streamingClient = new TestMultiplayerStreaming(users);
[Cached(typeof(UserLookupCache))] [Cached(typeof(UserLookupCache))]
private UserLookupCache lookupCache = new TestSceneCurrentlyPlayingDisplay.TestUserLookupCache(); private UserLookupCache lookupCache = new TestSceneCurrentlyPlayingDisplay.TestUserLookupCache();
@ -47,10 +50,12 @@ namespace osu.Game.Tests.Visual.Gameplay
} }
[SetUpSteps] [SetUpSteps]
public void SetUpSteps() public override void SetUpSteps()
{ {
AddStep("create leaderboard", () => AddStep("create leaderboard", () =>
{ {
leaderboard?.Expire();
OsuScoreProcessor scoreProcessor; OsuScoreProcessor scoreProcessor;
Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value); Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value);
@ -58,6 +63,9 @@ namespace osu.Game.Tests.Visual.Gameplay
streamingClient.Start(Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0); streamingClient.Start(Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
Client.PlayingUsers.Clear();
Client.PlayingUsers.AddRange(streamingClient.PlayingUsers);
Children = new Drawable[] Children = new Drawable[]
{ {
scoreProcessor = new OsuScoreProcessor(), scoreProcessor = new OsuScoreProcessor(),
@ -81,6 +89,12 @@ namespace osu.Game.Tests.Visual.Gameplay
AddRepeatStep("update state", () => streamingClient.RandomlyUpdateState(), 100); AddRepeatStep("update state", () => streamingClient.RandomlyUpdateState(), 100);
} }
[Test]
public void TestUserQuit()
{
AddRepeatStep("mark user quit", () => Client.PlayingUsers.RemoveAt(0), users);
}
public class TestMultiplayerStreaming : SpectatorStreamingClient public class TestMultiplayerStreaming : SpectatorStreamingClient
{ {
public new BindableList<int> PlayingUsers => (BindableList<int>)base.PlayingUsers; public new BindableList<int> PlayingUsers => (BindableList<int>)base.PlayingUsers;

View File

@ -6,7 +6,7 @@ using osu.Framework.Allocation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer

View File

@ -4,7 +4,7 @@
using System; using System;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {

View File

@ -18,7 +18,7 @@ using osu.Game.Overlays;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osuTK; using osuTK;
using osuTK.Input; using osuTK.Input;

View File

@ -5,7 +5,7 @@ using System;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Online.Rooms.RoomStatuses;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Catch; using osu.Game.Rulesets.Catch;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Input; using osuTK.Input;

View File

@ -9,7 +9,7 @@ using osu.Game.Online.Rooms;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osuTK; using osuTK;

View File

@ -6,7 +6,7 @@ using osu.Game.Beatmaps;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer

View File

@ -7,7 +7,7 @@ using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;

View File

@ -18,7 +18,7 @@ using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer

View File

@ -5,7 +5,7 @@ using NUnit.Framework;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
OsuScreenStack screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; OsuScreenStack screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both };
screenStack.Push(new TestMultiplayerSubScreen(index)); screenStack.Push(new TestOnlinePlaySubScreen(index));
Children = new Drawable[] Children = new Drawable[]
{ {
@ -26,16 +26,16 @@ namespace osu.Game.Tests.Visual.Multiplayer
new Header("Multiplayer", screenStack) new Header("Multiplayer", screenStack)
}; };
AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestMultiplayerSubScreen(++index))); AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestOnlinePlaySubScreen(++index)));
} }
private class TestMultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen private class TestOnlinePlaySubScreen : OsuScreen, IOnlinePlaySubScreen
{ {
private readonly int index; private readonly int index;
public string ShortTitle => $"Screen {index}"; public string ShortTitle => $"Screen {index}";
public TestMultiplayerSubScreen(int index) public TestOnlinePlaySubScreen(int index)
{ {
this.index = index; this.index = index;
} }

View File

@ -2,7 +2,7 @@
// 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 NUnit.Framework; using NUnit.Framework;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
@ -39,7 +39,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddAssert("room has 1 user", () => Client.Room?.Users.Count == 1); AddAssert("room has 1 user", () => Client.Room?.Users.Count == 1);
} }
private class TestMultiplayer : Screens.Multi.Multiplayer.Multiplayer private class TestMultiplayer : Screens.OnlinePlay.Multiplayer.Multiplayer
{ {
protected override RoomManager CreateRoomManager() => new TestMultiplayerRoomManager(); protected override RoomManager CreateRoomManager() => new TestMultiplayerRoomManager();
} }

View File

@ -7,8 +7,8 @@ using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi.Multiplayer; using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Screens.Multi.Multiplayer.Match; using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osuTK.Input; using osuTK.Input;

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Multiplayer.Participants; using osu.Game.Screens.OnlinePlay.Multiplayer.Participants;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;

View File

@ -12,7 +12,7 @@ using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Multiplayer.Match; using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
using osu.Game.Tests.Resources; using osu.Game.Tests.Resources;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;

View File

@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Online.Rooms.RoomStatuses;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {

View File

@ -107,14 +107,14 @@ namespace osu.Game.Tests.Visual.Navigation
[Test] [Test]
public void TestExitMultiWithEscape() public void TestExitMultiWithEscape()
{ {
PushAndConfirm(() => new Screens.Multi.Playlists.Playlists()); PushAndConfirm(() => new Screens.OnlinePlay.Playlists.Playlists());
exitViaEscapeAndConfirm(); exitViaEscapeAndConfirm();
} }
[Test] [Test]
public void TestExitMultiWithBackButton() public void TestExitMultiWithBackButton()
{ {
PushAndConfirm(() => new Screens.Multi.Playlists.Playlists()); PushAndConfirm(() => new Screens.OnlinePlay.Playlists.Playlists());
exitViaBackButtonAndConfirm(); exitViaBackButtonAndConfirm();
} }

View File

@ -2,7 +2,7 @@
// 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 osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Tests.Visual.Playlists namespace osu.Game.Tests.Visual.Playlists
{ {

View File

@ -8,9 +8,9 @@ using osu.Framework.Graphics;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.OnlinePlay.Lounge;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Tests.Visual.Multiplayer; using osu.Game.Tests.Visual.Multiplayer;
namespace osu.Game.Tests.Visual.Playlists namespace osu.Game.Tests.Visual.Playlists

View File

@ -10,8 +10,8 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
namespace osu.Game.Tests.Visual.Playlists namespace osu.Game.Tests.Visual.Playlists
{ {

View File

@ -3,7 +3,7 @@
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Tests.Visual.Playlists namespace osu.Game.Tests.Visual.Playlists

View File

@ -19,7 +19,7 @@ using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Ranking; using osu.Game.Screens.Ranking;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osu.Game.Users; using osu.Game.Users;

View File

@ -15,9 +15,9 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi; using osu.Game.Screens.OnlinePlay;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osu.Game.Users; using osu.Game.Users;
using osuTK.Input; using osuTK.Input;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual.Playlists
public TestScenePlaylistsScreen() public TestScenePlaylistsScreen()
{ {
var multi = new Screens.Multi.Playlists.Playlists(); var multi = new Screens.OnlinePlay.Playlists.Playlists();
AddStep("show", () => LoadScreen(multi)); AddStep("show", () => LoadScreen(multi));
AddUntilStep("wait for loaded", () => multi.IsLoaded); AddUntilStep("wait for loaded", () => multi.IsLoaded);

View File

@ -78,7 +78,7 @@ namespace osu.Game.Online.Leaderboards
statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList(); statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList();
DrawableAvatar innerAvatar; ClickableAvatar innerAvatar;
Children = new Drawable[] Children = new Drawable[]
{ {
@ -115,7 +115,7 @@ namespace osu.Game.Online.Leaderboards
Children = new[] Children = new[]
{ {
avatar = new DelayedLoadWrapper( avatar = new DelayedLoadWrapper(
innerAvatar = new DrawableAvatar(user) innerAvatar = new ClickableAvatar(user)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CornerRadius = corner_radius, CornerRadius = corner_radius,

View File

@ -4,8 +4,10 @@
#nullable enable #nullable enable
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -31,7 +33,7 @@ namespace osu.Game.Online.Multiplayer
/// <summary> /// <summary>
/// Invoked when any change occurs to the multiplayer room. /// Invoked when any change occurs to the multiplayer room.
/// </summary> /// </summary>
public event Action? RoomChanged; public event Action? RoomUpdated;
/// <summary> /// <summary>
/// Invoked when the multiplayer server requests the current beatmap to be loaded into play. /// Invoked when the multiplayer server requests the current beatmap to be loaded into play.
@ -108,8 +110,9 @@ namespace osu.Game.Online.Multiplayer
Debug.Assert(Room != null); Debug.Assert(Room != null);
foreach (var user in Room.Users) var users = getRoomUsers();
await PopulateUser(user);
await Task.WhenAll(users.Select(PopulateUser));
updateLocalRoomSettings(Room.Settings); updateLocalRoomSettings(Room.Settings);
} }
@ -122,14 +125,17 @@ namespace osu.Game.Online.Multiplayer
protected abstract Task<MultiplayerRoom> JoinRoom(long roomId); protected abstract Task<MultiplayerRoom> JoinRoom(long roomId);
public virtual Task LeaveRoom() public virtual Task LeaveRoom()
{
Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return Task.CompletedTask; return;
apiRoom = null; apiRoom = null;
Room = null; Room = null;
Schedule(() => RoomChanged?.Invoke()); RoomUpdated?.Invoke();
}, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -184,7 +190,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -208,8 +214,8 @@ namespace osu.Game.Online.Multiplayer
break; break;
} }
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -221,7 +227,7 @@ namespace osu.Game.Online.Multiplayer
await PopulateUser(user); await PopulateUser(user);
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -232,8 +238,8 @@ namespace osu.Game.Online.Multiplayer
Room.Users.Add(user); Room.Users.Add(user);
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
}); }, false);
} }
Task IMultiplayerClient.UserLeft(MultiplayerRoomUser user) Task IMultiplayerClient.UserLeft(MultiplayerRoomUser user)
@ -241,7 +247,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -249,8 +255,8 @@ namespace osu.Game.Online.Multiplayer
Room.Users.Remove(user); Room.Users.Remove(user);
PlayingUsers.Remove(user.UserID); PlayingUsers.Remove(user.UserID);
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -260,7 +266,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -272,8 +278,8 @@ namespace osu.Game.Online.Multiplayer
Room.Host = user; Room.Host = user;
apiRoom.Host.Value = user?.User; apiRoom.Host.Value = user?.User;
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -289,7 +295,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -299,8 +305,8 @@ namespace osu.Game.Online.Multiplayer
if (state != MultiplayerUserState.Playing) if (state != MultiplayerUserState.Playing)
PlayingUsers.Remove(userId); PlayingUsers.Remove(userId);
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -310,13 +316,13 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
LoadRequested?.Invoke(); LoadRequested?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -326,7 +332,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -334,7 +340,7 @@ namespace osu.Game.Online.Multiplayer
PlayingUsers.AddRange(Room.Users.Where(u => u.State == MultiplayerUserState.Playing).Select(u => u.UserID)); PlayingUsers.AddRange(Room.Users.Where(u => u.State == MultiplayerUserState.Playing).Select(u => u.UserID));
MatchStarted?.Invoke(); MatchStarted?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -344,13 +350,13 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return Task.CompletedTask; return Task.CompletedTask;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
ResultsReady?.Invoke(); ResultsReady?.Invoke();
}); }, false);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -361,6 +367,31 @@ namespace osu.Game.Online.Multiplayer
/// <param name="multiplayerUser">The <see cref="MultiplayerRoomUser"/> to populate.</param> /// <param name="multiplayerUser">The <see cref="MultiplayerRoomUser"/> to populate.</param>
protected async Task PopulateUser(MultiplayerRoomUser multiplayerUser) => multiplayerUser.User ??= await userLookupCache.GetUserAsync(multiplayerUser.UserID); protected async Task PopulateUser(MultiplayerRoomUser multiplayerUser) => multiplayerUser.User ??= await userLookupCache.GetUserAsync(multiplayerUser.UserID);
/// <summary>
/// Retrieve a copy of users currently in the joined <see cref="Room"/> in a thread-safe manner.
/// This should be used whenever accessing users from outside of an Update thread context (ie. when not calling <see cref="Drawable.Schedule"/>).
/// </summary>
/// <returns>A copy of users in the current room, or null if unavailable.</returns>
private List<MultiplayerRoomUser>? getRoomUsers()
{
List<MultiplayerRoomUser>? users = null;
ManualResetEventSlim resetEvent = new ManualResetEventSlim();
// at some point we probably want to replace all these schedule calls with Room.LockForUpdate.
// for now, as this would require quite some consideration due to the number of accesses to the room instance,
// let's just add a manual schedule for the non-scheduled usages instead.
Scheduler.Add(() =>
{
users = Room?.Users.ToList();
resetEvent.Set();
}, false);
resetEvent.Wait(100);
return users;
}
/// <summary> /// <summary>
/// Updates the local room settings with the given <see cref="MultiplayerRoomSettings"/>. /// Updates the local room settings with the given <see cref="MultiplayerRoomSettings"/>.
/// </summary> /// </summary>
@ -373,7 +404,7 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return; return;
Schedule(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
@ -388,13 +419,13 @@ namespace osu.Game.Online.Multiplayer
// In-order for the client to not display an outdated beatmap, the playlist is forcefully cleared here. // In-order for the client to not display an outdated beatmap, the playlist is forcefully cleared here.
apiRoom.Playlist.Clear(); apiRoom.Playlist.Clear();
RoomChanged?.Invoke(); RoomUpdated?.Invoke();
var req = new GetBeatmapSetRequest(settings.BeatmapID, BeatmapSetLookupType.BeatmapId); var req = new GetBeatmapSetRequest(settings.BeatmapID, BeatmapSetLookupType.BeatmapId);
req.Success += res => updatePlaylist(settings, res); req.Success += res => updatePlaylist(settings, res);
api.Queue(req); api.Queue(req);
}); }, false);
} }
private void updatePlaylist(MultiplayerRoomSettings settings, APIBeatmapSet onlineSet) private void updatePlaylist(MultiplayerRoomSettings settings, APIBeatmapSet onlineSet)

View File

@ -5,7 +5,7 @@ using System.Collections.Generic;
using Humanizer; using Humanizer;
using osu.Framework.IO.Network; using osu.Framework.IO.Network;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Online.Rooms namespace osu.Game.Online.Rooms
{ {

View File

@ -131,6 +131,9 @@ namespace osu.Game.Online.Rooms
RoomID.Value = other.RoomID.Value; RoomID.Value = other.RoomID.Value;
Name.Value = other.Name.Value; Name.Value = other.Name.Value;
if (other.Category.Value != RoomCategory.Spotlight)
Category.Value = other.Category.Value;
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id) if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
Host.Value = other.Host.Value; Host.Value = other.Host.Value;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Chat.Tabs
if (value.Type != ChannelType.PM) if (value.Type != ChannelType.PM)
throw new ArgumentException("Argument value needs to have the targettype user!"); throw new ArgumentException("Argument value needs to have the targettype user!");
DrawableAvatar avatar; ClickableAvatar avatar;
AddRange(new Drawable[] AddRange(new Drawable[]
{ {
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Chat.Tabs
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Masking = true, Masking = true,
Child = new DelayedLoadWrapper(avatar = new DrawableAvatar(value.Users.First()) Child = new DelayedLoadWrapper(avatar = new ClickableAvatar(value.Users.First())
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
OpenOnClick = { Value = false }, OpenOnClick = { Value = false },

View File

@ -11,7 +11,7 @@ using osu.Framework.Screens;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.Spectator; using osu.Game.Online.Spectator;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;

View File

@ -17,8 +17,8 @@ using osu.Game.Online.API;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
using osu.Game.Screens.Multi.Multiplayer; using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Screens.Menu namespace osu.Game.Screens.Menu

View File

@ -3,7 +3,7 @@
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class BeatmapDetailAreaPlaylistTabItem : BeatmapDetailAreaTabItem public class BeatmapDetailAreaPlaylistTabItem : BeatmapDetailAreaTabItem
{ {

View File

@ -10,9 +10,9 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class BeatmapTitle : MultiplayerComposite public class BeatmapTitle : OnlinePlayComposite
{ {
private readonly LinkFlowContainer textFlow; private readonly LinkFlowContainer textFlow;

View File

@ -9,9 +9,9 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class BeatmapTypeInfo : MultiplayerComposite public class BeatmapTypeInfo : OnlinePlayComposite
{ {
private LinkFlowContainer beatmapAuthor; private LinkFlowContainer beatmapAuthor;

View File

@ -5,7 +5,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public abstract class DisableableTabControl<T> : TabControl<T> public abstract class DisableableTabControl<T> : TabControl<T>
{ {

View File

@ -10,7 +10,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class DrawableGameType : CircularContainer, IHasTooltip public class DrawableGameType : CircularContainer, IHasTooltip
{ {

View File

@ -5,9 +5,9 @@ using System.Threading.Tasks;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
/// <summary> /// <summary>
/// A <see cref="RoomPollingComponent"/> that polls for the lounge listing. /// A <see cref="RoomPollingComponent"/> that polls for the lounge listing.

View File

@ -12,7 +12,7 @@ using osu.Game.Online.Rooms;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class MatchBeatmapDetailArea : BeatmapDetailArea public class MatchBeatmapDetailArea : BeatmapDetailArea
{ {

View File

@ -8,9 +8,9 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps.Drawables; using osu.Game.Beatmaps.Drawables;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class ModeTypeInfo : MultiplayerComposite public class ModeTypeInfo : OnlinePlayComposite
{ {
private const float height = 30; private const float height = 30;
private const float transition_duration = 100; private const float transition_duration = 100;

View File

@ -6,14 +6,14 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps.Drawables; using osu.Game.Beatmaps.Drawables;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class MultiplayerBackgroundSprite : MultiplayerComposite public class OnlinePlayBackgroundSprite : OnlinePlayComposite
{ {
private readonly BeatmapSetCoverType beatmapSetCoverType; private readonly BeatmapSetCoverType beatmapSetCoverType;
private UpdateableBeatmapBackgroundSprite sprite; private UpdateableBeatmapBackgroundSprite sprite;
public MultiplayerBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover) public OnlinePlayBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
{ {
this.beatmapSetCoverType = beatmapSetCoverType; this.beatmapSetCoverType = beatmapSetCoverType;
} }

View File

@ -10,12 +10,12 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
/// <summary> /// <summary>
/// A header used in the multiplayer interface which shows text / details beneath a line. /// A header used in the multiplayer interface which shows text / details beneath a line.
/// </summary> /// </summary>
public class OverlinedHeader : MultiplayerComposite public class OverlinedHeader : OnlinePlayComposite
{ {
private bool showLine = true; private bool showLine = true;

View File

@ -3,7 +3,7 @@
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class OverlinedPlaylistHeader : OverlinedHeader public class OverlinedPlaylistHeader : OverlinedHeader
{ {

View File

@ -7,9 +7,9 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class ParticipantCountDisplay : MultiplayerComposite public class ParticipantCountDisplay : OnlinePlayComposite
{ {
private const float text_size = 30; private const float text_size = 30;
private const float transition_duration = 100; private const float transition_duration = 100;

View File

@ -6,9 +6,9 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class ParticipantsDisplay : MultiplayerComposite public class ParticipantsDisplay : OnlinePlayComposite
{ {
public Bindable<string> Details = new Bindable<string>(); public Bindable<string> Details = new Bindable<string>();

View File

@ -12,9 +12,9 @@ using osu.Game.Users;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class ParticipantsList : MultiplayerComposite public class ParticipantsList : OnlinePlayComposite
{ {
public const float TILE_SIZE = 35; public const float TILE_SIZE = 35;

View File

@ -11,7 +11,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public abstract class ReadyButton : TriangleButton public abstract class ReadyButton : TriangleButton
{ {

View File

@ -15,7 +15,7 @@ using osu.Game.Online.API;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Rulesets; using osu.Game.Rulesets;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public abstract class RoomManager : CompositeDrawable, IRoomManager public abstract class RoomManager : CompositeDrawable, IRoomManager
{ {

View File

@ -8,7 +8,7 @@ using osu.Game.Online;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public abstract class RoomPollingComponent : PollingComponent public abstract class RoomPollingComponent : PollingComponent
{ {

View File

@ -11,9 +11,9 @@ using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Online.Rooms.RoomStatuses;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class RoomStatusInfo : MultiplayerComposite public class RoomStatusInfo : OnlinePlayComposite
{ {
public RoomStatusInfo() public RoomStatusInfo()
{ {

View File

@ -7,7 +7,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
/// <summary> /// <summary>
/// A <see cref="RoomPollingComponent"/> that polls for the currently-selected room. /// A <see cref="RoomPollingComponent"/> that polls for the currently-selected room.

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Components namespace osu.Game.Screens.OnlinePlay.Components
{ {
public class StatusColouredContainer : Container public class StatusColouredContainer : Container
{ {

View File

@ -10,7 +10,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class DrawableRoomPlaylist : OsuRearrangeableListContainer<PlaylistItem> public class DrawableRoomPlaylist : OsuRearrangeableListContainer<PlaylistItem>
{ {

View File

@ -29,7 +29,7 @@ using osu.Game.Screens.Play.HUD;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class DrawableRoomPlaylistItem : OsuRearrangeableListItem<PlaylistItem> public class DrawableRoomPlaylistItem : OsuRearrangeableListItem<PlaylistItem>
{ {

View File

@ -13,7 +13,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class DrawableRoomPlaylistWithResults : DrawableRoomPlaylist public class DrawableRoomPlaylistWithResults : DrawableRoomPlaylist
{ {

View File

@ -10,13 +10,13 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays; using osu.Game.Overlays;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class Header : Container public class Header : Container
{ {
@ -61,8 +61,8 @@ namespace osu.Game.Screens.Multi
breadcrumbs.Current.ValueChanged += screen => breadcrumbs.Current.ValueChanged += screen =>
{ {
if (screen.NewValue is IMultiplayerSubScreen multiScreen) if (screen.NewValue is IOnlinePlaySubScreen onlineSubScreen)
title.Screen = multiScreen; title.Screen = onlineSubScreen;
}; };
breadcrumbs.Current.TriggerChange(); breadcrumbs.Current.TriggerChange();
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Multi
private readonly OsuSpriteText dot; private readonly OsuSpriteText dot;
private readonly OsuSpriteText pageTitle; private readonly OsuSpriteText pageTitle;
public IMultiplayerSubScreen Screen public IOnlinePlaySubScreen Screen
{ {
set => pageTitle.Text = value.ShortTitle.Titleize(); set => pageTitle.Text = value.ShortTitle.Titleize();
} }

View File

@ -1,9 +1,9 @@
// 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.
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public interface IMultiplayerSubScreen : IOsuScreen public interface IOnlinePlaySubScreen : IOsuScreen
{ {
string Title { get; } string Title { get; }

View File

@ -6,7 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
[Cached(typeof(IRoomManager))] [Cached(typeof(IRoomManager))]
public interface IRoomManager public interface IRoomManager

View File

@ -9,22 +9,22 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables; using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Multi.Components; using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Components;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class DrawableRoom : OsuClickableContainer, IStateful<SelectionState>, IFilterable, IHasContextMenu public class DrawableRoom : OsuClickableContainer, IStateful<SelectionState>, IFilterable, IHasContextMenu
{ {
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
private CachedModelDependencyContainer<Room> dependencies; private CachedModelDependencyContainer<Room> dependencies;
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private MultiplayerScreen multiplayer { get; set; } private OnlinePlayScreen parentScreen { get; set; }
[Resolved] [Resolved]
private BeatmapManager beatmaps { get; set; } private BeatmapManager beatmaps { get; set; }
@ -155,7 +155,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Width = cover_width, Width = cover_width,
Masking = true, Masking = true,
Margin = new MarginPadding { Left = stripWidth }, Margin = new MarginPadding { Left = stripWidth },
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both } Child = new OnlinePlayBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
}, },
new Container new Container
{ {
@ -242,7 +242,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
{ {
new OsuMenuItem("Create copy", MenuItemType.Standard, () => new OsuMenuItem("Create copy", MenuItemType.Standard, () =>
{ {
multiplayer?.OpenNewRoom(Room.CreateCopy()); parentScreen?.OpenNewRoom(Room.CreateCopy());
}) })
}; };
} }

View File

@ -12,7 +12,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public abstract class FilterControl : CompositeDrawable public abstract class FilterControl : CompositeDrawable
{ {

View File

@ -3,7 +3,7 @@
using osu.Game.Rulesets; using osu.Game.Rulesets;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class FilterCriteria public class FilterCriteria
{ {

View File

@ -11,9 +11,9 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class ParticipantInfo : MultiplayerComposite public class ParticipantInfo : OnlinePlayComposite
{ {
public ParticipantInfo() public ParticipantInfo()
{ {

View File

@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class PlaylistsFilterControl : FilterControl public class PlaylistsFilterControl : FilterControl
{ {

View File

@ -6,12 +6,12 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class RoomInfo : MultiplayerComposite public class RoomInfo : OnlinePlayComposite
{ {
private readonly List<Drawable> statusElements = new List<Drawable>(); private readonly List<Drawable> statusElements = new List<Drawable>();
private readonly OsuTextFlowContainer roomName; private readonly OsuTextFlowContainer roomName;

View File

@ -7,12 +7,12 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class RoomInspector : MultiplayerComposite public class RoomInspector : OnlinePlayComposite
{ {
private const float transition_duration = 100; private const float transition_duration = 100;

View File

@ -3,7 +3,7 @@
using System.ComponentModel; using System.ComponentModel;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public enum RoomStatusFilter public enum RoomStatusFilter
{ {

View File

@ -13,13 +13,13 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osuTK;
using osu.Game.Graphics.Cursor;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osuTK;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
public class RoomsContainer : CompositeDrawable, IKeyBindingHandler<GlobalAction> public class RoomsContainer : CompositeDrawable, IKeyBindingHandler<GlobalAction>
{ {

View File

@ -12,14 +12,14 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Screens.Multi.Lounge namespace osu.Game.Screens.OnlinePlay.Lounge
{ {
[Cached] [Cached]
public abstract class LoungeSubScreen : MultiplayerSubScreen public abstract class LoungeSubScreen : OnlinePlaySubScreen
{ {
public override string Title => "Lounge"; public override string Title => "Lounge";

View File

@ -10,10 +10,10 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class Footer : CompositeDrawable public class Footer : CompositeDrawable
{ {

View File

@ -10,10 +10,10 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Online.Rooms.GameTypes; using osu.Game.Online.Rooms.GameTypes;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class GameTypePicker : DisableableTabControl<GameType> public class GameTypePicker : DisableableTabControl<GameType>
{ {

View File

@ -10,9 +10,9 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class Header : MultiplayerComposite public class Header : OnlinePlayComposite
{ {
public const float HEIGHT = 50; public const float HEIGHT = 50;

View File

@ -6,7 +6,7 @@ using osu.Framework.Bindables;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class MatchChatDisplay : StandAloneChatDisplay public class MatchChatDisplay : StandAloneChatDisplay
{ {

View File

@ -10,7 +10,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate> public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
{ {

View File

@ -8,7 +8,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class MatchLeaderboardScore : LeaderboardScore public class MatchLeaderboardScore : LeaderboardScore
{ {

View File

@ -10,14 +10,14 @@ using osu.Game.Graphics.UserInterface;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public abstract class MatchSettingsOverlay : FocusedOverlayContainer public abstract class MatchSettingsOverlay : FocusedOverlayContainer
{ {
protected const float TRANSITION_DURATION = 350; protected const float TRANSITION_DURATION = 350;
protected const float FIELD_PADDING = 45; protected const float FIELD_PADDING = 45;
protected MultiplayerComposite Settings { get; set; } protected OnlinePlayComposite Settings { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -5,7 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class PurpleTriangleButton : TriangleButton public class PurpleTriangleButton : TriangleButton
{ {

View File

@ -11,11 +11,11 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
{ {
public class RoomAvailabilityPicker : DisableableTabControl<RoomAvailability> public class RoomAvailabilityPicker : DisableableTabControl<RoomAvailability>
{ {

View File

@ -15,10 +15,10 @@ using osu.Game.Overlays;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
namespace osu.Game.Screens.Multi.Match namespace osu.Game.Screens.OnlinePlay.Match
{ {
[Cached(typeof(IPreviewTrackOwner))] [Cached(typeof(IPreviewTrackOwner))]
public abstract class RoomSubScreen : MultiplayerSubScreen, IPreviewTrackOwner public abstract class RoomSubScreen : OnlinePlaySubScreen, IPreviewTrackOwner
{ {
protected readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>(); protected readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>();
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Match
private BeatmapManager beatmapManager { get; set; } private BeatmapManager beatmapManager { get; set; }
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
protected MultiplayerScreen Multiplayer { get; private set; } protected OnlinePlayScreen ParentScreen { get; private set; }
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated; private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;
@ -88,7 +88,7 @@ namespace osu.Game.Screens.Multi.Match
protected void StartPlay(Func<Player> player) protected void StartPlay(Func<Player> player)
{ {
sampleStart?.Play(); sampleStart?.Play();
Multiplayer?.Push(new PlayerLoader(player)); ParentScreen?.Push(new PlayerLoader(player));
} }
private void selectedItemChanged() private void selectedItemChanged()

View File

@ -4,9 +4,9 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class CreateMultiplayerMatchButton : PurpleTriangleButton public class CreateMultiplayerMatchButton : PurpleTriangleButton
{ {

View File

@ -9,11 +9,11 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
namespace osu.Game.Screens.Multi.Multiplayer.Match namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class BeatmapSelectionControl : MultiplayerComposite public class BeatmapSelectionControl : OnlinePlayComposite
{ {
[Resolved] [Resolved]
private MultiplayerMatchSubScreen matchSubScreen { get; set; } private MultiplayerMatchSubScreen matchSubScreen { get; set; }

View File

@ -11,7 +11,7 @@ using osu.Game.Graphics;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer.Match namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerMatchFooter : CompositeDrawable public class MultiplayerMatchFooter : CompositeDrawable
{ {

View File

@ -10,16 +10,16 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using FontWeight = osu.Game.Graphics.FontWeight; using FontWeight = osu.Game.Graphics.FontWeight;
using OsuColour = osu.Game.Graphics.OsuColour; using OsuColour = osu.Game.Graphics.OsuColour;
using OsuFont = osu.Game.Graphics.OsuFont; using OsuFont = osu.Game.Graphics.OsuFont;
namespace osu.Game.Screens.Multi.Multiplayer.Match namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerMatchHeader : MultiplayerComposite public class MultiplayerMatchHeader : OnlinePlayComposite
{ {
public const float HEIGHT = 50; public const float HEIGHT = 50;

View File

@ -18,10 +18,10 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer.Match namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerMatchSettingsOverlay : MatchSettingsOverlay public class MultiplayerMatchSettingsOverlay : MatchSettingsOverlay
{ {
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Multiplayer.Match
}; };
} }
protected class MatchSettings : MultiplayerComposite protected class MatchSettings : OnlinePlayComposite
{ {
private const float disabled_alpha = 0.2f; private const float disabled_alpha = 0.2f;

View File

@ -15,10 +15,10 @@ using osu.Game.Graphics.Backgrounds;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer.Match namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerReadyButton : MultiplayerRoomComposite public class MultiplayerReadyButton : MultiplayerRoomComposite
{ {
@ -56,11 +56,13 @@ namespace osu.Game.Screens.Multi.Multiplayer.Match
sampleReadyCount = audio.Samples.Get(@"SongSelect/select-difficulty"); sampleReadyCount = audio.Samples.Get(@"SongSelect/select-difficulty");
} }
protected override void OnRoomChanged() protected override void OnRoomUpdated()
{ {
base.OnRoomChanged(); base.OnRoomUpdated();
// this method is called on leaving the room, so the local user may not exist in the room any more.
localUser = Room?.Users.SingleOrDefault(u => u.User?.Id == api.LocalUser.Value.Id);
localUser = Room?.Users.Single(u => u.User?.Id == api.LocalUser.Value.Id);
button.Enabled.Value = Client.Room?.State == MultiplayerRoomState.Open; button.Enabled.Value = Client.Room?.State == MultiplayerRoomState.Open;
updateState(); updateState();
} }

View File

@ -8,12 +8,12 @@ using osu.Game.Extensions;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.OnlinePlay.Lounge;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class Multiplayer : MultiplayerScreen public class Multiplayer : OnlinePlayScreen
{ {
[Resolved] [Resolved]
private StatefulMultiplayerClient client { get; set; } private StatefulMultiplayerClient client { get; set; }

View File

@ -1,9 +1,9 @@
// 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 osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class MultiplayerFilterControl : FilterControl public class MultiplayerFilterControl : FilterControl
{ {

View File

@ -5,11 +5,11 @@ using osu.Framework.Allocation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.OnlinePlay.Lounge;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.OnlinePlay.Match;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class MultiplayerLoungeSubScreen : LoungeSubScreen public class MultiplayerLoungeSubScreen : LoungeSubScreen
{ {

View File

@ -13,9 +13,9 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class MultiplayerMatchSongSelect : SongSelect, IMultiplayerSubScreen public class MultiplayerMatchSongSelect : SongSelect, IOnlinePlaySubScreen
{ {
public string ShortTitle => "song selection"; public string ShortTitle => "song selection";

View File

@ -11,15 +11,15 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Multi.Multiplayer.Match; using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
using osu.Game.Screens.Multi.Multiplayer.Participants; using osu.Game.Screens.OnlinePlay.Multiplayer.Participants;
using osu.Game.Users; using osu.Game.Users;
using ParticipantsList = osu.Game.Screens.Multi.Multiplayer.Participants.ParticipantsList; using ParticipantsList = osu.Game.Screens.OnlinePlay.Multiplayer.Participants.ParticipantsList;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
[Cached] [Cached]
public class MultiplayerMatchSubScreen : RoomSubScreen public class MultiplayerMatchSubScreen : RoomSubScreen

View File

@ -11,13 +11,13 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
using osu.Game.Screens.Ranking; using osu.Game.Screens.Ranking;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
// Todo: The "room" part of PlaylistsPlayer should be split out into an abstract player class to be inherited instead. // Todo: The "room" part of PlaylistsPlayer should be split out into an abstract player class to be inherited instead.
public class MultiplayerPlayer : PlaylistsPlayer public class MultiplayerPlayer : PlaylistsPlayer

View File

@ -3,9 +3,9 @@
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Multi.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class MultiplayerResultsScreen : PlaylistsResultsScreen public class MultiplayerResultsScreen : PlaylistsResultsScreen
{ {

View File

@ -5,9 +5,9 @@ using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public abstract class MultiplayerRoomComposite : MultiplayerComposite public abstract class MultiplayerRoomComposite : OnlinePlayComposite
{ {
[CanBeNull] [CanBeNull]
protected MultiplayerRoom Room => Client.Room; protected MultiplayerRoom Room => Client.Room;
@ -19,18 +19,21 @@ namespace osu.Game.Screens.Multi.Multiplayer
{ {
base.LoadComplete(); base.LoadComplete();
Client.RoomChanged += OnRoomChanged; Client.RoomUpdated += OnRoomUpdated;
OnRoomChanged(); OnRoomUpdated();
} }
protected virtual void OnRoomChanged() /// <summary>
/// Invoked when any change occurs to the multiplayer room.
/// </summary>
protected virtual void OnRoomUpdated()
{ {
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
if (Client != null) if (Client != null)
Client.RoomChanged -= OnRoomChanged; Client.RoomUpdated -= OnRoomUpdated;
base.Dispose(isDisposing); base.Dispose(isDisposing);
} }

View File

@ -13,9 +13,9 @@ using osu.Game.Extensions;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Online.Rooms.RoomStatuses;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
namespace osu.Game.Screens.Multi.Multiplayer namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
public class MultiplayerRoomManager : RoomManager public class MultiplayerRoomManager : RoomManager
{ {

View File

@ -22,7 +22,7 @@ using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Multiplayer.Participants namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{ {
public class ParticipantPanel : MultiplayerRoomComposite, IHasContextMenu public class ParticipantPanel : MultiplayerRoomComposite, IHasContextMenu
{ {
@ -135,9 +135,9 @@ namespace osu.Game.Screens.Multi.Multiplayer.Participants
}; };
} }
protected override void OnRoomChanged() protected override void OnRoomUpdated()
{ {
base.OnRoomChanged(); base.OnRoomUpdated();
if (Room == null) if (Room == null)
return; return;

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor; using osu.Game.Graphics.Cursor;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer.Participants namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{ {
public class ParticipantsList : MultiplayerRoomComposite public class ParticipantsList : MultiplayerRoomComposite
{ {
@ -36,9 +36,9 @@ namespace osu.Game.Screens.Multi.Multiplayer.Participants
}; };
} }
protected override void OnRoomChanged() protected override void OnRoomUpdated()
{ {
base.OnRoomChanged(); base.OnRoomUpdated();
if (Room == null) if (Room == null)
panels.Clear(); panels.Clear();

View File

@ -3,9 +3,9 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
namespace osu.Game.Screens.Multi.Multiplayer.Participants namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{ {
public class ParticipantsListHeader : OverlinedHeader public class ParticipantsListHeader : OverlinedHeader
{ {

View File

@ -11,7 +11,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Multiplayer.Participants namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{ {
public class StateDisplay : CompositeDrawable public class StateDisplay : CompositeDrawable
{ {

View File

@ -8,9 +8,9 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class MultiplayerComposite : CompositeDrawable public class OnlinePlayComposite : CompositeDrawable
{ {
[Resolved(typeof(Room))] [Resolved(typeof(Room))]
protected Bindable<int?> RoomID { get; private set; } protected Bindable<int?> RoomID { get; private set; }

View File

@ -17,19 +17,19 @@ using osu.Game.Online.API;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.OnlinePlay.Lounge;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
[Cached] [Cached]
public abstract class MultiplayerScreen : OsuScreen public abstract class OnlinePlayScreen : OsuScreen
{ {
public override bool CursorVisible => (screenStack.CurrentScreen as IMultiplayerSubScreen)?.CursorVisible ?? true; public override bool CursorVisible => (screenStack.CurrentScreen as IOnlinePlaySubScreen)?.CursorVisible ?? true;
// this is required due to PlayerLoader eventually being pushed to the main stack // this is required due to PlayerLoader eventually being pushed to the main stack
// while leases may be taken out by a subscreen. // while leases may be taken out by a subscreen.
@ -67,7 +67,7 @@ namespace osu.Game.Screens.Multi
private readonly Drawable header; private readonly Drawable header;
private readonly Drawable headerBackground; private readonly Drawable headerBackground;
protected MultiplayerScreen() protected OnlinePlayScreen()
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
@ -124,7 +124,7 @@ namespace osu.Game.Screens.Multi
} }
} }
}, },
screenStack = new MultiplayerSubScreenStack { RelativeSizeAxes = Axes.Both } screenStack = new OnlinePlaySubScreenStack { RelativeSizeAxes = Axes.Both }
} }
}, },
new Header(ScreenTitle, screenStack), new Header(ScreenTitle, screenStack),
@ -245,7 +245,7 @@ namespace osu.Game.Screens.Multi
public override bool OnBackButton() public override bool OnBackButton()
{ {
if ((screenStack.CurrentScreen as IMultiplayerSubScreen)?.OnBackButton() == true) if ((screenStack.CurrentScreen as IOnlinePlaySubScreen)?.OnBackButton() == true)
return true; return true;
if (screenStack.CurrentScreen != null && !(screenStack.CurrentScreen is LoungeSubScreen)) if (screenStack.CurrentScreen != null && !(screenStack.CurrentScreen is LoungeSubScreen))
@ -295,13 +295,13 @@ namespace osu.Game.Screens.Multi
switch (newScreen) switch (newScreen)
{ {
case LoungeSubScreen _: case LoungeSubScreen _:
header.Delay(MultiplayerSubScreen.RESUME_TRANSITION_DELAY).ResizeHeightTo(400, MultiplayerSubScreen.APPEAR_DURATION, Easing.OutQuint); header.Delay(OnlinePlaySubScreen.RESUME_TRANSITION_DELAY).ResizeHeightTo(400, OnlinePlaySubScreen.APPEAR_DURATION, Easing.OutQuint);
headerBackground.MoveToX(0, MultiplayerSubScreen.X_MOVE_DURATION, Easing.OutQuint); headerBackground.MoveToX(0, OnlinePlaySubScreen.X_MOVE_DURATION, Easing.OutQuint);
break; break;
case RoomSubScreen _: case RoomSubScreen _:
header.ResizeHeightTo(135, MultiplayerSubScreen.APPEAR_DURATION, Easing.OutQuint); header.ResizeHeightTo(135, OnlinePlaySubScreen.APPEAR_DURATION, Easing.OutQuint);
headerBackground.MoveToX(-MultiplayerSubScreen.X_SHIFT, MultiplayerSubScreen.X_MOVE_DURATION, Easing.OutQuint); headerBackground.MoveToX(-OnlinePlaySubScreen.X_SHIFT, OnlinePlaySubScreen.X_MOVE_DURATION, Easing.OutQuint);
break; break;
} }
@ -338,7 +338,7 @@ namespace osu.Game.Screens.Multi
} }
} }
private class HeaderBackgroundSprite : MultiplayerBackgroundSprite private class HeaderBackgroundSprite : OnlinePlayBackgroundSprite
{ {
protected override UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new BackgroundSprite { RelativeSizeAxes = Axes.Both }; protected override UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new BackgroundSprite { RelativeSizeAxes = Axes.Both };

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Screens; using osu.Framework.Screens;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen public abstract class OnlinePlaySubScreen : OsuScreen, IOnlinePlaySubScreen
{ {
public override bool DisallowExternalBeatmapRulesetChanges => false; public override bool DisallowExternalBeatmapRulesetChanges => false;
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
protected IRoomManager RoomManager { get; private set; } protected IRoomManager RoomManager { get; private set; }
protected MultiplayerSubScreen() protected OnlinePlaySubScreen()
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;

View File

@ -3,9 +3,9 @@
using osu.Framework.Screens; using osu.Framework.Screens;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.OnlinePlay
{ {
public class MultiplayerSubScreenStack : OsuScreenStack public class OnlinePlaySubScreenStack : OsuScreenStack
{ {
protected override void ScreenChanged(IScreen prev, IScreen next) protected override void ScreenChanged(IScreen prev, IScreen next)
{ {

Some files were not shown because too many files have changed in this diff Show More