mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Fix crash caused by user json order changing
This commit is contained in:
@ -173,8 +173,27 @@ namespace osu.Game.Users
|
|||||||
public int Available;
|
public int Available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private UserStatistics statistics;
|
||||||
|
|
||||||
[JsonProperty(@"statistics")]
|
[JsonProperty(@"statistics")]
|
||||||
public UserStatistics Statistics;
|
public UserStatistics Statistics
|
||||||
|
{
|
||||||
|
get => statistics ??= new UserStatistics();
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (statistics != null)
|
||||||
|
// we may already have rank history populated
|
||||||
|
value.RankHistory = statistics.RankHistory;
|
||||||
|
|
||||||
|
statistics = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"rankHistory")]
|
||||||
|
private RankHistoryData rankHistory
|
||||||
|
{
|
||||||
|
set => statistics.RankHistory = value;
|
||||||
|
}
|
||||||
|
|
||||||
public class RankHistoryData
|
public class RankHistoryData
|
||||||
{
|
{
|
||||||
@ -185,12 +204,6 @@ namespace osu.Game.Users
|
|||||||
public int[] Data;
|
public int[] Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonProperty(@"rankHistory")]
|
|
||||||
private RankHistoryData rankHistory
|
|
||||||
{
|
|
||||||
set => Statistics.RankHistory = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("badges")]
|
[JsonProperty("badges")]
|
||||||
public Badge[] Badges;
|
public Badge[] Badges;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user