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

Impl game leaving at DE Lobby #664

Open
Indy2222 opened this issue Aug 3, 2023 · 2 comments
Open

Impl game leaving at DE Lobby #664

Indy2222 opened this issue Aug 3, 2023 · 2 comments

Comments

@Indy2222
Copy link
Collaborator

Indy2222 commented Aug 3, 2023

Currently, the player stays connected to the game indefinitely if they press "X" button and disconnect.

Similar to #319 except this is about explicit & immediate leaving.

@Indy2222
Copy link
Collaborator Author

This will probably be fixed as a side effect of #689.

@redbugz
Copy link
Contributor

redbugz commented Jun 20, 2024

This issue is rather annoying for me, and I was exploring this fix, and looked at #689 but it seems rather involved to complete. Would effort be better spent moving that along, or would it make sense to do a smaller/temporary workaround for this until #689 is complete?

I was hoping this was going to be just a simple fix, but as I explored, it seems like it would require a bit of refactoring, but it's not clear to me yet where the best solution would be.

I first tried to send a LeaveGameRequest from the cleanup() function of menu/src/multiplayer/joined/state.rs but it panicked because GameNameRes has already been cleaned up and is gone. If this is the best place for the logic, then we would need to change the ordering so the game name is available, or add an additional state/event before cleanup for leaving a game.

I also considered putting it in multiplayer/src/game.rs or lifecycle.rs, but the connector does not know the name of the game, so the game_name would have become part of the connector data, or get passed in through one of the events/states.

It could also go in menu/src/multiplayer/joining.rs but that does not have access to the lifecycle/data needed to make the LeaveGameRequest. It focuses on the joining flow, and the leaving flow is quite different, so it's not clear if leaving makes sense as an extension of the joining flow, or if it is a separate flow and should be kept separate from joining.

If it makes sense to do a temporary fix, which of the above (or another I missed) would be the best place to fix this issue? Or should I start working on #689 and get that longer-term fix going instead?

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

No branches or pull requests

2 participants