projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace news by FAQ
[vchess.git]
/
client
/
src
/
views
/
Game.vue
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
7a9fb5b
..
6261139
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-252,9
+252,6
@@
export default {
},
// NOTE: some redundant code with Hall.vue (mostly related to people array)
created: function() {
},
// NOTE: some redundant code with Hall.vue (mostly related to people array)
created: function() {
- if (this.$route.query["focus"] === "false")
- // Focus explicitely set to false from Hall (live game)
- this.focus = false;
this.atCreation();
},
mounted: function() {
this.atCreation();
},
mounted: function() {
@@
-749,10
+746,15
@@
export default {
if (!this.game || !this.game.moves) this.lastateAsked = true;
else this.sendLastate(data.from);
break;
if (!this.game || !this.game.moves) this.lastateAsked = true;
else this.sendLastate(data.from);
break;
+ // TODO: possible bad scenario: reload page while oppponent sends a
+ // move => get both lastate and newmove, process both, add move twice.
+ // Confirm scenario? Fix?
case "lastate": {
// Got opponent infos about last move
this.gotLastate = true;
this.lastate = data.data;
case "lastate": {
// Got opponent infos about last move
this.gotLastate = true;
this.lastate = data.data;
+ if (this.lastate.movesCount > this.gotMoveIdx)
+ this.gotMoveIdx = this.lastate.movesCount;
if (this.game.rendered)
// Game is rendered (Board component)
this.processLastate();
if (this.game.rendered)
// Game is rendered (Board component)
this.processLastate();
@@
-760,6
+762,12
@@
export default {
break;
}
case "newmove": {
break;
}
case "newmove": {
+
+// DEBUG:
+console.log("Receive move");
+console.log(data.data);
+//moveslist not updated when receiving a move? (see in baseGame)
+
const movePlus = data.data;
const movesCount = this.game.moves.length;
if (movePlus.index > movesCount) {
const movePlus = data.data;
const movesCount = this.game.moves.length;
if (movePlus.index > movesCount) {
@@
-1054,7
+1062,7
@@
export default {
let gameInfo = {
id: getRandString(), //ignored if corr
fen: V.GenRandInitFen(this.game.randomness),
let gameInfo = {
id: getRandString(), //ignored if corr
fen: V.GenRandInitFen(this.game.randomness),
- players:
this.game.players.reverse()
,
+ players:
[this.game.players[1], this.game.players[0]]
,
vid: this.game.vid,
cadence: this.game.cadence
};
vid: this.game.vid,
cadence: this.game.cadence
};
@@
-1772,7
+1780,7
@@
span.yourturn
background-color: lightyellow
.draw-received, .draw-received:hover
background-color: lightyellow
.draw-received, .draw-received:hover
- background-color: #
48C9B0
+ background-color: #
73C6B6
.draw-threerep, .draw-threerep:hover
background-color: #D2B4DE
.draw-threerep, .draw-threerep:hover
background-color: #D2B4DE