1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 18:37:51 +08:00

Revert previous logic of join guarding

This commit is contained in:
Salman Ahmed 2020-12-23 05:49:18 +03:00
parent a64ffcd294
commit 7751ef4f3e
7 changed files with 1 additions and 20 deletions

View File

@ -24,8 +24,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => Rooms.Add(room); public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => Rooms.Add(room);
public bool CanJoinRoom(Room room) => true;
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
{ {
} }

View File

@ -146,8 +146,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
onSuccess?.Invoke(room); onSuccess?.Invoke(room);
} }
public bool CanJoinRoom(Room room) => true;
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => throw new NotImplementedException(); public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => throw new NotImplementedException();
public void PartRoom() => throw new NotImplementedException(); public void PartRoom() => throw new NotImplementedException();

View File

@ -161,8 +161,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
onSuccess?.Invoke(room); onSuccess?.Invoke(room);
} }
public bool CanJoinRoom(Room room) => true;
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => onSuccess?.Invoke(room); public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => onSuccess?.Invoke(room);
public void PartRoom() public void PartRoom()

View File

@ -82,8 +82,6 @@ namespace osu.Game.Screens.Multi.Components
api.Queue(req); api.Queue(req);
} }
public virtual bool CanJoinRoom(Room room) => true;
private JoinRoomRequest currentJoinRoomRequest; private JoinRoomRequest currentJoinRoomRequest;
public virtual void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) public virtual void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)

View File

@ -34,12 +34,6 @@ namespace osu.Game.Screens.Multi
/// <param name="onError">An action to be invoked if an error occurred.</param> /// <param name="onError">An action to be invoked if an error occurred.</param>
void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null); void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null);
/// <summary>
/// Whether the provided <paramref name="room"/> can be joined.
/// </summary>
/// <param name="room">The <see cref="Room"/> to check for.</param>
bool CanJoinRoom(Room room);
/// <summary> /// <summary>
/// Joins a <see cref="Room"/>. /// Joins a <see cref="Room"/>.
/// </summary> /// </summary>

View File

@ -115,9 +115,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
{ {
if (room == selectedRoom.Value) if (room == selectedRoom.Value)
{ {
if (roomManager.CanJoinRoom(room)) joinSelected();
joinSelected();
return; return;
} }

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.RoomStatuses;
using osu.Game.Online.RealtimeMultiplayer; using osu.Game.Online.RealtimeMultiplayer;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.Multi.Components;
@ -41,8 +40,6 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
public override void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) public override void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
=> base.CreateRoom(room, r => joinMultiplayerRoom(r, onSuccess, onError), onError); => base.CreateRoom(room, r => joinMultiplayerRoom(r, onSuccess, onError), onError);
public override bool CanJoinRoom(Room room) => !(room.Status.Value is RoomStatusEnded);
public override void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) public override void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
=> base.JoinRoom(room, r => joinMultiplayerRoom(r, onSuccess, onError), onError); => base.JoinRoom(room, r => joinMultiplayerRoom(r, onSuccess, onError), onError);