diff --git a/package.json b/package.json index 338be6d..845379f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "10.0.0", + "version": "9.8.0", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": { diff --git a/structures/DayzRBot.js b/structures/DayzRBot.js index 579f6e9..c6b47a6 100644 --- a/structures/DayzRBot.js +++ b/structures/DayzRBot.js @@ -144,7 +144,7 @@ class DayzRBot extends Client { s.map(p => p.connected = false) // assume all players not connected for (let i = logIndex + 1; i < lines.length; i++) { - if (line.includes('| ####')) continue; + if (lines[i].includes('| ####')) 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]); @@ -200,16 +200,13 @@ class DayzRBot extends Client { for (let i = 0; i < previouslyConnected.length; i++) { if (!detectedAsConnected.includes(previouslyConnected[i])) { - // This player disconnected without a disconnect log appearing. - client.log('Players disconnected withouth disconnect log: this can happen!!!') // debug proof - - let playerStat = spreviouslyConnected[i]; + let playerStat = previouslyConnected[i]; let playerStatIndex = s.indexOf(playerStat); playerStat.connected = false; s[playerStatIndex] = playerStat; - SendConnectionLogs(client, guildId, { + SendConnectionLogs(this, guildId, { time: lastDetectedTime, player: playerStat.gamertag, connected: false,