mirror of
https://github.com/ppy/osu.git
synced 2025-03-07 04:17:18 +08:00
Fix crash caused by user json order changing
This commit is contained in:
parent
7c428011a2
commit
c18248c827
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user