Skip to content

Commit

Permalink
return user with score instead of id
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Mar 17, 2024
1 parent 16332b7 commit 4e4c298
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions fluXis.Game/Online/API/Models/Scores/APIScore.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using fluXis.Game.Online.API.Models.Maps;
using fluXis.Shared.Components.Users;
using fluXis.Shared.Scoring;
using fluXis.Shared.Scoring.Enums;
using Newtonsoft.Json;
Expand All @@ -13,7 +14,7 @@ public class APIScore
public int Id { get; set; }

[JsonProperty("user")]
public int UserId { get; set; }
public APIUserShort User { get; set; }

[JsonProperty("map")]
public APIMapShort Map { get; set; }
Expand Down Expand Up @@ -84,7 +85,7 @@ public ScoreInfo ToScoreInfo()
ScrollSpeed = ScrollSpeed,
Timestamp = Time,
Mods = Mods.Split(",").ToList(),
PlayerID = UserId
PlayerID = User.ID
};
}
}
3 changes: 1 addition & 2 deletions fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using fluXis.Game.Graphics.UserInterface.Context;
using fluXis.Game.IO;
using fluXis.Game.Map;
using fluXis.Game.Online;
using fluXis.Game.Online.API.Models.Scores;
using fluXis.Game.Online.API.Requests.Maps;
using fluXis.Game.Online.Fluxel;
Expand Down Expand Up @@ -374,7 +373,7 @@ private List<ScoreListEntry> getScores(CancellationToken cancellationToken)
{
ScoreInfo = x.ToScoreInfo(),
Map = map,
Player = UserCache.GetUser(x.UserId),
Player = x.User,
DownloadAction = () => downloadScore(map, x)
}).ToList();
}
Expand Down

0 comments on commit 4e4c298

Please sign in to comment.