-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add basic setup switching for the tournament client #9256
Conversation
Can test the default directory from a clean instance, it can test a custom directory and can execute migration from an instance using the older directory setup.
Was too excited to add blank lines before submitting the PR that I overdid it
Generally if something depends on another branch/PR, you should rebase it on top of that (so it will compile and work for testing). |
I locally tested by merging this branch into #9247, stashed any changes I wanted to keep and then applied it to this branch. It's a very roundabout way of doing things, but it was the only way I was familiar and comfortable with. I'll look into rebasing. |
It's fine this time around, just a heads-up for future contributions. |
osu.Game/IO/MigratableStorage.cs
Outdated
internal virtual string[] IgnoreDirectories => Array.Empty<string>(); | ||
internal virtual string[] IgnoreFiles => Array.Empty<string>(); |
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.
This is a weird modifier mix. Any consumers from a different assembly that might want to override this will not be able to. I think this calls for the rarely-seen
internal virtual string[] IgnoreDirectories => Array.Empty<string>(); | |
internal virtual string[] IgnoreFiles => Array.Empty<string>(); | |
protected internal virtual string[] IgnoreDirectories => Array.Empty<string>(); | |
protected internal virtual string[] IgnoreFiles => Array.Empty<string>(); |
(Or heck, just make it public, I don't think that's that much of a deal.)
Needs to be fixed up in the override too if this happens.
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.
I've changed it to public for now, will await further feedback about this in case protected
becomes the preferred way to go.
Now asserting instead of an if-statement, change cast from OsuStorage to MigratableStorage and make internal virtual properties protected.
I've been looking into making Right now I moved the original I've also looked into making the Before:
After:
|
Forgot to change this while changing the param from string to Storage
Alright thanks! I'll hold off from any more big changes until after those are merged I made if (sourceUri.IsBaseOf(destinationUri))
throw new ArgumentException("Destination provided is inside the source", destination.FullName); I also believe at the same time that I could just be talking about some non-issue and that overriding like this is fine, but I am not sure. Hopefully it will come to light once it can be reviewed again. |
# Conflicts: # osu.Game/IO/OsuStorage.cs
I resolved the conflicts in an incoming commit and reran the tests locally again to make sure they didn't fail. I thought some more about this and my comment above can actually be disregarded. The intention of the migration method is that it is supposed to be a temporary method so that existing configurations get migrated after users update the client. For future versions users would be instructed to create their new configurations in the format of The end goal is to put this functionality of adding and selecting tournaments in the UI itself. |
There was no reason it should be nested inside.
Without this change flags/mods would not work as expected. The video store was being added as the texture store incorrectly.
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.
Should be good to go now.
From #9199, this fulfils
This PR changes the default path for tournaments from
%APPDATA%\osu\tournament
to%APPDATA%\osu\tournaments\default
.Migrations for this are implemented so that this change does not break existing configurations and the necessary tests are also written for that. The migration also includes moving the
bracket.json
to the same directory.Upon migration a
tournament.ini
gets created with the following default value:Post-migration scenario
The user can now add directories in the following format:
and then change the
tournament.ini
to:Because of this, switching the storage requires a reboot of the tournament client.