Skip to content

Commit

Permalink
Merge pull request #225 from peppy/add-max-combo-output
Browse files Browse the repository at this point in the history
Output `max_combo` to `osu_beatmaps` table
  • Loading branch information
smoogipoo committed Sep 20, 2023
2 parents caf2568 + a9c5c28 commit 729380a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions osu.Server.DifficultyCalculator.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PrivateVariableCanBeMadeReadonly/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantAnonymousTypePropertyName/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentDefaultValue/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArrayCreationExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantAttributeParentheses/@EntryIndexedValue">WARNING</s:String>
Expand Down
11 changes: 6 additions & 5 deletions osu.Server.DifficultyCalculator/ServerDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,22 @@ private void computeDifficulty(int beatmapId, WorkingBeatmap beatmap, Ruleset ru
OD = beatmap.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty,
HP = beatmap.Beatmap.BeatmapInfo.Difficulty.DrainRate,
CS = beatmap.Beatmap.BeatmapInfo.Difficulty.CircleSize,
BPM = Math.Round(bpm, 2)
BPM = Math.Round(bpm, 2),
MaxCombo = attribute.MaxCombo,
};

if (AppSettings.INSERT_BEATMAPS)
{
conn.Execute(
"INSERT INTO `osu_beatmaps` (`beatmap_id`, `difficultyrating`, `diff_approach`, `diff_overall`, `diff_drain`, `diff_size`, `bpm`) "
+ "VALUES (@BeatmapId, @Diff, @AR, @OD, @HP, @CS, @BPM) "
+ "ON DUPLICATE KEY UPDATE `difficultyrating` = @Diff, `diff_approach` = @AR, `diff_overall` = @OD, `diff_drain` = @HP, `diff_size` = @CS, `bpm` = @BPM",
"INSERT INTO `osu_beatmaps` (`beatmap_id`, `difficultyrating`, `diff_approach`, `diff_overall`, `diff_drain`, `diff_size`, `bpm`, `max_combo`) "
+ "VALUES (@BeatmapId, @Diff, @AR, @OD, @HP, @CS, @BPM, @MaxCombo) "
+ "ON DUPLICATE KEY UPDATE `difficultyrating` = @Diff, `diff_approach` = @AR, `diff_overall` = @OD, `diff_drain` = @HP, `diff_size` = @CS, `bpm` = @BPM, `max_combo` = @MaxCombo",
param);
}
else
{
conn.Execute(
"UPDATE `osu_beatmaps` SET `difficultyrating` = @Diff, `diff_approach` = @AR, `diff_overall` = @OD, `diff_drain` = @HP, `diff_size` = @CS, `bpm` = @BPM "
"UPDATE `osu_beatmaps` SET `difficultyrating` = @Diff, `diff_approach` = @AR, `diff_overall` = @OD, `diff_drain` = @HP, `diff_size` = @CS, `bpm` = @BPM , `max_combo` = @MaxCombo"
+ "WHERE `beatmap_id` = @BeatmapId",
param);
}
Expand Down

0 comments on commit 729380a

Please sign in to comment.