mirror of
https://github.com/AsgardEternal/SquadJSDocker.git
synced 2024-12-30 14:09:18 -06:00
Update db-log-addOn.js
This commit is contained in:
parent
22631f081d
commit
29568dcb6f
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user