-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implement flow allowing disconnection from online services when another client instance for same user is detected #25522
Conversation
When the server requests a disconnect due to a user connecting via a second device, the client will now log the user out on the first device and show a notification informing them of the cause of disconnection.
@@ -98,7 +98,9 @@ public virtual void PartRoom() | |||
if (JoinedRoom.Value == null) | |||
return; | |||
|
|||
api.Queue(new PartRoomRequest(joinedRoom.Value)); | |||
if (api.State.Value == APIState.Online) |
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.
Without this check is it actually feasible that this fires and causes issues?
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.
Yes, I hit this once in testing.
That said I'll probably look at this again, after I'm somewhat sure this pair of PRs is going in the correct direction.
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.
Looking at this again, I think there should be no issues with this. Server-side flows are supposed to correctly clean up the room anyway, so this request not being realised should have no impact on the server.
I think this is looking pretty decent. |
Prerequisite for ppy/osu-server-spectator#80.
In action:
2023-11-21.15-12-55.mp4
In short, when a user logs in on one client instance, and then on another, the previous instance is forcibly logged out. It can be restored to full online operation by logging in again, at which point any other online instance will be forcibly logged out. So the goal here is to keep concurrency to 1.
The reason that this does a full logout rather than something more limited is (a) that it's easy to integrate with existing systems, and also (b) avoids weirdness. For instance, we could theoretically allow the user to solo even with concurrent client instances, were it not for the fact that
osu-server-spectator
- namelySpectatorHub
- participates in the replay recording part of score submission, and cannot handle concurrency.This currently has no testing other than manual, but I'm not sure anything more is feasible anyway. I'm also not sure of the general shape of this, which is why I'm opening as draft and refraining from adding tests until requested and I am sure that there's at least an agreement that this looks how everyone would want it to look.