ggneilc / poker-sim

web browser based card games prioritizing a truly random experience
0 stars 0 forks source link

Setup Django models & Database #1

Open ggneilc opened 2 months ago

ggneilc commented 2 months ago

Django uses sqlite by default -> do we want to use that or smth else?

Once that is resolved, we can actually make our objects as models in the database and start working on game rooms & players.

ggneilc commented 2 weeks ago

sqlite is probably fine for now until we want to upgrade to something more powerful but it shouldn't really alter anything about the django code.

Models for Room & Player are created.

Edge cases need to be ironed out before we can package it and let us run off with creating each specific game logic:

ggneilc commented 2 weeks ago

Current Task: Create 'core' application that has Players and Rooms Implement and extend each of these core models into respective game apps.

Current Task 2: Add more functionality to main project page -> User authentication.

Have user able to start a room or join others

ggneilc commented 2 weeks ago

User authentication is implemented but is not being utilized across games. The current task is to allow these users to create rooms and have the respective games implement the generic Player and Room to be blackjackplayer and blackjackroom.

I think this entails that I also need the basic method of create_room display_room and join_room to be in core, along with the user profile stuff, because from there it can be fully independent of what the specific games needs are -- they would just slighty override the methods by having for example display_room instead of doing a generic view would instead be the blackjack table

ggneilc commented 1 week ago

tweak rooms to adhere to the new flow:

ggneilc commented 1 week ago

Only accounts can create games, this ties the host to that room, can continually join that same room every time they press the homescreen buttons to prevent spam creation of rooms. User has to manually leave the room or delete it to create a new one.

Guests are people who just join the room directly from the link, this causes user creation to be handled in displayRoom and then that object gets destoryed after 1 hour of inactivity.

ggneilc commented 3 days ago

Our models are now completely setup, leveraging django's builtin User model for account creation & authentication and some custom built models:

Django's User model contains:

We then define a Core Application that handles the base of our website, and the actual Player and Room object for dealing with accounts: Player:

Room:

We then have a basic PokerPlayer and BlackjackPlayer and their respective PokerRoom & BlackjackRoom: a xxxPlayer:

Each xxxRoom contains specific information about the dealer (if applicable) and the list of players in the room.

ggneilc commented 3 days ago

image