From 4e4c29800a67aeb3b4db6125ca5d5270cd868dd8 Mon Sep 17 00:00:00 2001 From: flustix Date: Sun, 17 Mar 2024 17:00:25 +0100 Subject: [PATCH] return user with score instead of id --- fluXis.Game/Online/API/Models/Scores/APIScore.cs | 5 +++-- fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fluXis.Game/Online/API/Models/Scores/APIScore.cs b/fluXis.Game/Online/API/Models/Scores/APIScore.cs index d551a94f..8b6d5de3 100644 --- a/fluXis.Game/Online/API/Models/Scores/APIScore.cs +++ b/fluXis.Game/Online/API/Models/Scores/APIScore.cs @@ -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; @@ -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; } @@ -84,7 +85,7 @@ public ScoreInfo ToScoreInfo() ScrollSpeed = ScrollSpeed, Timestamp = Time, Mods = Mods.Split(",").ToList(), - PlayerID = UserId + PlayerID = User.ID }; } } diff --git a/fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs b/fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs index ec9fe946..dbb87dd2 100644 --- a/fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs +++ b/fluXis.Game/Screens/Select/Info/Scores/ScoreList.cs @@ -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; @@ -374,7 +373,7 @@ private List getScores(CancellationToken cancellationToken) { ScoreInfo = x.ToScoreInfo(), Map = map, - Player = UserCache.GetUser(x.UserId), + Player = x.User, DownloadAction = () => downloadScore(map, x) }).ToList(); }