1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:33:22 +08:00

Bring back user-based endpoint for viewing result screen from playlists lounge

This commit is contained in:
Salman Alshamrani 2024-11-26 01:10:12 -05:00
parent d150aeef2b
commit c1416f9920
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,23 @@
// 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.
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class ShowPlaylistUserScoreRequest : APIRequest<MultiplayerScore>
{
private readonly long roomId;
private readonly long playlistItemId;
private readonly long userId;
public ShowPlaylistUserScoreRequest(long roomId, long playlistItemId, long userId)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;
this.userId = userId;
}
protected override string Target => $"rooms/{roomId}/playlist/{playlistItemId}/scores/users/{userId}";
}
}

View File

@ -20,7 +20,9 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
{
}
protected override APIRequest<MultiplayerScore> CreateScoreRequest() => new ShowPlaylistScoreRequest(RoomId, PlaylistItem.ID, Score?.OnlineID ?? -1);
protected override APIRequest<MultiplayerScore> CreateScoreRequest() => Score == null
? new ShowPlaylistScoreRequest(RoomId, PlaylistItem.ID, Score?.OnlineID ?? -1)
: new ShowPlaylistUserScoreRequest(RoomId, PlaylistItem.ID, API.LocalUser.Value.Id);
protected override ScoreInfo[] PerformSuccessCallback(Action<IEnumerable<ScoreInfo>> callback, List<MultiplayerScore> scores, MultiplayerScores? pivot = null)
{