Skip to content
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

Avoid updates (and update notifications) from appearing in more gameplay cases #30073

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Oct 1, 2024

Second attempt at #29657 taking on feedback from #29657 (comment).

  • RFC, haven't tested update flow yet.

Closes #29341.

Comment on lines 391 to 393
BeatmapManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying;
SkinManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying;
ScoreManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying;
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this stops imports from running during break time and on the fail screen, which is an extra win.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a cursory read of structure, haven't examined the logic in detail yet (or tested)


namespace osu.Game.Screens.Play
{
public enum LocalUserPlayingStates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit weird for this enum name to be in plural, I'd normally expect LocalUserPlayingState...?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had it plural to avoid the classic namespace conflict with field (was called PlayingState). Can go with non-plural not, sure.

@@ -94,6 +94,7 @@ public abstract partial class Player : ScreenWithBeatmapBackground, ISamplePlayb
public IBindable<bool> LocalUserPlaying => localUserPlaying;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue this should no longer be public (or even exist).

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's gonna touch a lot of tests though (take a quick look and see if you thing it's worth it)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see the extent of it is mostly asserts, right? If that is accurate then I think it's worth getting rid just to lower the redundancy around here. I'll have to cross-check all of the existing conditional changes anyway to make sure nothing slipped by so that seems like a rather minor inconvenience from both authoring and reviewing angles.

Comment on lines 393 to 394
// For scores, we need to allow imports during "Break" state else local user's scores will never be imported.
ScoreManager.PauseImports = p.NewValue == LocalUserPlayingStates.Playing;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird, can the state not transition to NotPlaying on gameplay completion or something?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can try and make that happen sure.

@@ -508,7 +508,7 @@ private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime)

private void updateGameplayState()
{
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value;
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value && !GameplayState.HasPassed;
bool inBreak = breakTracker.IsBreakTime.Value || DrawableRuleset.IsPaused.Value || GameplayState.HasFailed;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm with failing being considered as "break" I'm not sure the ScoreManager.PauseImports change is entirely correct. I'd say any sort of gameplay completion should transition the state to NotPlaying...?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I didn't originally add failing is that I thought we'd want things like imports to stay blocked while at the fail screen (else they may continue into the start of the next play). I think it's also quite crippling when imports run during HighPerformanceSession. But maybe this is an edge case we just allow to happen for now?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd want things like imports to stay blocked while at the fail screen

Except for the part where you can request the failed play to be imported at the fail screen which will presumably deadlock now.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably need a test and just doing as you say for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications can kick players from live games
2 participants