From dac74f45fe09028d9e49c3d301b1fc9189de2740 Mon Sep 17 00:00:00 2001 From: Skillet Date: Thu, 16 Feb 2023 02:37:14 -0500 Subject: [PATCH] Update db-log-addOn.js --- squadjsPlugins/db-log-addOn.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/squadjsPlugins/db-log-addOn.js b/squadjsPlugins/db-log-addOn.js index d27b64d..8eec195 100644 --- a/squadjsPlugins/db-log-addOn.js +++ b/squadjsPlugins/db-log-addOn.js @@ -97,14 +97,15 @@ export default class DBLogPlayerTime extends DBLog { await super.onUpdatedA2SInformation(info); console.log(info); - if((this.seeding == true) && (info.a2sPlayerCount >= this.options.seedingThreshold)){ + if((this.seeding == true) && (info.a2sPlayerCount >= 1)){ console.log('switching to Live'); this.seeding = false; + let curDateTime = new Date(); await this.models.PlayerTime.update( - { seedTime: info.time }, + { seedTime: curDateTime.getFullYear() + '-' + (curDateTime.getMonth() + 1) + '-' + curDateTime.getDate()+'T'+curDateTime.getHours()+':'+curDateTime.getMinutes()+':'+curDateTime.getSeconds()+'Z'}, { where: { seedTime: null, joinedSeeding: 1, leaveTime: null, server: this.options.overrideServerID || this.server.id } } ); - }else if(this.seeding == false && (info.a2sPlayerCount-20) < this.options.seedingThreshold){ + }else if(this.seeding == false && (info.a2sPlayerCount) < 1){ console.log('switching to seeding'); this.seeding = true; }