From 0b34ecb0b57b9209baa7694fc5cf9fbcca8c8fd1 Mon Sep 17 00:00:00 2001 From: Skillet Date: Wed, 8 Mar 2023 17:42:40 -0500 Subject: [PATCH] Update db-log-addOn.js --- squadjsPlugins/db-log-addOn.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/squadjsPlugins/db-log-addOn.js b/squadjsPlugins/db-log-addOn.js index 1529829..1bd1ac9 100644 --- a/squadjsPlugins/db-log-addOn.js +++ b/squadjsPlugins/db-log-addOn.js @@ -85,6 +85,13 @@ export default class DBLogPlayerTime extends DBLog { async mount() { console.log('Mounting db-log'); + if(this.server.currentLayer.gamemode === "Seed"){ + console.log('switching to seeding'); + this.seeding = ServerState.seeding; + } else { + console.log('switching to Live'); + this.seeding = ServerState.live; + } await super.mount(); console.log('finished mounting db-log'); this.server.on('PLAYER_CONNECTED', this.onPlayerConnected); @@ -150,6 +157,7 @@ export default class DBLogPlayerTime extends DBLog { } async updateCurrentTimeState(date, oldState, newState){ + if(oldState === newState) return; const timeNow = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); console.log(timeNow); const curPlayer = await this.models.PlayerTimeNew.findAll({