Commit Graph

19 Commits

Author SHA1 Message Date
Tom Pratt
1d1c9696ae lint formatting 2026-05-19 12:03:02 +02:00
Tom Pratt
4d1e749977 WithSession helper function
Handles the repeated boiler plate of using a weak reference to NetplaySession from NetplayUICallbacks
2026-05-19 12:03:02 +02:00
Tom Pratt
1bc64a0e6e Fix netplay license headers 2026-05-19 12:03:01 +02:00
Tom Pratt
86de5ef4b0 Handle traversal state changes and errors
Traversal connections show in the joining info UI.
Non fatal errors show the retry button.
Fatal errors end the netplay session.
2026-05-19 12:03:00 +02:00
Tom Pratt
77f08364db Create NetPlayServer and start game 2026-05-19 12:02:59 +02:00
Tom Pratt
f9baecd5ed Implement OnMsgPowerButton 2026-05-19 12:02:59 +02:00
Tom Pratt
acbf9e155f Game digest progress dialog
We just about get away with using a StateFlow in NetplaySession since the host sends AbortGameDigest when closing their own dialog. Without that it would be harder for the UI to distinguish between subsequent dialogs. If that wasn't the case then NetplaySession might need to expose the individual progress and result updates and have the view model assemble it into the overall GameDigestProgress.
2026-05-19 12:02:58 +02:00
Tom Pratt
117d1d71ac Handle desync messages
Show them in the chat window and also in a toast during game play.
2026-05-19 12:02:58 +02:00
Tom Pratt
abd324e98d Make NetplaySession not a singleton
Create a new NetplaySession each time we try to join a netplay game. Hold onto it in NetplayManager so its available to the different activities that need to access it. Close the session when backing out of the netplay UI. Some guardrails in case things go out of sync: creating a session closes the old one if it is still around for some reason, finalizer in NetplaySession to release native resources if not closed explicitly for some reason. Profiling done to ensure all kotlin and native objects are successfully cleared / garbage collected.
2026-05-19 12:02:58 +02:00
Tom Pratt
8141a74671 Show save transfer progress
When transferring saves from the host. Equivalent of ChunkedProgressDialog in QT.
2026-05-19 12:02:57 +02:00
Tom Pratt
b1b133b036 Implement OnConnectionLost, show a dialog on the main netplay screen forcing the user to exit 2026-05-19 12:02:56 +02:00
Tom Pratt
38b5c7370c Implement StopGame callback and use it to finish the emulation activity 2026-05-19 12:02:56 +02:00
Tom Pratt
65e4c60158 Max buffer 2026-05-19 12:02:56 +02:00
Tom Pratt
c32732714e Implement more NetPlayUICallbacks
Includes chat, game changes, pad buffer changes and host input authority. Merges them all into the chat window.
2026-05-19 12:02:55 +02:00
Tom Pratt
d9e2725e85 Implement player list 2026-05-19 12:02:55 +02:00
Tom Pratt
f52ca02ca2 Show client connection errors and handle connection result
If result is a success sent event to launch the next netplay screen. if it fails, clear up the netplay client
2026-05-19 12:02:54 +02:00
Tom Pratt
3ed9174208 Store netplay BootSessionData and use it to run the netplay game 2026-05-19 12:02:54 +02:00
Tom Pratt
766374434c Pass game list to NetPlayUICallbacks and implement OnMsgChangeGame, OnMsgStartGame, FindGameFile 2026-05-19 12:02:54 +02:00
Tom Pratt
1464fdfc28 Add NetPlayClient join and stub NetPlayUICallbacks 2026-05-19 12:02:54 +02:00