From c3949cbdc067dbafa94cde6b6cf4dfebc2cfb2b8 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Mon, 22 Mar 2021 21:40:07 +0100 Subject: [PATCH] Better DB sync scripts (vchess --> tournament) --- TODO | 4 ++++ client/src/translations/rules/Synochess/en.pug | 12 ++++++------ client/src/translations/rules/Synochess/es.pug | 10 +++++----- client/src/translations/rules/Synochess/fr.pug | 10 +++++----- server/routes/users.js | 3 ++- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/TODO b/TODO index 10788bd0..1ab50465 100644 --- a/TODO +++ b/TODO @@ -5,3 +5,7 @@ If new live game starts in background, "new game" notify OK but not first move. "FreeBoard", re-using a lot of Board logic, but with SVG (empty) board + SVG (empty) reserves. Will be used for variants with custom non-rectangular board (Hex, at least) Or, with other board shapes (see greenchess.net for example) + +Would be nice to display some better variants names (Pacosako -> Paco-Ŝako etc), +but the "formatted" name with uppercase + all lower cases would still be required. +(For example in variants list, or tournament variant field). diff --git a/client/src/translations/rules/Synochess/en.pug b/client/src/translations/rules/Synochess/en.pug index 5350d690..f078aa9f 100644 --- a/client/src/translations/rules/Synochess/en.pug +++ b/client/src/translations/rules/Synochess/en.pug @@ -29,16 +29,16 @@ h3 Special Rules ul li. - King Faceoff — As in Xiangqi, Kings may not face each other + King Faceoff – As in Xiangqi, Kings may not face each other (on a file or rank). li. - Reinforcement Soldiers — Black starts with two soldiers in hand. + Reinforcement Soldiers – Black starts with two soldiers in hand. Instead of moving a piece on the board, the Dynasty player can drop a soldier onto an open square in rank 5. - li Campmate — A king that reaches the final rank wins the game. + li Campmate – A king that reaches the final rank wins the game. li. - Stalemate — As in Xiangqi, stalemates - and moves repetitions are a loss. + Stalemate – As in Xiangqi, stalemate + and moves repetition are a loss. h3 Dynasty Pieces @@ -47,7 +47,7 @@ p. hand), 2 Cannons, 2 Elephants, and 1 Advisor. p. The Chariots are equal to the Rooks and use the same abbreviation (R) - — the difference is purely cosmetic. Similarly, the Kings are the + – the difference is purely cosmetic. Similarly, the Kings are the same, but just appear different. ul diff --git a/client/src/translations/rules/Synochess/es.pug b/client/src/translations/rules/Synochess/es.pug index 1f2bdf0b..bcd49549 100644 --- a/client/src/translations/rules/Synochess/es.pug +++ b/client/src/translations/rules/Synochess/es.pug @@ -29,17 +29,17 @@ h3 Reglas especiales ul li. - Rey opuestos — Como en Xiangqi, los reyes no pueden ser + Rey opuestos – Como en Xiangqi, los reyes no pueden ser cara a cara (en una columna o fila). li. - Soldados de refuerzo — Las negras comienzan con dos soldados en la + Soldados de refuerzo – Las negras comienzan con dos soldados en la mano. En lugar de jugar un movimiento, pueden dejar caer a un soldado en una casilla libre de la quinta fila. li. - "Mate de campo" — Si el rey llega a la última fila, entonces + "Mate de campo" – Si el rey llega a la última fila, entonces el juego está ganado. li. - Empate — Como en Xiangqi, + Empate – Como en Xiangqi, el empate y la repetición de jugadas pierden. h3 Piezas de la dinastía @@ -48,7 +48,7 @@ p. Cuatro piezas nuevas del lado de la Dinastía: 6 Soldados (2 serán en paracaídas), 2 Cañones, 2 Elefantes y 1 Asesor. p. - Los Carros equivalen a torres y utilizan la misma abreviatura — + Los Carros equivalen a torres y utilizan la misma abreviatura – la diferencia es puramente cosmética. Asimismo, los Reyes son iguales piezas dibujadas de manera diferente. diff --git a/client/src/translations/rules/Synochess/fr.pug b/client/src/translations/rules/Synochess/fr.pug index 7d5692db..d559ec68 100644 --- a/client/src/translations/rules/Synochess/fr.pug +++ b/client/src/translations/rules/Synochess/fr.pug @@ -29,16 +29,16 @@ h3 Règles spéciales ul li. - Roi en vis-à-vis — Comme au Xiangqi, les Rois ne peuvent pas se + Roi en vis-à-vis – Comme au Xiangqi, les Rois ne peuvent pas se faire face (sur une colonne ou rangée). li. - Soldats en renfort — Les noirs démarrent avec deux soldats en main. + Soldats en renfort – Les noirs démarrent avec deux soldats en main. Au lieu de jouer un coup, ils peuvent parachuter un soldat sur une case libre de la 5eme rangée. li. - "Mat de camp" — Si le roi atteint la dernière rangée, alors + "Mat de camp" – Si le roi atteint la dernière rangée, alors la partie est gagnée. - li Pat — Comme au Xiangqi, le pat et la répétition de coups perdent. + li Pat – Comme au Xiangqi, le pat et la répétition de coups perdent. h3 Pièces de la Dynastie @@ -46,7 +46,7 @@ p. Quatre nouvelles pièces du côté de la Dynastie : 6 Soldats (2 seront parachutés), 2 Canons, 2 Éléphants, et 1 Conseiller. p. - Les Chariots sont égaux aux tours, et utilisent la même abréviation — + Les Chariots sont égaux aux tours, et utilisent la même abréviation – la différence est purement cosmétique. De même, les Rois sont les mêmes pièces dessinées différemment. diff --git a/server/routes/users.js b/server/routes/users.js index f1554ef7..b14defbc 100644 --- a/server/routes/users.js +++ b/server/routes/users.js @@ -51,7 +51,7 @@ router.post('/register', access.unlogged, access.ajax, (req,res) => { }; setAndSendLoginToken("Welcome to " + params.siteURL, user); // Update tournament DB (TODO: if error, log it) - exec(params.tourneyPath + "/dbsync/update_users.py"); + exec(params.tourneyPath + "/dbsync/insert_user.py " + ret.id); res.json({}); } }); @@ -105,6 +105,7 @@ router.put('/update', access.logged, access.ajax, (req,res) => { notify: !!req.body.notify, }; UserModel.updateSettings(user); + exec(params.tourneyPath + "/dbsync/update_user.py " + ret.id); res.json({}); } }); -- 2.44.0