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

Notifications can kick players from live games #29341

Closed
ziv-vy opened this issue Aug 7, 2024 · 6 comments · Fixed by #30073
Closed

Notifications can kick players from live games #29341

ziv-vy opened this issue Aug 7, 2024 · 6 comments · Fixed by #30073
Assignees

Comments

@ziv-vy
Copy link
Contributor

ziv-vy commented Aug 7, 2024

Type

Game behaviour

Bug description

Notifications can be sent to the game during breaks. Clicking the notification will take you to the menu with no warning, cancelling your current play.

Screenshots or videos

https://youtu.be/jiyayK8jd9s

Version

2024.727.0

@ziv-vy ziv-vy changed the title Update notifications can kick players from live games Notifications can kick players from live games Aug 16, 2024
@ziv-vy
Copy link
Contributor Author

ziv-vy commented Aug 16, 2024

It seems like update notifications are not the only kind of notification that cause this issue...

@peppy peppy self-assigned this Aug 30, 2024
@peppy
Copy link
Member

peppy commented Aug 30, 2024

This is kiiinda how notifications work. Player only blocks the first exit request, but the restart notification is very persistent due to using PerformFromScreen:

private bool restartToApplyUpdate()
{
PrepareUpdateAsync()
.ContinueWith(_ => Schedule(() => game.AttemptExit()));
return true;
}

osu/osu.Game/OsuGame.cs

Lines 857 to 861 in f068b7a

public override void AttemptExit()
{
// The main menu exit implementation gives the user a chance to interrupt the exit process if needed.
PerformFromScreen(menu => menu.Exit(), new[] { typeof(MainMenu) });
}

I can think of two options:

  • Player should block at the pause screen regardless of further exit requests until the user chooses the on-screen "Exit" button. This would make it similar to the editor when it has changes pending.
  • The flow to exit on update application should be less persistent. This would either mean making an exception for "user in gameplay" (simple) or changing the PerformFromScreen implementation to allow no-retry mode.

Open to opinion on this one @ppy/team-client.

@bdach
Copy link
Collaborator

bdach commented Aug 30, 2024

I don't think update notifications should ever be shown during gameplay to begin with. I'm not sure how feasible that is to address, however.

Player should block at the pause screen regardless of further exit requests until the user chooses the on-screen "Exit" button. This would make it similar to the editor when it has changes pending.

I feel like this would get sorta confusing if it was just using the standard pause screen without specific messaging that the game will restart on exit.

The flow to exit on update application should be less persistent. This would either mean making an exception for "user in gameplay" (simple) or changing the PerformFromScreen implementation to allow no-retry mode.

Again not sure on this one due to messaging. If the notification says "click to restart" and then the restart either doesn't happen or is indefinitely delayed until player exit then that does not sound good.

@peppy
Copy link
Member

peppy commented Aug 30, 2024

I'll see if I can stop it showing during gameplay.

@peppy
Copy link
Member

peppy commented Sep 2, 2024

@bdach which of these would you prefer?

// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;

namespace osu.Game.Screens.Play
{
    [Cached]
    public interface ILocalUserPlayInfo
    {
        /// <summary>
        /// Whether the local user is currently playing.
        /// </summary>
        /// <remarks>
        /// Importantly, this will become <c>false</c> during break time (or when paused).
        /// </remarks>
        IBindable<bool> IsPlaying { get; }

        /// <summary>
        /// Whether the local user is in a gameplay session (ie. at the <see cref="Player"/> screen).
        /// </summary>
        /// <remarks>
        /// This will still be <c>true</c> if the user is paused or in break time.
        /// </remarks>
        IBindable<bool> IsInGameplay { get; }
    }
}
// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;

namespace osu.Game.Screens.Play
{
    [Cached]
    public interface ILocalUserPlayInfo
    {
        /// <summary>
        /// Whether the local user is currently playing.
        /// </summary>
        IBindable<PlayingState> PlayingState { get; }
    }

    public enum PlayingState
    {
        /// <summary>
        /// The local player is not current in gameplay
        /// </summary>
        NotPlaying,

        /// <summary>
        /// In break time or paused.
        /// </summary>
        Break,

        /// <summary>
        /// The local user is in active gameplay.
        /// </summary>
        Playing,
    }
}

"neither" is also an option. but if we're looking for a less hacky solution, I'd rather not make a new tracking class and just modify this one to work for the cases we require.

@bdach
Copy link
Collaborator

bdach commented Sep 2, 2024

Probably the enum variant.

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