mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 13:22:55 +08:00
Serialise and deserialise ClientVersion
to replays
This commit is contained in:
parent
81bbdccee7
commit
2baf579f7c
@ -35,12 +35,16 @@ namespace osu.Game.Scoring.Legacy
|
||||
[JsonProperty("maximum_statistics")]
|
||||
public Dictionary<HitResult, int> MaximumStatistics { get; set; } = new Dictionary<HitResult, int>();
|
||||
|
||||
[JsonProperty("client_version")]
|
||||
public string ClientVersion = string.Empty;
|
||||
|
||||
public static LegacyReplaySoloScoreInfo FromScore(ScoreInfo score) => new LegacyReplaySoloScoreInfo
|
||||
{
|
||||
OnlineID = score.OnlineID,
|
||||
Mods = score.APIMods,
|
||||
Statistics = score.Statistics.Where(kvp => kvp.Value != 0).ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
|
||||
MaximumStatistics = score.MaximumStatistics.Where(kvp => kvp.Value != 0).ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
|
||||
ClientVersion = score.ClientVersion,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -125,6 +125,7 @@ namespace osu.Game.Scoring.Legacy
|
||||
score.ScoreInfo.Statistics = readScore.Statistics;
|
||||
score.ScoreInfo.MaximumStatistics = readScore.MaximumStatistics;
|
||||
score.ScoreInfo.Mods = readScore.Mods.Select(m => m.ToMod(currentRuleset)).ToArray();
|
||||
score.ScoreInfo.ClientVersion = readScore.ClientVersion;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user