From b221f96d497e0d1194478cd2cb71aa7c580908cf Mon Sep 17 00:00:00 2001 From: Skillet Date: Thu, 16 Feb 2023 00:45:05 -0500 Subject: [PATCH] Update db-log-addOn.js --- squadjsPlugins/db-log-addOn.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/squadjsPlugins/db-log-addOn.js b/squadjsPlugins/db-log-addOn.js index aca799b..3cc1b64 100644 --- a/squadjsPlugins/db-log-addOn.js +++ b/squadjsPlugins/db-log-addOn.js @@ -95,16 +95,14 @@ export default class DBLogPlayerTime extends DBLog { async onUpdatedA2SInformation(info) { await super.onUpdatedA2SInformation(info); - - if(info.a2sPlayerCount >= this.options.seedingThreshold && this.seeding === true) { - await this.models.PlayerTime.update( + + if((this.seeding === true) && (info.a2sPlayerCount >= this.options.seedingThreshold)){ + this.seeding = false; + await this.models.PlayerTime.update( { seedTime: info.time }, { where: { seedTime: null, joinedSeeding: 1, leaveTime: null, server: this.options.overrideServerID || this.server.id } } - ); - } - - if(this.seeding === true && info.a2sPlayerCount >= this.options.seedingThreshold) this.seeding = false; - else if(this.seeding === false && (info.a2sPlayerCount-20) < this.options.seedingThreshold) this.seeding = true; + ); + }else if(this.seeding === false && (info.a2sPlayerCount-20) < this.options.seedingThreshold) this.seeding = true; } async onPlayerConnected(info) {