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

Issue 25: Game Integration #43

Merged
merged 86 commits into from
Jul 24, 2020
Merged

Issue 25: Game Integration #43

merged 86 commits into from
Jul 24, 2020

Conversation

darrenMabbayad
Copy link
Collaborator

#25, #12, #29, #35, #36

This PR addresses several issues

Game Integration

  • all game events handled through socket events in GameplayContext,js and /server/sockets.js
  • game flow is as follows:
    start game
    send clues
    change game phase to guessing phase
    send guess
    check answer and clues, distribute points, move to next round
    when 4 rounds have passed, game ends
    save game data to mongoDB when host leaves

Match Management/Socket IO

  • all matches are handled with MatchManager.js, /server/sockets.js, Game.js, GameContext.js, GamePlayContext.js
  • create match sends request to /game/create, creates match in MongoDB, adds user to player list and tags the creator as host
  • join match sends request to /game/:gameId/join, adds player with Joined status in MongoDB, adds user to player list
  • important data concerning a Match instance is handled in memory (player points, who the guesser is, current round, clues submitted, typing status, etc.)

Socket IO security

  • added socket.io middleware for authentication io.use()
  • verify JWT on initial socket connection (using jsonwebtoken library)
  • if authentication error or user is unauthorized, remove local storage user, set auth to false, return to login

Game Audio

  • use HowlerJS library to generate sound effects on certain game events
  • static game audio files are in /client/src/game-audio
  • audio is emitted to every user on sockets events: 'FE-send-clue' and 'FE-send-answer'

Responsive Design

  • routes for /create-game and /lobby are now suitable for mobile

Hyunse and others added 30 commits July 14, 2020 16:26
darrenMabbayad and others added 25 commits July 22, 2020 13:35
display '- guesser' next to guesser's name, fixed bug where the user isn't redirected to the lobby if the error message is still there
@darrenMabbayad darrenMabbayad merged commit df7c554 into dev Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants