mirror of
https://github.com/osukey/osukey.git
synced 2025-05-08 07:07:18 +09:00
Fix ID
mapping and move osu-web additions to region to identify them clearly
This commit is contained in:
parent
f956955d4d
commit
12a56e36bd
@ -18,9 +18,8 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class SoloScoreInfo : IHasOnlineID<long>
|
public class SoloScoreInfo : IHasOnlineID<long>
|
||||||
{
|
{
|
||||||
[JsonIgnore]
|
[JsonProperty("replay")]
|
||||||
[JsonProperty(" ")]
|
public bool HasReplay { get; set; }
|
||||||
public long ID { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("beatmap_id")]
|
[JsonProperty("beatmap_id")]
|
||||||
public int BeatmapID { get; set; }
|
public int BeatmapID { get; set; }
|
||||||
@ -43,12 +42,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
[JsonProperty("user_id")]
|
[JsonProperty("user_id")]
|
||||||
public int UserID { get; set; }
|
public int UserID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// User may be provided via an osu-web response, but will not be present from raw database json.
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("user")]
|
|
||||||
public APIUser? User { get; set; }
|
|
||||||
|
|
||||||
// TODO: probably want to update this column to match user stats (short)?
|
// TODO: probably want to update this column to match user stats (short)?
|
||||||
[JsonProperty("max_combo")]
|
[JsonProperty("max_combo")]
|
||||||
public int MaxCombo { get; set; }
|
public int MaxCombo { get; set; }
|
||||||
@ -81,6 +74,19 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
[JsonProperty("statistics")]
|
[JsonProperty("statistics")]
|
||||||
public Dictionary<HitResult, int> Statistics { get; set; } = new Dictionary<HitResult, int>();
|
public Dictionary<HitResult, int> Statistics { get; set; } = new Dictionary<HitResult, int>();
|
||||||
|
|
||||||
|
#region osu-web API additions (not stored to database).
|
||||||
|
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public long? ID { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user")]
|
||||||
|
public APIUser? User { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("pp")]
|
||||||
|
public double? PP { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public override string ToString() => $"score_id: {ID} user_id: {UserID}";
|
public override string ToString() => $"score_id: {ID} user_id: {UserID}";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -116,7 +122,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
public ScoreInfo ToScoreInfo(Mod[] mods) => new ScoreInfo
|
public ScoreInfo ToScoreInfo(Mod[] mods) => new ScoreInfo
|
||||||
{
|
{
|
||||||
OnlineID = OnlineID,
|
OnlineID = OnlineID,
|
||||||
User = new APIUser { Id = UserID },
|
User = User ?? new APIUser { Id = UserID },
|
||||||
BeatmapInfo = new BeatmapInfo { OnlineID = BeatmapID },
|
BeatmapInfo = new BeatmapInfo { OnlineID = BeatmapID },
|
||||||
Ruleset = new RulesetInfo { OnlineID = RulesetID },
|
Ruleset = new RulesetInfo { OnlineID = RulesetID },
|
||||||
Passed = Passed,
|
Passed = Passed,
|
||||||
@ -127,9 +133,11 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
Statistics = Statistics,
|
Statistics = Statistics,
|
||||||
Date = EndedAt ?? DateTimeOffset.Now,
|
Date = EndedAt ?? DateTimeOffset.Now,
|
||||||
Hash = "online", // TODO: temporary?
|
Hash = "online", // TODO: temporary?
|
||||||
|
HasReplay = HasReplay,
|
||||||
Mods = mods,
|
Mods = mods,
|
||||||
|
PP = PP,
|
||||||
};
|
};
|
||||||
|
|
||||||
public long OnlineID => ID;
|
public long OnlineID => ID ?? -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user