aboutsummaryrefslogtreecommitdiffstats
path: root/backend/ts
diff options
context:
space:
mode:
Diffstat (limited to 'backend/ts')
-rw-r--r--backend/ts/api/login.ts2
-rw-r--r--backend/ts/api/saveGameBoard.ts2
-rw-r--r--backend/ts/gameBoard.ts8
3 files changed, 6 insertions, 6 deletions
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 },