X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=e3a2f6e0dd9c212ec0f417c68a8a622c945924ef;hb=3cb412e96197807f2c991e61cad50626738a3b4f;hp=5eeb7fd5a6b472b38abd87fd7e42ff7ba2bc64a7;hpb=2cc10cdbc230f82202bdddb7a244c903c05ab351;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 5eeb7fd5..e3a2f6e0 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -191,6 +191,10 @@ export default { case "drawoffer": this.drawOffer = "received"; break; + case "askfullgame": + // TODO: just give game; observers are listed here anyway: + // gameconnect? + break; // TODO: drawaccepted (click draw button before sending move ==> draw offer in move) // ==> on "newmove", check "drawOffer" field // TODO: also use (dis)connect info to count online players? @@ -211,6 +215,7 @@ export default { break; } }; + // TODO: onopen, ask lastState informations + update observers and players status const socketCloseListener = () => { this.st.conn.addEventListener('message', socketMessageListener); this.st.conn.addEventListener('close', socketCloseListener); @@ -303,6 +308,7 @@ export default { return afterRetrival(game); if (!!this.gameRef.rid) { + this.st.conn.send(JSON.stringify({code:"askfullgame", target:this.gameRef.rid})); // TODO: just send a game request message to the remote player, // and when receiving answer just call loadGame(received_game) // + remote peer should have registered us as an observer @@ -372,3 +378,7 @@ export default { }, }; + +