From c92ec69523ff0caa760d164a57d66435dc728890 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Mon, 25 Nov 2024 14:14:21 -0500 Subject: [PATCH] fix illegal username bug --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0015e86..c839fa1 100644 --- a/index.js +++ b/index.js @@ -62,8 +62,8 @@ app.ws('/', function (ws, req) { } ); j = await j.json(); - if (game.ws.findIndex(x => x.username == j.username) != -1) { - console.log(`Player ${player.you} uses username ${ws.username} illegally`) + if (game.ws.findIndex(x => x.username == j.username && x.health >= 0) != -1) { + console.log(`Player ${player.you} uses username ${x.username} illegally`) return; } ws.username = j.username;