Commit graph

22 commits

Author SHA1 Message Date
Stephen Seo b2ea79a7f7 Impl conditionally update front-end board
When the front-end polls the back-end for the game-state, the back-end includes
a "date_updated" String in the JSON. If the String is the same as in the
front-end, then no updates are needed, but if they are not the same, then the
front-end will update the board. Because the front-end polls the back-end's
board state approximately every second, this should make the front-end more
efficient.
2022-04-30 16:44:48 +09:00
Stephen Seo 105cd880f2 Impl sending/receiving emotes 2022-04-29 18:30:41 +09:00
Stephen Seo 36dd43bb70 Fixes related to new send emote functionality 2022-04-29 17:24:42 +09:00
Stephen Seo 5381578b08 Update specs, impl back-end support for send emote 2022-04-29 17:16:32 +09:00
Stephen Seo dcc9400483 back-end: Minor fix related to phrase handling
Fixes passing an empty string to the db in (probably) rare cases.
2022-04-27 14:16:34 +09:00
Stephen Seo 665dff94fe back-end: Enforce max-length of user-input phrase 2022-04-27 14:11:02 +09:00
Stephen Seo 059d0608b6 Impl match players via phrase
Front-end now has option to input phrase on game start.
Fixed back-end accepting empty strings (will treat empty strings as if
no phrase was given).
2022-04-27 12:47:45 +09:00
Stephen Seo f9338d4093 back-end: Impl "phrase", update protocol 2022-04-27 11:42:28 +09:00
Stephen Seo c9ba80e6a4 Impl "too_many_players" response from back-end
Previous implementation did not respond with the proper JSON response if
there were too many players.
2022-04-08 11:01:33 +09:00
Stephen Seo 74ca3fd696 Add GPL3 Licence headers to sources 2022-04-06 20:49:54 +09:00
Stephen Seo 89b9bf860b Working multiplayer between frontend backend
WIP Need to set the URL and host the backend on the website.
2022-04-06 18:43:17 +09:00
Stephen Seo 0d9e35dd28 Refactorings and bug fixes
Protocol was also updated to match the output from the backend.
Fixed "id" not returning as an integer from the backend.
2022-04-01 17:17:42 +09:00
Stephen Seo dbb1c3ad35 backend: Impl "place_token" protocol
Some edge-cases might not be addressed.

Need to impl. "timers" for clearing out stale entries in the database.
2022-03-31 20:38:22 +09:00
Stephen Seo 473e76a1bc Impl disconnect protocol (and related changes)
Players can now make a "disconnect" request, and requests for
"game_state" will respond once that an opponent has disconnected before
removing the game from the DB.
2022-03-31 17:38:03 +09:00
Stephen Seo fbf47027ef backend: refactorings, impl "board_state" query
Implemented the fifth backend protocol request/response ("board_state").
Some refactorings involve improving readability from handling unwrapping Option
of &Connection objects.
2022-03-30 20:44:18 +09:00
Stephen Seo fe56adf562 backend: Impl second backend protocol query 2022-03-29 17:02:57 +09:00
Stephen Seo 40b2333767 Refactor db_handler to use struct to split up code
Also refactored the GetID send value type.
2022-03-29 15:03:08 +09:00
Stephen Seo fcd20af9bd backend: Use enum to handle multiple db requests 2022-03-28 16:31:53 +09:00
Stephen Seo 6c47ce948b Impl graceful shutdown of backend on failure 2022-03-18 23:43:15 +09:00
Stephen Seo 5a0c0696d1 Impl enough backend to assign ids to players 2022-03-18 19:29:38 +09:00
Stephen Seo 97ca4adecc Refactorings/fixes for back-end 2022-03-16 12:31:18 +09:00
Stephen Seo 7c4d38549f Update backend protocol, skeleton backend project 2022-03-16 12:26:18 +09:00