-
Notifications
You must be signed in to change notification settings - Fork 15
Enforce real time difficulty for mod combinations which are not stored in the database #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tsunyoku
wants to merge
31
commits into
ppy:master
Choose a base branch
from
tsunyoku:partial-real-time-difficulty
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2563d86
enforce realtime difficulty calculation when using non-default config…
tsunyoku 9d2cd87
add additional support for realtime calculations on non-legacy mods
tsunyoku 3b159d5
line endings
tsunyoku 435a1f5
remove unneeded interpolation
tsunyoku 749f505
line endings
tsunyoku 8aae8a2
fix CL edge case
tsunyoku 927af4e
rename `isLegacyMod` to `isRankedLegacyMod` and add missing mania mods
tsunyoku 59ca627
line endings (sigh)
tsunyoku 9835e52
add `OsuModSpunOut`
tsunyoku 8480823
handle hard rock being unranked for mania
tsunyoku b540e7b
use `ALWAYS_REALTIME_DIFFICULTY` in `DatabaseTest`
tsunyoku 5e1b1d9
line endings
tsunyoku f514a3c
add test
tsunyoku 26636d0
line endings
tsunyoku 0ec8c96
enforce realtime difficulty calculation when using non-default config…
tsunyoku 12217e7
remove unneeded interpolation
tsunyoku be5a334
fix CL edge case
tsunyoku c03acf1
rename `isLegacyMod` to `isRankedLegacyMod` and add missing mania mods
tsunyoku ff2aa59
add `OsuModSpunOut`
tsunyoku 7bbb452
handle hard rock being unranked for mania
tsunyoku b3ed260
use `ALWAYS_REALTIME_DIFFICULTY` in `DatabaseTest`
tsunyoku fc5e32a
add test
tsunyoku ffb1b48
Merge branch 'partial-real-time-difficulty' of https://github.com/tsu…
tsunyoku 2f562cd
rename env var to `PREFER_REALTIME_DIFFICULTY`
tsunyoku 808dc5f
fix README grammar
tsunyoku 19f72cb
move prefer naming back to always
tsunyoku 2abc9b2
rename to ALWAYS_USE_REALTIME_DIFFICULTY
tsunyoku 09efc44
more precise legacy mod checking
tsunyoku 327669a
Add preventative test coverage guarding against accidental inheritance
bdach 8b57913
Remove space in envvar name
bdach 68f0ce1
Merge branch 'master' into partial-real-time-difficulty
bdach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
105 changes: 105 additions & 0 deletions
105
osu.Server.Queues.ScoreStatisticsProcessor.Tests/BeatmapStoreTest.cs
This file contains hidden or 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,105 @@ | ||
| // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
| // See the LICENCE file in the repository root for full licence text. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using osu.Game.Rulesets; | ||
| using osu.Game.Rulesets.Catch; | ||
| using osu.Game.Rulesets.Catch.Mods; | ||
| using osu.Game.Rulesets.Mania; | ||
| using osu.Game.Rulesets.Mania.Mods; | ||
| using osu.Game.Rulesets.Osu; | ||
| using osu.Game.Rulesets.Osu.Mods; | ||
| using osu.Game.Rulesets.Taiko; | ||
| using osu.Game.Rulesets.Taiko.Mods; | ||
| using osu.Server.Queues.ScoreStatisticsProcessor.Stores; | ||
| using Xunit; | ||
|
|
||
| namespace osu.Server.Queues.ScoreStatisticsProcessor.Tests | ||
| { | ||
| public class BeatmapStoreTest | ||
| { | ||
| private static readonly HashSet<Type> osu_ranked_mods = new HashSet<Type> | ||
| { | ||
| typeof(OsuModNoFail), | ||
| typeof(OsuModEasy), | ||
| typeof(OsuModTouchDevice), | ||
| typeof(OsuModHidden), | ||
| typeof(OsuModHardRock), | ||
| typeof(OsuModSuddenDeath), | ||
| typeof(OsuModDoubleTime), | ||
| typeof(OsuModHalfTime), | ||
| typeof(OsuModNightcore), | ||
| typeof(OsuModFlashlight), | ||
| typeof(OsuModSpunOut), | ||
| typeof(OsuModPerfect), | ||
| }; | ||
|
|
||
| private static readonly HashSet<Type> taiko_ranked_mods = new HashSet<Type> | ||
| { | ||
| typeof(TaikoModNoFail), | ||
| typeof(TaikoModEasy), | ||
| typeof(TaikoModHidden), | ||
| typeof(TaikoModHardRock), | ||
| typeof(TaikoModSuddenDeath), | ||
| typeof(TaikoModDoubleTime), | ||
| typeof(TaikoModHalfTime), | ||
| typeof(TaikoModNightcore), | ||
| typeof(TaikoModFlashlight), | ||
| typeof(TaikoModPerfect), | ||
| }; | ||
|
|
||
| private static readonly HashSet<Type> catch_ranked_mods = new HashSet<Type> | ||
| { | ||
| typeof(CatchModNoFail), | ||
| typeof(CatchModEasy), | ||
| typeof(CatchModHidden), | ||
| typeof(CatchModHardRock), | ||
| typeof(CatchModSuddenDeath), | ||
| typeof(CatchModDoubleTime), | ||
| typeof(CatchModHalfTime), | ||
| typeof(CatchModNightcore), | ||
| typeof(CatchModFlashlight), | ||
| typeof(CatchModPerfect), | ||
| }; | ||
|
|
||
| private static readonly HashSet<Type> mania_ranked_mods = new HashSet<Type> | ||
| { | ||
| typeof(ManiaModNoFail), | ||
| typeof(ManiaModEasy), | ||
| typeof(ManiaModHidden), | ||
| typeof(ManiaModSuddenDeath), | ||
| typeof(ManiaModDoubleTime), | ||
| typeof(ManiaModHalfTime), | ||
| typeof(ManiaModNightcore), | ||
| typeof(ManiaModFlashlight), | ||
| typeof(ManiaModPerfect), | ||
| typeof(ManiaModKey4), | ||
| typeof(ManiaModKey5), | ||
| typeof(ManiaModKey6), | ||
| typeof(ManiaModKey7), | ||
| typeof(ManiaModKey8), | ||
| typeof(ManiaModFadeIn), | ||
| typeof(ManiaModKey9), | ||
| typeof(ManiaModMirror), | ||
| }; | ||
|
|
||
| public static readonly object[][] RANKED_TEST_DATA = | ||
| [ | ||
| [new OsuRuleset(), osu_ranked_mods], | ||
| [new TaikoRuleset(), taiko_ranked_mods], | ||
| [new CatchRuleset(), catch_ranked_mods], | ||
| [new ManiaRuleset(), mania_ranked_mods], | ||
| ]; | ||
|
|
||
| [Theory] | ||
| [MemberData(nameof(RANKED_TEST_DATA))] | ||
| public void TestLegacyModsMarkedAsRankedCorrectly(Ruleset ruleset, HashSet<Type> legacyModTypes) | ||
| { | ||
| var rulesetMods = ruleset.CreateAllMods(); | ||
|
|
||
| foreach (var mod in rulesetMods) | ||
| Assert.Equal(legacyModTypes.Contains(mod.GetType()), BeatmapStore.IsRankedLegacyMod(mod)); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to make sure to turn off indexing on these as soon as it goes live or we'll rack up a $1000 bill in no time