projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ee2826
)
Fix: send fullgame without irrelevant fields
author
Benjamin Auder
<benjamin.auder@somewhere>
Fri, 6 Mar 2020 14:07:50 +0000
(15:07 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Fri, 6 Mar 2020 14:07:50 +0000
(15:07 +0100)
client/src/views/Game.vue
patch
|
blob
|
blame
|
history
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
8e03a86
..
91e6b6a
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-387,7
+387,20
@@
export default {
}
break;
case "askfullgame":
}
break;
case "askfullgame":
- this.send("fullgame", { data: this.game, target: data.from });
+ const gameToSend = Object.keys(this.game)
+ .filter(k =>
+ [
+ "id","fen","players","vid","cadence","fenStart","vname",
+ "moves","clocks","initime","score","drawOffer"
+ ].includes(k))
+ .reduce(
+ (obj, k) => {
+ obj[k] = this.game[k];
+ return obj;
+ },
+ {}
+ );
+ this.send("fullgame", { data: gameToSend, target: data.from });
break;
case "fullgame":
// Callback "roomInit" to poll clients only after game is loaded
break;
case "fullgame":
// Callback "roomInit" to poll clients only after game is loaded
@@
-641,7
+654,7
@@
export default {
}
}
}
}
}
}
- if (game.drawOffer) {
+ if (
!!
game.drawOffer) {
if (game.drawOffer == "t")
// Three repetitions
this.drawOffer = "threerep";
if (game.drawOffer == "t")
// Three repetitions
this.drawOffer = "threerep";