Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(player_select): Fix Online game able to start without all playes …
…ready (#1040) Fixes #1036 and couple other things along the way Not entirely sure what caused this - but I think I introduced it when updating for new matchmaker interface in bones. We would allow online matches to continue if >1 players are ready and no unconfirmed players. The issue is that in online remote players who had not made a selection were in `Empty` state, and not tracked as unconfirmed. Now for any local + required players, I initialize them to new PlayerSlot type `SelectingLocalControlSource`. `Empty` may be used for online slots that are unused (the last 2 slots in a 2 player game) in online, or for lan, optional slots that may be joined by additional players/AI, but are not required. And remote required players are set to `SelectingPlayer` with default fish + no hat - as next message expected from them is change in player, and they don't need to select control source, we know they are remote. This seems to have fixed the match starting without all players ready, as all required players are initialized to something other than `Empty`. ### Other fixes / changes #### Remembering Hats: I noticed that if you select a hat and then deselect it going back to fish select - the other online players would still see this hat, but local player resets to None. If player selected hat, went back to fish select, then readied up with no hat, the remote players would see hat, but not the local player. This could cause desync. Now When you go back to fish select, your hat is remembered. #### Always display default fish: We were no longer displaying default fish in online when player had not yet selected a control source/fish. Now regardless of if have actually selected a fish, the default fish + no hat is shown (If the slot is a required player that we are sure will select one eventually / must ready up). In local for unjoined slots, no default fish is shown until joined or AI is set. #### Show when remote players ready In online when a remote player is ready, this is now displayed. @nelson137 feel free to review (if you want) as I know you were just in here. Player select sure is complicated lol, but feeling good about the changes I think we're making it more manageable 😅
- Loading branch information