Update db-log-addOn.js

This commit is contained in:
Skillet 2023-03-04 08:24:09 -05:00 committed by GitHub
parent 8080df93b1
commit 9a6e18a691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,8 +149,9 @@ export default class DBLogPlayerTime extends DBLog {
player: info.steamID, player: info.steamID,
joinTime: info.time, joinTime: info.time,
joinedSeeding: this.seeding joinedSeeding: this.seeding
});} });
else console.log('player is null'); console.log('player connect complete');
} else console.log('player is null');
} }
async onPlayerDisconnected(info) { async onPlayerDisconnected(info) {
@ -159,10 +160,12 @@ export default class DBLogPlayerTime extends DBLog {
await this.models.SteamUser.upsert({ await this.models.SteamUser.upsert({
steamID: info.player.steamID, steamID: info.player.steamID,
lastName: info.player.name lastName: info.player.name
});} });
await this.models.PlayerTime.update( }
let rowAffect = await this.models.PlayerTime.update(
{ leaveTime: info.time }, { leaveTime: info.time },
{ where: { player: info.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } } { where: { player: info.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
); );
console.log('player disconnect rows update: %i', rowAffect[0]);
} }
} }