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

Game model for the host/join screen and as a base model for the beginning of the game #27

Closed
ppeters0502 opened this issue Nov 30, 2021 · 5 comments · Fixed by #29
Closed
Assignees
Milestone

Comments

@ppeters0502
Copy link
Contributor

This model may change as we progress through milestone 2, but so far here's what I'm thinking as far as properties for the model:

  • Game_Id (integer) - unique identifier that will be used when joining a game, or when accumulating points)
  • Host_Id (integer) - foreign key that's tied to the user who is hosting the game)
  • Is_Public - (boolean) - Flag that's 0 for public and 1 for private
  • Join_Code (string/chars) - secret that is used for private games (can be empty for public games)

As we progress in the rules engine, we can extend this model and the corresponding database tables with many to one relationships and many to many relationships, but the base of this goes back to the game model in python and game table in the SQLite db

@ppeters0502 ppeters0502 added this to the build models milestone Nov 30, 2021
@ppeters0502 ppeters0502 changed the title We need a game model for the host/join screen and as a base model for the beginning of the game Game model for the host/join screen and as a base model for the beginning of the game Nov 30, 2021
@ppeters0502 ppeters0502 self-assigned this Nov 30, 2021
@ppeters0502
Copy link
Contributor Author

ppeters0502 commented Nov 30, 2021

When I was first thinking about this, I was thinking the Game_Id could just be the auto-incrementing Id that Django automatically creates in the table. This could possibly open up a user just spamming a bunch of join numbers until they join a game though, so I think maybe the game_id could actually be still a unique identifier, but maybe like a random string of characters or something. Then any relationships or foreign keys that tie back to the specific game could reference the auto-incrementing Id, but everything that's handled on the front end is the Game_Id.

@abullockuno
Copy link
Collaborator

abullockuno commented Nov 30, 2021

If we are showing all games on the join game screen, then Game_Id can be one up. Adding new field

  • Game_Id won't control joining a game, just a unique ID, not visible
  • Host_Id another unique ID foreign key - used for join game page ID
  • Is_Public - (isn't true 1? If so 1 = Public 0 = Private) will control whether a game needs a join code or not. Join code can still be generated regardless
  • Join_Code - 12 or 16 hex or integer secure random generated at game creation
  • Is_Full/Is_Closed - once a game is started, no new entries allowed, true = hidden from join page

@ppeters0502
Copy link
Contributor Author

Ah crud, I get that mixed around with booleans all the time, my bad!
I'll be sure to add the Is_Full/Is_Closed flag on the model, I should have the PR for review later tonight!

@abullockuno
Copy link
Collaborator

abullockuno commented Nov 30, 2021

game_id also 12hex or 16integer generated at game creation no longer primary id
primary id = 1 up thingy

@ppeters0502
Copy link
Contributor Author

After talking on zoom, here's what we figured out:

  • After game concludes, popup appears that displays final scores, and has a "return to host/join page" button. Once everyone leaves the game, the game is deleted from the db, along with any constrained rows like scores, hands, etc.
  • Andrew is handling rules engine (tallying points when dice are rolled, returning which hands have already been locked into play, etc)
  • Pat is currently handling the host/join screen and the realtime updating of available games that a player can join
  • Pat's handling the AWS side of CD/CI (getting EC2 instance up and running, linking to accessible domain)
  • Andrew's handling setting up Unit Tests to connect to Github actions to drive CI portion of CD/CI.

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 a pull request may close this issue.

2 participants