From b5fb62aceb823d054c1b9ebbec6ad19f8512dccf Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sun, 23 Jul 2023 21:01:55 -0700 Subject: [PATCH] enhance Unknown Entity log detection --- package.json | 2 +- structures/DayzArmbands.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ffaa4e6..c947691 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayz-armbands", - "version": "8.2.9", + "version": "8.2.10", "description": "A General Purpose Discord Bot for DayZ Servers.", "main": "index.js", "nodemonConfig": { diff --git a/structures/DayzArmbands.js b/structures/DayzArmbands.js index 2c5b8fc..8bea3fe 100644 --- a/structures/DayzArmbands.js +++ b/structures/DayzArmbands.js @@ -139,10 +139,10 @@ class DayzArmbands extends Client { let s = guild.playerstats; for (let i = logIndex + 1; i < lines.length; i++) { - if (lines[i].includes("Unknown")) continue; - if ((i - 1) >= 0 && lines[i] == lines[i-1]) continue; + if (lines[i].includes("(id=Unknown") || lines[i].includes("Player \"Unknown Entity\"")) continue; + if ((i - 1) >= 0 && lines[i] == lines[i-1]) continue; // continue if this line is a duplicate of the last line if (lines[i].includes('connected') || lines[i].includes('pos=<') || lines[1].includes('hit by Player')) s = await HandlePlayerLogs(this, guildId, s, lines[i]); - if (lines[i].includes('killed by with')) s = await HandleKillfeed(this, guildId, s, lines[i]); + if (lines[i].includes('killed by with')) s = await HandleKillfeed(this, guildId, s, lines[i]); // Handles explosive deaths if (!(i + 1 >= lines.length) && lines[i + 1].includes('killed by Player') && lines[i].includes('hit by Player')) s = await HandleKillfeed(this, guildId, s, lines[i]); if (lines[i].includes('killed by Player') && !lines[i - 1].includes('hit by Player')) s = await HandleKillfeed(this, guildId, s, lines[i]); }