Update db-log-addOn.js

This commit is contained in:
Skillet 2023-02-18 15:59:13 -05:00 committed by GitHub
parent a29b3199f6
commit 2ae23e2cfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,14 +118,13 @@ export default class DBLogPlayerTime extends DBLog {
await this.models.SteamUser.upsert({
steamID: info.player.steamID,
lastName: info.player.name
});
});}
await this.models.PlayerTime.create({
server: this.options.overrideServerID || this.server.id,
player: info.player.steamID,
player: info.steamID,
joinTime: info.time,
joinedSeeding: this.seeding
});
}
}
async onPlayerDisconnected(info) {
@ -134,11 +133,10 @@ export default class DBLogPlayerTime extends DBLog {
await this.models.SteamUser.upsert({
steamID: info.player.steamID,
lastName: info.player.name
});
});}
await this.models.PlayerTime.update(
{ leaveTime: info.time },
{ where: { player: info.player.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
{ where: { player: info.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
);
}
}
}