projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Almost finished components drafts
[vchess.git]
/
public
/
javascripts
/
components
/
game.js
diff --git
a/public/javascripts/components/game.js
b/public/javascripts/components/game.js
index
dd9cfe4
..
ef38559
100644
(file)
--- a/
public/javascripts/components/game.js
+++ b/
public/javascripts/components/game.js
@@
-128,6
+128,13
@@
Vue.component('my-game', {
this.vr = new VariantRules(this.fen);
this.fenStart = this.fen;
}
this.vr = new VariantRules(this.fen);
this.fenStart = this.fen;
}
+ // TODO: if I'm one of the players in game, then:
+ // Send ping to server (answer pong if opponent is connected)
+ if (true && !!this.conn)
+ {
+ this.conn.send(JSON.stringify({
+ code:"ping",oppid:this.oppid,gameId:this.gameId}));
+ }
// TODO: also handle "draw accepted" (use opponents array?)
// --> must give this info also when sending lastState...
// and, if all players agree then OK draw (end game ...etc)
// TODO: also handle "draw accepted" (use opponents array?)
// --> must give this info also when sending lastState...
// and, if all players agree then OK draw (end game ...etc)