uchicago-cs / chigame

BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Integration of Placeholder Game + Match Start Conditions Implemented #345

Closed nugerhard closed 11 months ago

nugerhard commented 11 months ago

This is a 2 (probably 3) issue pr: Essentially, what I've done is I have made the placeholder game accessible from any particular lobby page. But, it only becomes accessible once the lobby conditions have been met. To this end, I've integrated a timer related to the lobby model onto the lobby detail page using an AJAX function: once this timer has expired, and sufficient users are in the lobby, the lobby allows the user to play the game. More notes to come, likely on the relevant issues.

nugerhard commented 11 months ago

Apologies, added some small last-minute stuff: when the timer ran out, page did not reflect changes until it was reloaded. So, when the update function is now called, the page is refreshed. Also, did a bit of shuffling of the html on the lobby details page to make it look nicer.

nugerhard commented 11 months ago

Closing Statement: This PR was definitely down to the wire, apologies. But the placeholder game and the lobby_details page are now connected. And, the timer is as robust as it can be (so long as it can only exist on one page, say lobby_details).

Here's a bit more color on the sqlite issue, from a conversation on Slack between me, Elizabeth, and Chloe: The database can't calculate the values independently. So, the script at the bottom of our lobbies page has to run in order for the match_status to update. I figured, rather than adding a script at the bottom of the lobby list page which runs a timer check for each of the lobbies on the page (and reloads the when any one runs out), it would be better to have the non-updated lobby status displayed on the page.

elizabethli31 commented 10 months ago

Issue Score: Excellent

Comments: Very large PR that provided much more functionality to matches - great work!