configure combat log timer/refactor boolean configuration

This commit is contained in:
SowinskiBraeden committed 2023-09-10 00:52:48 -07:00
1 parent ab2b59ff11
commit afdec2395c
4 files changed
+38 -23

No files matched your search

+11 -9
View File
@@ -9,7 +9,7 @@ let lastSendMessage;
module.exports = {
HandlePlayerLogs: async (client, guildId, stats, line) => {
HandlePlayerLogs: async (client, guildId, stats, line, combatLogTimer = 5) => {
const connectTemplate = /(.*) \| Player \"(.*)\" is connected \(id=(.*)\)/g;
const disconnectTemplate = /(.*) \| Player \"(.*)\"\(id=(.*)\) has been disconnected/g;
@@ -86,14 +86,16 @@ module.exports = {
lastConnectionDate: playerStat.lastConnectionDate,
});
DetectCombatLog(client, guildId, {
time: info.time,
player: info.player,
pos: playerStat.pos,
lastDamageDate: playerStat.lastDamageDate,
lastHitBy: playerStat.lastHitBy,
lastDeathDate: playerStat.lastDeathDate,
});
if (combatLogTimer != 0) {
DetectCombatLog(client, guildId, {
time: info.time,
player: info.player,
pos: playerStat.pos,
lastDamageDate: playerStat.lastDamageDate,
lastHitBy: playerStat.lastHitBy,
lastDeathDate: playerStat.lastDeathDate,
});
}
}
if (line.includes('pos=<') && !line.includes('hit by')) {