diff --git a/backend_protocol_specification.md b/backend_protocol_specification.md index 1516eb1..a008bc9 100644 --- a/backend_protocol_specification.md +++ b/backend_protocol_specification.md @@ -33,16 +33,7 @@ of the request, and the backend will respond with JSON. } ``` -4. Request Whose Turn - -``` - { - "id": "id given by backend", - "type": "whose_turn", - } -``` - -5. Disconnect +4. Disconnect ``` { @@ -51,16 +42,7 @@ of the request, and the backend will respond with JSON. } ``` -6. Request Board State: - -``` - { - "id": "id given by backend", - "type": "request_board_state", - } -``` - -7. Request Game State: +5. Request Game State: ``` { @@ -127,17 +109,7 @@ then the back-end will respond with "too\_many\_players". } ``` -4. Request Whose Turn Response - -``` - { - "type": "whose_turn", - "status": "cyan", // or "magenta", "not_paired_yet", "unknown_id", - // "game_ended" - } -``` - -5. Disconnect Response +4. Disconnect Response ``` { @@ -146,81 +118,30 @@ then the back-end will respond with "too\_many\_players". } ``` -6. Request Board State Response - -``` - { - "type": "board_state", - "status": "in_progress", // or "game_ended" - "board": [ - "e", - "e", - ... // 56 entries in the array where the index of the array - // correspond to position on the board (0-55). Each entry is - // either: "e", "c", or "m". - // "e" -> empty - // "c" -> cyan - // "m" -> magenta - ], - } -``` - -``` - { - "type": "board_state", - "status": "unknown_id", // or "not_paired" - } -``` - -7. Request Game State Response +5. Request Game State Response ``` { "type": "game_state", - "status": "not_paired", // or "in_progress", "unknown_id" + "status": "not_paired", // or "unknown_id", "cyan_turn", "magenta_turn", + // "cyan_won", "magenta_won", "draw", + // "opponent_disconnected" + + // "board" may not be in the response if "unknown_id" is the status + "board": "abcdefg..." // 56-char long string with mapping: + // a - empty + // b - cyan + // c - magenta + // d - cyan placed + // e - magenta placed + // f - cyan winning piece + // g - magenta winning piece } ``` Note that the backend will stop keeping track of the game once both players have successfully requested the Game State once after the game has ended. Thus, future requests may return "unknown\_id" as the "status". -``` - { - "type": "game_state", - "status": "cyan_won", // or "magenta_won", or "draw" - } -``` Note that if a player has disconnected, the other player will receive a "status" of "opponent\_disconnected". Future requests will return "unknown\_id". -``` - { - "type": "game_state", - "status": "opponent_disconnected", // or "unknown_id" - } -``` - -8. Failure Response - -When request "type" is not handled by the back-end, it returns with -"invalid\_type". -``` - { - "type": "invalid_type" - } -``` - -When JSON is missing a required value, it returns with "invalid\_json". -``` - { - "type": "invalid_json" - } -``` - -When the back-end hasn't yet implemented handling a specific type, it returns -"unimplemented". -``` - { - "type": "unimplemented" - } -``` diff --git a/spreadsheets/sprint_backlog_sprint_03.fods b/spreadsheets/sprint_backlog_sprint_03.fods index 65cf184..8ee78cc 100644 --- a/spreadsheets/sprint_backlog_sprint_03.fods +++ b/spreadsheets/sprint_backlog_sprint_03.fods @@ -1,7 +1,7 @@ - 2022-03-13T22:06:16.7075118622022-03-17T12:07:23.743380984PT18M26S6LibreOffice/7.3.1.3$Linux_X86_64 LibreOffice_project/30$Build-3 + 2022-03-13T22:06:16.7075118622022-03-18T14:57:51.467986156PT20M1S8LibreOffice/7.3.1.3$Linux_X86_64 LibreOffice_project/30$Build-3 0 @@ -13,8 +13,8 @@ view1 - 0 - 6 + 6 + 0 2 0 3 @@ -63,6 +63,15 @@ false true false + + + en + US + + + + + 12632256 true true @@ -75,7 +84,7 @@ false Generic Printer false - pAH+/0dlbmVyaWMgUHJpbnRlcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU0dFTlBSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAMAxQAAAAAAAAAIAFZUAAAkbQAASm9iRGF0YSAxCnByaW50ZXI9R2VuZXJpYyBQcmludGVyCm9yaWVudGF0aW9uPVBvcnRyYWl0CmNvcGllcz0xCmNvbGxhdGU9ZmFsc2UKbWFyZ2luYWRqdXN0bWVudD0wLDAsMCwwCmNvbG9yZGVwdGg9MjQKcHNsZXZlbD0wCnBkZmRldmljZT0xCmNvbG9yZGV2aWNlPTAKUFBEQ29udGV4dERhdGEKRHVwbGV4Ok5vbmUAUGFnZVNpemU6TGV0dGVyAAASAENPTVBBVF9EVVBMRVhfTU9ERQ8ARHVwbGV4TW9kZTo6T2Zm + pAH+/0dlbmVyaWMgUHJpbnRlcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU0dFTlBSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAMAxQAAAAAAAAAIAFZUAAAkbQAASm9iRGF0YSAxCnByaW50ZXI9R2VuZXJpYyBQcmludGVyCm9yaWVudGF0aW9uPVBvcnRyYWl0CmNvcGllcz0xCmNvbGxhdGU9ZmFsc2UKbWFyZ2luYWRqdXN0bWVudD0wLDAsMCwwCmNvbG9yZGVwdGg9MjQKcHNsZXZlbD0wCnBkZmRldmljZT0xCmNvbG9yZGV2aWNlPTAKUFBEQ29udGV4dERhdGEKUGFnZVNpemU6TGV0dGVyAER1cGxleDpOb25lAAASAENPTVBBVF9EVVBMRVhfTU9ERQ8ARHVwbGV4TW9kZTo6T2Zm false 1270 1270 @@ -247,16 +256,21 @@ - + - + + + + + + @@ -315,7 +329,7 @@ ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 @@ -354,6 +368,10 @@ Wednesday + + 2022-03-18T00:00:00 + No work was done on this day, but work on Scrum management. + Thursday @@ -381,10 +399,10 @@ Pending - + 3 - + @@ -405,21 +423,21 @@ 5 - + 2022-03-14T00:00:00 Initial “draft” of protocol created. Subject to future changes when back-end is implemented, which is why 1 hour is remaining for this task. 1 - + 1 - + - + 2022-03-15T00:00:00 To figure out how to update the front-end asynchronously (for when making http requests to backend), an AI-take-turn-delay was implemented using async and javascript. @@ -440,7 +458,7 @@ - + 2022-03-17T00:00:00 Added task since implementing the back-end wasn’t specified at the start of the sprint. @@ -453,10 +471,10 @@ 4 - + 2 - + @@ -466,10 +484,10 @@ Pending - + 5 - + @@ -486,10 +504,10 @@ Pending - + 4 - + @@ -506,10 +524,10 @@ Pending - + 2 - + @@ -526,10 +544,10 @@ Pending - + 2 - + @@ -546,10 +564,10 @@ 24 - + 28 - + @@ -569,7 +587,10 @@ 19 - + + 19 + + @@ -589,7 +610,10 @@ 9 - + + 9 + +