mirror of
https://github.com/AsgardEternal/SquadJSDocker.git
synced 2024-12-30 15:19:18 -06:00
deal with null players
This commit is contained in:
parent
14d25e2a22
commit
177382a153
@ -111,7 +111,7 @@ export default class DBLogPlayerTime extends DBLog {
|
||||
}
|
||||
|
||||
async onPlayerConnected(info) {
|
||||
if(info.player)
|
||||
if(info.player){
|
||||
await this.models.SteamUser.upsert({
|
||||
steamID: info.player.steamID,
|
||||
lastName: info.player.name
|
||||
@ -124,12 +124,15 @@ export default class DBLogPlayerTime extends DBLog {
|
||||
joinTime: info.time,
|
||||
joinedSeeding: this.seeding
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async onPlayerDisconnected(info) {
|
||||
await this.models.PlayerTime.update(
|
||||
if(info.player){
|
||||
await this.models.PlayerTime.update(
|
||||
{ leaveTime: info.time },
|
||||
{ where: { player: info.player.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user