Checagem de palavras vazias adicionado

This commit is contained in:
luca0N! 2020-12-31 14:48:32 -03:00
parent 9dc5f566ee
commit 667e0f6e66
Signed by: luca0N
GPG Key ID: 68FDED9A81B90723
1 changed files with 7 additions and 0 deletions

View File

@ -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?