1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +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 bool CanJoinRoom(Room room) => true;
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);
}
public bool CanJoinRoom(Room room) => true;
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null) => throw new NotImplementedException();
public void PartRoom() => throw new NotImplementedException();

View File

@ -161,8 +161,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
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 PartRoom()

View File

@ -82,8 +82,6 @@ namespace osu.Game.Screens.Multi.Components
api.Queue(req);
}
public virtual bool CanJoinRoom(Room room) => true;
private JoinRoomRequest currentJoinRoomRequest;
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>
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>
/// Joins a <see cref="Room"/>.
/// </summary>

View File

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

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Logging;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.RoomStatuses;
using osu.Game.Online.RealtimeMultiplayer;
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)
=> 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)
=> base.JoinRoom(room, r => joinMultiplayerRoom(r, onSuccess, onError), onError);