Skip to content

Commit

Permalink
Apply adjustments for struct attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 20, 2024
1 parent f0c1056 commit b85fb3e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osu.Server.DifficultyCalculator/ServerDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ private void run(WorkingBeatmap beatmap, Action<ProcessableItem, MySqlConnection

private void processDifficulty(ProcessableItem item, MySqlConnection conn)
{
foreach (var attribute in item.Ruleset.CreateDifficultyCalculator(item.WorkingBeatmap).CalculateAllLegacyCombinations())
foreach (var (mods, attributes) in item.Ruleset.CreateDifficultyCalculator(item.WorkingBeatmap).CalculateAllLegacyCombinations())
{
if (dryRun)
continue;

LegacyMods legacyMods = item.Ruleset.ConvertToLegacyMods(attribute.Mods);
LegacyMods legacyMods = item.Ruleset.ConvertToLegacyMods(mods);

conn.Execute(
"INSERT INTO `osu_beatmap_difficulty` (`beatmap_id`, `mode`, `mods`, `diff_unified`) "
Expand All @@ -120,14 +120,14 @@ private void processDifficulty(ProcessableItem item, MySqlConnection conn)
BeatmapId = item.BeatmapID,
Mode = item.RulesetID,
Mods = (int)legacyMods,
Diff = attribute.StarRating
Diff = attributes.StarRating
});

if (item.Ranked && !AppSettings.SKIP_INSERT_ATTRIBUTES)
{
var parameters = new List<object>();

foreach (var mapping in attribute.ToDatabaseAttributes())
foreach (var mapping in attributes.ToDatabaseAttributes())
{
parameters.Add(new
{
Expand Down Expand Up @@ -168,13 +168,13 @@ private void processDifficulty(ProcessableItem item, MySqlConnection conn)
object param = new
{
BeatmapId = item.BeatmapID,
Diff = attribute.StarRating,
Diff = attributes.StarRating,
AR = item.WorkingBeatmap.BeatmapInfo.Difficulty.ApproachRate,
OD = item.WorkingBeatmap.BeatmapInfo.Difficulty.OverallDifficulty,
HP = item.WorkingBeatmap.BeatmapInfo.Difficulty.DrainRate,
CS = item.WorkingBeatmap.BeatmapInfo.Difficulty.CircleSize,
BPM = Math.Round(bpm, 2),
MaxCombo = attribute.MaxCombo,
MaxCombo = attributes.MaxCombo,
CountCircle = countCircle,
CountSlider = countSlider,
CountSpinner = countSpinner,
Expand Down

0 comments on commit b85fb3e

Please sign in to comment.