Set connected=false only on initial run
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -141,7 +141,9 @@ class DayzRBot extends Client {
|
|||||||
if (!this.exists(guild.playerstats)) guild.playerstats = [];
|
if (!this.exists(guild.playerstats)) guild.playerstats = [];
|
||||||
let s = guild.playerstats;
|
let s = guild.playerstats;
|
||||||
|
|
||||||
s.map(p => p.connected = false); // assume all players not connected
|
if (this.playerSessions.size === 0) {
|
||||||
|
s.map(p => p.connected = false); // assume all players not connected on init only.
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = logIndex + 1; i < lines.length; i++) {
|
for (let i = logIndex + 1; i < lines.length; i++) {
|
||||||
if (lines[i].includes('| ####')) continue;
|
if (lines[i].includes('| ####')) continue;
|
||||||
|
|||||||
+1
-1
@@ -223,7 +223,7 @@ module.exports = {
|
|||||||
const nodes = activePlayers.length === 0;
|
const nodes = activePlayers.length === 0;
|
||||||
const PlayersEmbed = new EmbedBuilder()
|
const PlayersEmbed = new EmbedBuilder()
|
||||||
.setColor(client.config.Colors.Default)
|
.setColor(client.config.Colors.Default)
|
||||||
.setTitle(`Online List \` ${playersOnline} \` Player${playersOnline > 1 ? 's' : ''} Online`)
|
.setTitle(`Online List \` ${playersOnline === undefined ? 0 : playersOnline} \` Player${playersOnline !== 1 ? 's' : ''} Online`)
|
||||||
.addFields(
|
.addFields(
|
||||||
{ name: 'Server:', value: `\` ${hostname} \``, inline: false },
|
{ name: 'Server:', value: `\` ${hostname} \``, inline: false },
|
||||||
{ name: 'Map:', value: `\` ${map} \``, inline: true },
|
{ name: 'Map:', value: `\` ${map} \``, inline: true },
|
||||||
|
|||||||
Reference in new issue
Block a user