mirror of
https://github.com/AsgardEternal/SquadJSDocker.git
synced 2025-01-02 12:09:20 -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);
|
console.log('last tick found:', lastTickTime);
|
||||||
let lastServerTime = lastTickTime.time;
|
let lastServerTime = lastTickTime.time;
|
||||||
|
console.log('last time found:', lastServerTime);
|
||||||
let playerOnlineID = [];
|
let playerOnlineID = [];
|
||||||
for (player of this.server.players){
|
for (player of this.server.players){
|
||||||
playerOnlineID.push(player.steamID);
|
playerOnlineID.push(player.steamID);
|
||||||
}
|
}
|
||||||
console.log('players online:', playerOnlineID);
|
console.log('players online:', playerOnlineID);
|
||||||
const {not} = Sequelize.Op;
|
const Op = require('sequelize').Op;
|
||||||
let rowUpdate = await this.models.PlayerTime.update(
|
let rowUpdate = await this.models.PlayerTime.update(
|
||||||
{ leaveTime: lastServerTime },
|
{ leaveTime: lastServerTime },
|
||||||
{ where: {
|
{ where: {
|
||||||
leaveTime: null,
|
leaveTime: null,
|
||||||
server: this.options.overrideServerID || this.server.id,
|
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('updated playerTimes row count: %i', rowUpdate[0]);
|
||||||
console.log('finish DB repair');
|
console.log('finish DB repair');
|
||||||
|
Loading…
Reference in New Issue
Block a user