From 6baaa14bde032afa363dbdd50119a20e9f47df1c Mon Sep 17 00:00:00 2001 From: Maks Jopek Date: Mon, 26 Apr 2021 14:43:25 +0200 Subject: Bugfixes: to home, [40] -> [1], not destroying old chequer --- backend/ts/api/login.ts | 2 +- backend/ts/api/saveGameBoard.ts | 2 +- backend/ts/gameBoard.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'backend/ts') diff --git a/backend/ts/api/login.ts b/backend/ts/api/login.ts index b21a506..4b5ff87 100644 --- a/backend/ts/api/login.ts +++ b/backend/ts/api/login.ts @@ -27,7 +27,7 @@ export default async function apiLogin(req: Request, res: Response) { id: req.session.uid, index: 0, ready: false, - color: color, + color: Color.red, name: req.body.name, }]; req.session.color = color; diff --git a/backend/ts/api/saveGameBoard.ts b/backend/ts/api/saveGameBoard.ts index da31bdf..df2b7a0 100644 --- a/backend/ts/api/saveGameBoard.ts +++ b/backend/ts/api/saveGameBoard.ts @@ -7,7 +7,7 @@ export default async function saveGameBoard(req: Request, res: Response) { res.send(API_RES.failure); return; } - + console.log("saving gameBoard"); let query = "UPDATE `fia` SET `currentPlayer` = IF(`currentPlayer` + 1 = `playersCount`, 0, `currentPlayer` + 1), " + "`gameBoard` = ?, `timeTillTurnEnd` = ? WHERE `id` = ?" await makeQuery(query, [req.body.gameBoard, nextTurnEndsAt(), req.session.gid]); diff --git a/backend/ts/gameBoard.ts b/backend/ts/gameBoard.ts index 314c874..0edbae1 100644 --- a/backend/ts/gameBoard.ts +++ b/backend/ts/gameBoard.ts @@ -71,25 +71,25 @@ export const gameBoard: GameBoard = { }, // @ts-ignore homes: { - [Color.red]: [ + [Color.blue]: [ { x: 5, y: 1, chequer: -1 }, { x: 5, y: 2, chequer: -1 }, { x: 5, y: 3, chequer: -1 }, { x: 5, y: 4, chequer: -1 }, ], - [Color.blue]: [ + [Color.red]: [ { x: 1, y: 5, chequer: -1 }, { x: 2, y: 5, chequer: -1 }, { x: 3, y: 5, chequer: -1 }, { x: 4, y: 5, chequer: -1 }, ], - [Color.green]: [ + [Color.yellow]: [ { x: 5, y: 9, chequer: -1 }, { x: 5, y: 8, chequer: -1 }, { x: 5, y: 7, chequer: -1 }, { x: 5, y: 6, chequer: -1 }, ], - [Color.yellow]: [ + [Color.green]: [ { x: 9, y: 5, chequer: -1 }, { x: 8, y: 5, chequer: -1 }, { x: 7, y: 5, chequer: -1 }, -- cgit v1.3.1