forked from ppy/osu-server-spectator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#190 from smoogipoo/failed-score-no-replay-upload
Don't upload replays for failed scores
- Loading branch information
Showing
7 changed files
with
178 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Newtonsoft.Json; | ||
using osu.Game.Online.API.Requests.Responses; | ||
|
||
namespace osu.Server.Spectator.Database.Models | ||
{ | ||
[SuppressMessage("ReSharper", "InconsistentNaming")] | ||
[Serializable] | ||
[Table("solo_scores")] | ||
public class SoloScore | ||
{ | ||
public ulong id { get; set; } | ||
|
||
public int user_id { get; set; } | ||
|
||
public int beatmap_id { get; set; } | ||
|
||
public int ruleset_id { get; set; } | ||
|
||
public string data | ||
{ | ||
get => JsonConvert.SerializeObject(ScoreInfo); | ||
set | ||
{ | ||
var scoreInfo = JsonConvert.DeserializeObject<SoloScoreInfo>(value); | ||
|
||
if (scoreInfo == null) | ||
return; | ||
|
||
ScoreInfo = scoreInfo; | ||
|
||
ScoreInfo.ID = id; | ||
ScoreInfo.BeatmapID = beatmap_id; | ||
ScoreInfo.UserID = user_id; | ||
ScoreInfo.RulesetID = ruleset_id; | ||
} | ||
} | ||
|
||
[JsonIgnore] | ||
public bool preserve { get; set; } | ||
|
||
[JsonIgnore] | ||
public bool has_replay { get; set; } | ||
|
||
[JsonIgnore] | ||
public SoloScoreInfo ScoreInfo = new SoloScoreInfo(); | ||
|
||
[JsonIgnore] | ||
public DateTimeOffset created_at { get; set; } | ||
|
||
[JsonIgnore] | ||
public DateTimeOffset updated_at { get; set; } | ||
|
||
public override string ToString() => $"score_id: {id} user_id: {user_id}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters