X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=0072bd431a05af8b1f87212277c9c0f89834929f;hp=baa9ae1930d50575ff1faaad66295f26a433796b;hb=29ced362f46ae68e4314985bf836b3adeba23f32;hpb=bc9b5f227f930a54cd98729fce3d800d0c9409ed diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index baa9ae19..0072bd43 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -152,10 +152,13 @@ export default { this.st.conn.send(JSON.stringify({code:"pollclients"})); }, isConnected: function(index) { - const name = this.game.players[index].name; - if (this.st.user.name == name) + const player = this.game.players[index]; + // Is it me ? + if (this.st.user.sid == player.sid || this.st.user.id == player.uid) return true; - return Object.values(this.people).some(p => p.name == name); + // Try to find a match in people: + return Object.keys(this.people).some(sid => sid == player.sid) || + Object.values(this.people).some(p => p.id == player.uid); }, socketMessageListener: function(msg) { const data = JSON.parse(msg.data);