From 29568dcb6f4ed6c0dc075b921a7a7a8728818e8f Mon Sep 17 00:00:00 2001 From: Skillet Date: Sat, 4 Mar 2023 10:27:04 -0500 Subject: [PATCH] Update db-log-addOn.js --- squadjsPlugins/db-log-addOn.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/squadjsPlugins/db-log-addOn.js b/squadjsPlugins/db-log-addOn.js index 3de5c9c..7d0e160 100644 --- a/squadjsPlugins/db-log-addOn.js +++ b/squadjsPlugins/db-log-addOn.js @@ -99,19 +99,21 @@ export default class DBLogPlayerTime extends DBLog { ); console.log('last tick found:', lastTickTime); let lastServerTime = lastTickTime.time; + console.log('last time found:', lastServerTime); let playerOnlineID = []; for (player of this.server.players){ playerOnlineID.push(player.steamID); } console.log('players online:', playerOnlineID); - const {not} = Sequelize.Op; + const Op = require('sequelize').Op; let rowUpdate = await this.models.PlayerTime.update( { leaveTime: lastServerTime }, { where: { leaveTime: null, server: this.options.overrideServerID || this.server.id, - [not]: [{player: playerOnlineID}] + { [Op.ne]: { player: playerOnlineID } } } } + { logging: console.log } ); console.log('updated playerTimes row count: %i', rowUpdate[0]); console.log('finish DB repair');