diff --git a/mapvote.js b/mapvote.js index 4328c02..f999997 100644 --- a/mapvote.js +++ b/mapvote.js @@ -142,7 +142,7 @@ export default class MapVote extends DiscordBasePlugin { this.server.on('NEW_GAME', this.onNewGame); this.server.on('CHAT_MESSAGE', this.onChatMessage); this.server.on('PLAYER_DISCONNECTED', this.onPlayerDisconnected); - this.server.on('PLAYER_CONNECTED', this.setSeedingMode); + this.server.on('PLAYER_CONNECTED', () => { setTimeout(this.setSeedingMode, 5000) }); this.verbose(1, 'Map vote was mounted.'); this.verbose(1, "Blacklisted Layers/Levels: " + this.options.layerLevelBlacklist.join(', ')) // await this.checkUpdates(); @@ -192,11 +192,12 @@ export default class MapVote extends DiscordBasePlugin { } } this.verbose(1, logTimeframe + activeTfIds.join(', ')); + const _verbose = this.verbose; function tfFilter(tf, key, arr) { const utcDelay = tf.timezone ? parseFloat(tf.timezone) : 0; const timeNow = new Date(0, 0, 0, new Date().getUTCHours() + utcDelay, new Date().getUTCMinutes()); - this.verbose(1, `Current time (UTC+${utcDelay}) ${timeNow.getHours()}:${timeNow.getMinutes()}`) + _verbose(1, `Current time (UTC+${utcDelay}) ${timeNow.getHours()}:${timeNow.getMinutes()}`) const tfStartSplit = [ parseInt(tf.start.split(':')[ 0 ]), parseInt(tf.start.split(':')[ 1 ]) ]; const tfEndSplit = [ parseInt(tf.end.split(':')[ 0 ]), parseInt(tf.end.split(':')[ 1 ]) ];