From 667e0f6e66b6d1a70a41ab567591470aa9648bbb Mon Sep 17 00:00:00 2001 From: luca0N! Date: Thu, 31 Dec 2020 14:48:32 -0300 Subject: [PATCH] Checagem de palavras vazias adicionado --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index f06db2a..ab7099a 100644 --- a/index.js +++ b/index.js @@ -244,6 +244,13 @@ wss.on('connection', ws => { } // Certo, é a vez deste cliente. + + // A palavra enviada está vazia? + if (resposta.extra.palavra.replace(/ /g, "") === ""){ + ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "PALAVRA_OU_TEMA_PROIBIDO"))); + return; + } + cliente.uas = Date.now(); salaObj.uas = Date.now(); // A sala está com o filtro de temas adultos habilitado?