projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5aa14a2
)
Fix clocks update + abort games from MyGames page
author
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 7 Mar 2020 20:00:52 +0000
(21:00 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 7 Mar 2020 20:00:52 +0000
(21:00 +0100)
client/src/components/GameList.vue
patch
|
blob
|
blame
|
history
client/src/translations/rules/Suction/en.pug
patch
|
blob
|
blame
|
history
client/src/translations/rules/Suction/es.pug
patch
|
blob
|
blame
|
history
client/src/translations/rules/Suction/fr.pug
patch
|
blob
|
blame
|
history
client/src/utils/gameStorage.js
patch
|
blob
|
blame
|
history
client/src/views/Game.vue
patch
|
blob
|
blame
|
history
client/src/views/MyGames.vue
patch
|
blob
|
blame
|
history
server/sockets.js
patch
|
blob
|
blame
|
history
diff --git
a/client/src/components/GameList.vue
b/client/src/components/GameList.vue
index
0a8bd8c
..
098efd0
100644
(file)
--- a/
client/src/components/GameList.vue
+++ b/
client/src/components/GameList.vue
@@
-150,7
+150,7
@@
export default {
: "Abort and remove game?";
if (confirm(this.st.tr[message])) {
const afterDelete = () => {
: "Abort and remove game?";
if (confirm(this.st.tr[message])) {
const afterDelete = () => {
- if (game.score == "*") this.$emit("abort", game);
+ if (game.score == "*") this.$emit("abort
game
", game);
this.$set(this.deleted, game.id, true);
};
if (game.type == "live")
this.$set(this.deleted, game.id, true);
};
if (game.type == "live")
diff --git
a/client/src/translations/rules/Suction/en.pug
b/client/src/translations/rules/Suction/en.pug
index
05144e1
..
b2b3b74
100644
(file)
--- a/
client/src/translations/rules/Suction/en.pug
+++ b/
client/src/translations/rules/Suction/en.pug
@@
-27,7
+27,7
@@
p.
h3 End of the game
h3 End of the game
-p The goal is to
"suck"
the opponent's king to your own first rank.
+p The goal is to
attract
the opponent's king to your own first rank.
figure.diagram-container
.diagram
figure.diagram-container
.diagram
diff --git
a/client/src/translations/rules/Suction/es.pug
b/client/src/translations/rules/Suction/es.pug
index
51db2d1
..
351c67d
100644
(file)
--- a/
client/src/translations/rules/Suction/es.pug
+++ b/
client/src/translations/rules/Suction/es.pug
@@
-28,7
+28,7
@@
p.
h3 Fin de la partida
h3 Fin de la partida
-p El objetivo es
"absorber"
al rey contrario a tu primera fila.
+p El objetivo es
atraer
al rey contrario a tu primera fila.
figure.diagram-container
.diagram
figure.diagram-container
.diagram
diff --git
a/client/src/translations/rules/Suction/fr.pug
b/client/src/translations/rules/Suction/fr.pug
index
265cd74
..
b3c5403
100644
(file)
--- a/
client/src/translations/rules/Suction/fr.pug
+++ b/
client/src/translations/rules/Suction/fr.pug
@@
-28,7
+28,7
@@
p.
h3 Fin de la partie
h3 Fin de la partie
-p Le but est d'
"aspirer"
le roi adverse jusqu'à votre première rangée.
+p Le but est d'
attirer
le roi adverse jusqu'à votre première rangée.
figure.diagram-container
.diagram
figure.diagram-container
.diagram
diff --git
a/client/src/utils/gameStorage.js
b/client/src/utils/gameStorage.js
index
5c094dc
..
92db299
100644
(file)
--- a/
client/src/utils/gameStorage.js
+++ b/
client/src/utils/gameStorage.js
@@
-122,7
+122,7
@@
export const GameStorage = {
if (!err) {
let transaction = db.transaction(["games"], "readwrite");
transaction.oncomplete = function() {
if (!err) {
let transaction = db.transaction(["games"], "readwrite");
transaction.oncomplete = function() {
- callback(
{}
); //everything's fine
+ callback(); //everything's fine
};
transaction.objectStore("games").delete(gameId);
}
};
transaction.objectStore("games").delete(gameId);
}
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
55b3688
..
b941e37
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-895,6
+895,7
@@
export default {
this.virtualClocks = this.game.clocks.map(s => ppt(s).split(':'));
return;
}
this.virtualClocks = this.game.clocks.map(s => ppt(s).split(':'));
return;
}
+ clearInterval(this.clockUpdate);
const currentTurn = this.vr.turn;
const currentMovesCount = this.game.moves.length;
const colorIdx = ["w", "b"].indexOf(currentTurn);
const currentTurn = this.vr.turn;
const currentMovesCount = this.game.moves.length;
const colorIdx = ["w", "b"].indexOf(currentTurn);
diff --git
a/client/src/views/MyGames.vue
b/client/src/views/MyGames.vue
index
4b5e33c
..
2701e9e
100644
(file)
--- a/
client/src/views/MyGames.vue
+++ b/
client/src/views/MyGames.vue
@@
-11,12
+11,13
@@
main
v-show="display=='live'"
:games="liveGames"
@show-game="showGame"
v-show="display=='live'"
:games="liveGames"
@show-game="showGame"
+ @abortgame="abortGame"
)
GameList(
v-show="display=='corr'"
:games="corrGames"
@show-game="showGame"
)
GameList(
v-show="display=='corr'"
:games="corrGames"
@show-game="showGame"
- @abort="abortGame"
+ @abort
game
="abortGame"
)
</template>
)
</template>
diff --git
a/server/sockets.js
b/server/sockets.js
index
ea95dc5
..
e420b8c
100644
(file)
--- a/
server/sockets.js
+++ b/
server/sockets.js
@@
-241,7
+241,7
@@
module.exports = function(wss) {
case "mabort": {
const gamePg = "/game/" + obj.gid;
if (!!clients[gamePg] && !!clients[gamePg][obj.target]) {
case "mabort": {
const gamePg = "/game/" + obj.gid;
if (!!clients[gamePg] && !!clients[gamePg][obj.target]) {
- Object.keys(clients[gamePg][target]).forEach(x => {
+ Object.keys(clients[gamePg][
obj.
target]).forEach(x => {
send(
clients[gamePg][obj.target][x],
{ code: "abort" }
send(
clients[gamePg][obj.target][x],
{ code: "abort" }