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

Enhancement: Player team and role selection #51

Draft
wants to merge 60 commits into
base: dev
Choose a base branch
from

Conversation

whois-jon-peterson
Copy link
Member

@whois-jon-peterson whois-jon-peterson commented Aug 12, 2019

Description

Closes #44

Adds server-side websockets interface to support players selecting teams and roles while waiting on the Lobby screen. As part of this change, the server will no longer immediately initialize the game as soon as the last player subscribes to the channel. Instead, the UI will need to send a start-game message as defined in the README.

Adds support for the following websocket actions (to be added to createCable() in App/index.js:

selectTeam: team => this.cable.perform('select_team', team),
selectRole: role => this.cable.perform('select_role', role),
startGame: () => this.cable.perform('start_game')

These are documented in the README with the expected team/role objects.

Adds player role and team to the player-joined broadcast, and adds a new player-update broadcast which is sent after processing a player's team or role selection. These properties (isBlueTeam and isIntel) can be null if the player has not selected their role/team yet, or boolean to indicate the appropriate role/team.

Adds a category property to the illegal-action message. The keywords "personal", "public", and "info" have been reserved for use.

  • "personal" indicates a warning that should only be displayed to the player who caused it (optionally, may be written to the console with console.warn() for other players)
  • "public" indicates a warning that should be displayed to all players
  • "info" indicates a warning that should only be logged to the console with console.warn()
    At this time, all illegal-actions just use the "personal" category.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other, Please explain:

Has This Been Tested?

  • No
  • Yes
    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:
    Extensive testing to cover a variety of situations. See player_selections_spec.rb
  • Have any prior tests been changed?
    If so, please explain:
    Backfilled missing tests for earlier untested changes.
    Adjusted tests that assumed game would automatically be established after last player subscribes. Affected tests now manually establish the game after all players are in.

Additional notes:

NA

Checklist:

  • My code has no unused/commented out code
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas

@whois-jon-peterson whois-jon-peterson added enhancement New feature or request Server Issues and PRs relating to the server application labels Aug 12, 2019
@whois-jon-peterson whois-jon-peterson self-assigned this Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Server Issues and PRs relating to the server application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Players can select teams & roles
1 participant