-
Notifications
You must be signed in to change notification settings - Fork 557
refactor: replacing GameNetPortal with state machine [MTT-1742] [MTT-3501] [MTT-3502] #666
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
Conversation
(cherry picked from commit 4bbe421)
(cherry picked from commit e30c8f9)
* Removed use of clientSceneMap * Replaced with OnLoadEventCompleted and OnSynchronizeComplete callbacks (cherry picked from commit 80fe462)
(cherry picked from commit d094706)
(cherry picked from commit 444f436)
(cherry picked from commit 96575b7)
(cherry picked from commit 0a3680d)
(cherry picked from commit 2c83355)
(cherry picked from commit f49977d)
(cherry picked from commit 47444a1)
…ts are exhausted (cherry picked from commit 6a06365)
(cherry picked from commit 2accfe4)
* Reconnecting now inherits from Offline * Also extracted GetPlayerId() to Offline state (cherry picked from commit 4f1c105)
(cherry picked from commit 429ee19)
(cherry picked from commit b23b99f)
* shutting down host now changes state to offline * fixed return value of JoinRelayServerAsync (cherry picked from commit 593da8a)
(cherry picked from commit 0e07a94)
(cherry picked from commit fd9e635)
(cherry picked from commit 532bd10)
(cherry picked from commit 9d3c1b7)
9d3c1b7
to
2516936
Compare
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 really like this! A suggestion would be to include a little blurb (either in each state) or somewhere central where you could detail what state each state can transition to. Even without that, it was real simple to navigate. 🚀
Assets/Scripts/Gameplay/ConnectionManagement/ConnectionManager.cs
Outdated
Show resolved
Hide resolved
…jected in ClientReconnectingState too
Assets/Scripts/ConnectionManagement/Unity.BossRoom.ConnectionManagement.asmdef
Outdated
Show resolved
Hide resolved
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 like the update and love the new state machine approach!
From what I can tell, it looks like a bunch of really good improvements.
* develop: refactor: replacing GameNetPortal with state machine [MTT-1742] [MTT-3501] [MTT-3502] (#666) chore: update NGO, tools, authentication and relay packages (#690) feat: replacing discope with vcontainer [MTT-3675] (PR recreated) (#679) updated changelogs with fixes made to the release changelog (#688) # Conflicts: # Assets/Scenes/CharSelect.unity # Assets/Scenes/PostGame.unity # Assets/Scenes/Startup.unity # Assets/Scripts/ApplicationLifecycle/ApplicationController.cs # Assets/Scripts/Gameplay/ConnectionManagement/ClientGameNetPortal.cs # Assets/Scripts/Gameplay/ConnectionManagement/GameNetPortal.cs # Assets/Scripts/Gameplay/ConnectionManagement/ServerGameNetPortal.cs # Assets/Scripts/Gameplay/DebugCheats/Unity.BossRoom.DebugCheats.asmdef # Assets/Scripts/Gameplay/GameState/ClientBossRoomState.cs # Assets/Scripts/Gameplay/GameState/ClientCharSelectState.cs # Assets/Scripts/Gameplay/GameState/ClientPostGameState.cs # Assets/Scripts/Gameplay/GameState/GameStateBehaviour.cs # Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs # Assets/Scripts/Gameplay/GameState/ServerCharSelectState.cs # Assets/Scripts/Gameplay/GameState/ServerPostGameState.cs # Assets/Scripts/Gameplay/GameplayObjects/ClientDoorVisualization.cs # Assets/Scripts/Gameplay/UI/IPUIMediator.cs # Assets/Scripts/Gameplay/UI/PostGameUI.cs # Assets/Scripts/Infrastructure/DIScope.cs # Assets/Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef
Description
This PR aims to simplify and clarify the connection flow in Boss Room. It replaces GameNetPortal (as well as ClientGameNetPortal and ServerGameNetPortal) with a state machine (ConnectionManager). This state machine receives inputs from other parts of our code, and registers to callbacks from NGO. It then redirects these inputs and callbacks to the current state, which then handles it accordingly.
ConnectionManager is responsible for initializing the different states and redirecting inputs and callbacks to them. It also handles our custom messaging for giving a disconnect reason to clients.
The connection logic itself is the responsibility of the different states.
Issue Number(s)
MTT-1742, MTT-3502 & MTT-3501
Contribution checklist