mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 03:13:22 +08:00
Bring back user-based endpoint for viewing result screen from playlists lounge
This commit is contained in:
parent
d150aeef2b
commit
c1416f9920
23
osu.Game/Online/Rooms/ShowPlaylistUserScoreRequest.cs
Normal file
23
osu.Game/Online/Rooms/ShowPlaylistUserScoreRequest.cs
Normal 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}";
|
||||
}
|
||||
}
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user