uchicago-cs/chigame

Add functionality to trigger the start of a match once conditions are met for a lobby

jiyeongchloe opened this issue · 6 comments

Goal: To have a transition from the lobby page to the match page, we can either start a match automatically once the timer runs out (given the lobby has the minimum number of people), start a match automatically once the lobby reaches the maximum number of people, or give users to a button to start a match once the lobby has the minimum number of people. We want to implement functions that allow us to automatically redirect players when a condition is reached and enable a was-greyed-out "Start" button when a condition is reached.

UPDATE: split from issue #122.

discussed during weekly team meeting: the match_status attribute will be updated when a function for joining a match is accessed

This issue was expanded into all functionality concerning what is displayed at the bottom of the lobby details page.

  • If Lobby.match_status is Lobbied (i.e., match hasn't started yet): a user can join a lobby if they haven't already, or leave a lobby if they have. The user who created the lobby can also delete a lobby.
  • If Lobby.match is In-Progress: a user sees a message that the match is in progress.
  • If Lobby.match is Closed (i.e. the match has either completed, or start conditions were not met by the lobby): a user sees a message that the match is closed.

See pr #345. In particular, lobby_details.html.

Closing Comment: Instead of showing functionality on through accessible or inaccessible buttons, we simply have the buttons which a user may use at any point appear, depending on match_status.

Nat: Implemented this switch statement in lobby_details, created the join game button.
Chloe: Outlined which buttons will be available, according to match_status.
Lucien: Implemented the join and leave lobby buttons in the case where the lobby is still open.

Issue Score: Excellent

Comments:
Well implemented functionality and descriptive updates!