fix/errors
This commit is contained in:
2 files changed
+4
-7
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayzr-bot",
|
"name": "dayzr-bot",
|
||||||
"version": "10.0.0",
|
"version": "9.8.0",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class DayzRBot extends Client {
|
|||||||
s.map(p => p.connected = false) // assume all players not connected
|
s.map(p => p.connected = false) // assume all players not connected
|
||||||
|
|
||||||
for (let i = logIndex + 1; i < lines.length; i++) {
|
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 (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 ((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('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++) {
|
for (let i = 0; i < previouslyConnected.length; i++) {
|
||||||
if (!detectedAsConnected.includes(previouslyConnected[i])) {
|
if (!detectedAsConnected.includes(previouslyConnected[i])) {
|
||||||
|
|
||||||
// This player disconnected without a disconnect log appearing.
|
let playerStat = previouslyConnected[i];
|
||||||
client.log('Players disconnected withouth disconnect log: this can happen!!!') // debug proof
|
|
||||||
|
|
||||||
let playerStat = spreviouslyConnected[i];
|
|
||||||
let playerStatIndex = s.indexOf(playerStat);
|
let playerStatIndex = s.indexOf(playerStat);
|
||||||
|
|
||||||
playerStat.connected = false;
|
playerStat.connected = false;
|
||||||
s[playerStatIndex] = playerStat;
|
s[playerStatIndex] = playerStat;
|
||||||
|
|
||||||
SendConnectionLogs(client, guildId, {
|
SendConnectionLogs(this, guildId, {
|
||||||
time: lastDetectedTime,
|
time: lastDetectedTime,
|
||||||
player: playerStat.gamertag,
|
player: playerStat.gamertag,
|
||||||
connected: false,
|
connected: false,
|
||||||
|
|||||||
Reference in new issue
Block a user