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

Update signatures in line with no-overload methods (unsupported by signalr)

This commit is contained in:
Dean Herbert 2021-07-09 16:01:45 +09:00
parent 2ca11d458a
commit 5148069efe
4 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,6 @@ namespace osu.Game.Online.Multiplayer
/// <param name="password">The password for the join request.</param>
/// <exception cref="InvalidStateException">If the user is already in the requested (or another) room.</exception>
/// <exception cref="InvalidPasswordException">If the room provided password was incorrect.</exception>
Task<MultiplayerRoom> JoinRoom(long roomId, string password);
Task<MultiplayerRoom> JoinRoomWithPassword(long roomId, string password);
}
}

View File

@ -152,8 +152,9 @@ namespace osu.Game.Online.Multiplayer
/// Joins the <see cref="MultiplayerRoom"/> with a given ID.
/// </summary>
/// <param name="roomId">The room ID.</param>
/// <param name="password">An optional password to use when joining the room.</param>
/// <returns>The joined <see cref="MultiplayerRoom"/>.</returns>
protected abstract Task<MultiplayerRoom> JoinRoom(long roomId);
protected abstract Task<MultiplayerRoom> JoinRoom(long roomId, string? password = null);
public Task LeaveRoom()
{

View File

@ -62,12 +62,12 @@ namespace osu.Game.Online.Multiplayer
}
}
protected override Task<MultiplayerRoom> JoinRoom(long roomId)
protected override Task<MultiplayerRoom> JoinRoom(long roomId, string? password = null)
{
if (!IsConnected.Value)
return Task.FromCanceled<MultiplayerRoom>(new CancellationToken(true));
return connection.InvokeAsync<MultiplayerRoom>(nameof(IMultiplayerServer.JoinRoom), roomId);
return connection.InvokeAsync<MultiplayerRoom>(nameof(IMultiplayerServer.JoinRoomWithPassword), roomId, password ?? string.Empty);
}
protected override Task LeaveRoomInternal()

View File

@ -115,7 +115,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
((IMultiplayerClient)this).UserBeatmapAvailabilityChanged(userId, newBeatmapAvailability);
}
protected override Task<MultiplayerRoom> JoinRoom(long roomId)
protected override Task<MultiplayerRoom> JoinRoom(long roomId, string? password = null)
{
var apiRoom = roomManager.Rooms.Single(r => r.RoomID.Value == roomId);
@ -134,7 +134,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
BeatmapChecksum = apiRoom.Playlist.Last().Beatmap.Value.MD5Hash,
RequiredMods = apiRoom.Playlist.Last().RequiredMods.Select(m => new APIMod(m)).ToArray(),
AllowedMods = apiRoom.Playlist.Last().AllowedMods.Select(m => new APIMod(m)).ToArray(),
PlaylistItemId = apiRoom.Playlist.Last().ID
PlaylistItemId = apiRoom.Playlist.Last().ID,
Password = password ?? string.Empty,
},
Users = { localUser },
Host = localUser