From: Benjamin Auder Date: Mon, 10 Feb 2020 00:06:58 +0000 (+0100) Subject: Merge branch 'master' of auder.net:vchess X-Git-Url: https://git.auder.net/assets/current/gitweb.css?a=commitdiff_plain;h=b121b2c842c663ca10687145dcdc44ef21ed5a12;hp=67cb2575962f6ce9af954cdabefb7e45ce6baaa5;p=vchess.git Merge branch 'master' of auder.net:vchess --- diff --git a/client/src/translations/en.js b/client/src/translations/en.js index 8a4ce5e9..37b98a4c 100644 --- a/client/src/translations/en.js +++ b/client/src/translations/en.js @@ -80,7 +80,9 @@ export const translations = "Settings": "Settings", "Stop game": "Stop game", "Subject": "Subject", + "Target is not connected": "Target is not connected", "Terminate game?": "Terminate game?", + "This tab is now offline": "This tab is now offline", "Three repetitions": "Three repetitions", "Time": "Time", "To": "To", @@ -90,8 +92,6 @@ export const translations = "Update": "Update", "Variant": "Variant", "Variants": "Variants", - "Warning: target is not connected": "Warning: target is not connected", - "Warning: multi-tabs not supported": "Warning: multi-tabs not supported", "White": "White", "White to move": "White to move", "White win": "White win", diff --git a/client/src/translations/es.js b/client/src/translations/es.js index af0e6658..34fd2bcc 100644 --- a/client/src/translations/es.js +++ b/client/src/translations/es.js @@ -80,7 +80,9 @@ export const translations = "Settings": "Configuraciones", "Stop game": "Terminar la partida", "Subject": "Asunto", + "Target is not connected": "El destinatario no está conectado", "Terminate game?": "¿ Terminar la partida ?", + "This tab is now offline": "Esta pestaña ahora está desconectada", "Three repetitions": "Tres repeticiones", "Time": "Tiempo", "To": "A", @@ -90,8 +92,6 @@ export const translations = "Update": "Actualización", "Variant": "Variante", "Variants": "Variantes", - "Warning: target is not connected": "Advertencia : el destinatario no está conectado", - "Warning: multi-tabs not supported": "Advertencia : múltiples pestañas no soportado", "White": "Blancas", "White to move": "Juegan las blancas", "White win": "Las blancas gagnan", diff --git a/client/src/translations/fr.js b/client/src/translations/fr.js index ad92da50..26b1c83d 100644 --- a/client/src/translations/fr.js +++ b/client/src/translations/fr.js @@ -80,7 +80,9 @@ export const translations = "Settings": "Réglages", "Stop game": "Arrêter la partie", "Subject": "Sujet", + "Target is not connected": "La cible n'est pas connectée", "Terminate game?": "Stopper la partie ?", + "This tab is now offline": "Cet onglet est désormais hors ligne", "Three repetitions": "Triple répétition", "Time": "Temps", "To": "À", @@ -90,8 +92,6 @@ export const translations = "Update": "Mise à jour", "Variant": "Variante", "Variants": "Variantes", - "Warning: target is not connected": "Attention : la cible n'est pas connectée", - "Warning: multi-tabs not supported": "Attention : mode multi-onglets non supporté", "White": "Blancs", "White to move": "Trait aux blancs", "White win": "Les blancs gagnent", diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 8f571538..022e3cb6 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -167,7 +167,7 @@ export default { case "duplicate": this.st.conn.send(JSON.stringify({code:"duplicate", page:"/game/" + this.game.id})); - alert(this.st.tr["Warning: multi-tabs not supported"]); + alert(this.st.tr["This tab is now offline"]); break; // 0.2] Receive clients list (just socket IDs) case "pollclients": diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index b3645684..2395f60e 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -293,7 +293,7 @@ export default { if (!targetSid) { if (!!warnDisconnected) - alert(this.st.tr["Warning: target is not connected"]); + alert(this.st.tr["Target is not connected"]); return false; } } @@ -309,7 +309,7 @@ export default { case "duplicate": this.st.conn.send(JSON.stringify({code:"duplicate", page:"/"})); this.st.conn.send = () => {}; - alert(this.st.tr["Warning: multi-tabs not supported"]); + alert(this.st.tr["This tab is now offline"]); break; // 0.2] Receive clients list (just socket IDs) case "pollclients": diff --git a/server/sockets.js b/server/sockets.js index 45e003f8..64b180db 100644 --- a/server/sockets.js +++ b/server/sockets.js @@ -17,6 +17,8 @@ module.exports = function(wss) { let clients = {}; //associative array sid --> socket wss.on("connection", (socket, req) => { const query = getJsonFromUrl(req.url); + if (query["page"] != "/" && query["page"].indexOf("/game/") < 0) + return; //other tabs don't need to be connected const sid = query["sid"]; const notifyRoom = (page,code,obj={},excluded=[]) => { Object.keys(clients).forEach(k => {