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

feat(networking): Support restarting network session #384

Merged
merged 4 commits into from
Apr 14, 2024

Conversation

MaxCWhitehead
Copy link
Collaborator

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 NetworkInfo which 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.

Copy link
Member

@zicklag zicklag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! ✒️

@MaxCWhitehead MaxCWhitehead merged commit b7f59fc into fishfolk:main Apr 14, 2024
10 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants