-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(networking): Support restarting network session (#384)
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.
- Loading branch information
1 parent
8be1965
commit b7f59fc
Showing
4 changed files
with
146 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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