X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Froom.js;fp=public%2Fjavascripts%2Fcomponents%2Froom.js;h=d3dda053f0cbe1c8de3f790c4c20b80c8643fb66;hp=84c82f7cb621171ad0a572dc9e979fd6e003e9cd;hb=3ca7a846ae7bc5d8f7c628417418534f3c92593a;hpb=a6403027a66411ead248aab0369bf3ee3a75d8ec diff --git a/public/javascripts/components/room.js b/public/javascripts/components/room.js index 84c82f7c..d3dda053 100644 --- a/public/javascripts/components/room.js +++ b/public/javascripts/components/room.js @@ -23,7 +23,8 @@ fin de partie corr: garder maxi nbPlayers lastMove sur serveur, pendant 7 jours Vue.component('my-room', { props: ["conn","settings"], data: { - something: "", //TODO + remoteGames: [], + corrGames: [], }, // Modal new game, and then sub-components template: ` @@ -42,21 +43,29 @@ Vue.component('my-room', { - - - - - onClick :: ask full game to remote player, and register as an observer in game - (use gameId to communicate) - on landing on game :: if gameId not found locally, check remotely - ==> il manque un param dans game : "remoteId" +
+ + +
+
+ + // TODO: also corr games (of pther players) + // presentation ? table ?! + + +
`, created: function() { + // TODO: ask server for current corr games (all but mines) const socketMessageListener = msg => { const data = JSON.parse(msg.data); switch (data.code) { + // TODO: also receive remote games summaries (update) + // (just players names, time control, and ID + player ID) case "newgame": //challenge accepted // oppid: opponent socket ID (or DB id if registered) this.newGame("human", data.fen, data.color, data.oppid, data.gameid);