X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=39d7c167a5582d59602a5e15bb7aef48597a64c0;hb=26f3a8879fb4b410ed8840c5a37397011c13bc1c;hp=e8f7785f3a7495951f50e6382e4c9fb8d4e1d0da;hpb=9335d45b03966f433df8dd84ec31e8a22585a97f;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index e8f7785f..39d7c167 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -405,7 +405,6 @@ export default { newGame.type = this.classifyObject(data.game); newGame.vname = this.getVname(data.game.vid); newGame.rid = data.from; - newGame.score = "*"; this.games.push(newGame); } break; @@ -447,7 +446,6 @@ export default { } case "connect": case "gconnect": -console.log(data.code + " " + data.from); this.$set(this.people, data.from, {name:"", id:0, gamer:data.code[0]=='g'}); this.st.conn.send(JSON.stringify({code:"askidentity", target:data.from})); if (data.code == "connect") @@ -456,8 +454,7 @@ console.log(data.code + " " + data.from); this.st.conn.send(JSON.stringify({code:"askgame", target:data.from})); break; case "disconnect": - case "pdisconnect": -console.log(data.code + " " + data.from); + case "gdisconnect": this.$delete(this.people, data.from); if (data.code == "disconnect") { @@ -485,12 +482,12 @@ console.log(data.code + " " + data.from); challOrWatch: function(sid, e) { switch (e.target.innerHTML) { - case "Challenge": + case "Available": this.tryChallenge(sid); break; case "Playing": this.showGame(this.games.find( - g => g.type=="live" && g.players.some(pl => pl.sid == sid))); + g => g.players.some(pl => pl.sid == sid || pl.uid == this.people[sid].id))); break; }; },