feat(networking): Support restarting network session#384
Merged
MaxCWhitehead merged 4 commits intofishfolk:mainfrom Apr 14, 2024
Merged
feat(networking): Support restarting network session#384MaxCWhitehead merged 4 commits intofishfolk:mainfrom
MaxCWhitehead merged 4 commits intofishfolk:mainfrom
Conversation
github-merge-queue bot
pushed a commit
to fishfolk/jumpy
that referenced
this pull request
Apr 14, 2024
For map transitions, a session command restarting game session will be used after updating map. This updates jumpy for related changes in: fishfolk/bones#384 We can restart a networked game session by calling restart on session runner, which handles existing socket + match id increment, implemented on the bones side. CI will fail until bones PR is merged + bones updated in lockfile.
DRuppFv
pushed a commit
to DRuppFv/jumpy
that referenced
this pull request
Apr 20, 2024
For map transitions, a session command restarting game session will be used after updating map. This updates jumpy for related changes in: fishfolk/bones#384 We can restart a networked game session by calling restart on session runner, which handles existing socket + match id increment, implemented on the bones side. CI will fail until bones PR is merged + bones updated in lockfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are changes in prep for map transition. Session runner now has a restart function. When game session is reset, network session runner can be restarted by re-initializing it and using existing socket with increment match id.
Sockets now wrap ggrs messages with a match_id that allows filtering in flight messages from previous matches out to avoid issues when re-creating ggrs session.
Note that GGRS takes a boxed socket - incrementing match id on our NetworkMatchSocket or other cloned socket will not impact current ggrs socket, which is fine as we are re-creating ggrs session anyway. It may only be effectively updated by cloning socket, incrementing, and re-creating ggrs session. This also avoids issues with interior mutability of NetworkMatchSocket (arc wrapping socket), so we operate by cloning / saving boxed socket + updating this.
Additionally added resource
NetworkInfowhich is updated by net session runner before each step. Contains current + last confirmed frame, which gameplay code may use to confirm events (such as map transition) have been synchronized + confirmed by all players.These changes + session commands PR should be everything we need on the bones side to get map transitions in.