Send in initial score request instead

This commit is contained in:
Dean Herbert 2020-07-29 13:18:40 +09:00
parent 6c7e806eac
commit 9e6d562872
4 changed files with 5 additions and 6 deletions

View File

@ -11,17 +11,20 @@ namespace osu.Game.Online.Multiplayer
{
private readonly int roomId;
private readonly int playlistItemId;
private readonly string versionHash;
public CreateRoomScoreRequest(int roomId, int playlistItemId)
public CreateRoomScoreRequest(int roomId, int playlistItemId, string versionHash)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;
this.versionHash = versionHash;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Post;
req.AddParameter("version_hash", versionHash);
return req;
}

View File

@ -51,9 +51,6 @@ namespace osu.Game.Scoring
[NotMapped]
public bool Passed { get; set; } = true;
[JsonProperty("version_hash")]
public string VersionHash { get; set; }
[JsonIgnore]
public virtual RulesetInfo Ruleset { get; set; }

View File

@ -58,7 +58,7 @@ namespace osu.Game.Screens.Multi.Play
if (!playlistItem.RequiredMods.All(m => Mods.Value.Any(m.Equals)))
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
var req = new CreateRoomScoreRequest(roomId.Value ?? 0, playlistItem.ID);
var req = new CreateRoomScoreRequest(roomId.Value ?? 0, playlistItem.ID, Game.VersionHash);
req.Success += r => token = r.ID;
req.Failure += e =>
{

View File

@ -465,7 +465,6 @@ namespace osu.Game.Screens.Play
{
Beatmap = Beatmap.Value.BeatmapInfo,
Ruleset = rulesetInfo,
VersionHash = Game.VersionHash,
Mods = Mods.Value.ToArray(),
};