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.
Pull Request Template
Description
This PR brings in the functionality for the Game State Channel websocket to begin a Game when enough Players subscribe, and then relay this Game State to all subscribed Players. To facilitate a quick refactor, the number of Players in a Game has been bumped from 2 to 4, and one of the
join_game
endpoints has been skipped.The output of the
game-started
message is exactly the same as thegame_state
endpoint output, allowing the Frontend to render React accordingly from the Waiting screen to the Game Board screen. It also will not require major refactoring of the processing oftableDeck
and other information.The Game State Channel now will use the private
begin_game?
method every time a Player subscribes to check if the Game has enough Players. If not, it will move on, otherwise, it willgame.start
and then send thegame-started
message containing the full Game State.For some undetermined reason, the
action-cable-testing
gem does not play well with FactoryBot, so ourcreate_cards
method in the GameStateChannel spec is handling that functionality currently.Resolves #107
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
game-started
broadcast specrejects connections if more than max players join
join_game
endpoint specChecklist: