mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 15:53:21 +08:00
Fix response value
This commit is contained in:
parent
a606f41297
commit
13622eff1f
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
switch (request)
|
switch (request)
|
||||||
{
|
{
|
||||||
case GetRoomPlaylistScoresRequest r:
|
case GetRoomPlaylistScoresRequest r:
|
||||||
r.TriggerSuccess(roomScores);
|
r.TriggerSuccess(new RoomPlaylistScores { Scores = roomScores });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetRoomPlaylistScoresRequest : APIRequest<List<RoomScore>>
|
public class GetRoomPlaylistScoresRequest : APIRequest<RoomPlaylistScores>
|
||||||
{
|
{
|
||||||
private readonly int roomId;
|
private readonly int roomId;
|
||||||
private readonly int playlistItemId;
|
private readonly int playlistItemId;
|
||||||
@ -18,4 +19,10 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
protected override string Target => $@"rooms/{roomId}/playlist/{playlistItemId}/scores";
|
protected override string Target => $@"rooms/{roomId}/playlist/{playlistItemId}/scores";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RoomPlaylistScores
|
||||||
|
{
|
||||||
|
[JsonProperty("scores")]
|
||||||
|
public List<RoomScore> Scores { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Multi.Ranking
|
|||||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||||
{
|
{
|
||||||
var req = new GetRoomPlaylistScoresRequest(roomId, playlistItem.ID);
|
var req = new GetRoomPlaylistScoresRequest(roomId, playlistItem.ID);
|
||||||
req.Success += r => scoresCallback?.Invoke(r.Where(s => s.ID != Score?.OnlineScoreID).Select(s => s.CreateScoreInfo(playlistItem)));
|
req.Success += r => scoresCallback?.Invoke(r.Scores.Where(s => s.ID != Score?.OnlineScoreID).Select(s => s.CreateScoreInfo(playlistItem)));
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user