From 37da4689d976b904b443127ac0452c97aa3c4978 Mon Sep 17 00:00:00 2001 From: Skillet Date: Wed, 15 Feb 2023 11:17:07 -0500 Subject: [PATCH] Update db-log-addOn.js --- squadjsPlugins/db-log-addOn.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/squadjsPlugins/db-log-addOn.js b/squadjsPlugins/db-log-addOn.js index 03a0443..01ccc5c 100644 --- a/squadjsPlugins/db-log-addOn.js +++ b/squadjsPlugins/db-log-addOn.js @@ -109,6 +109,10 @@ export default class DBLogPlayerTime extends DBLog { async onPlayerConnected(info) { if(info.player){ + await this.models.SteamUser.upsert({ + steamID: info.attacker.steamID, + lastName: info.attacker.name + }); await this.models.PlayerTime.create({ server: this.options.overrideServerID || this.server.id, player: info.player.steamID, @@ -120,6 +124,10 @@ export default class DBLogPlayerTime extends DBLog { async onPlayerDisconnected(info) { if(info.player){ + await this.models.SteamUser.upsert({ + steamID: info.attacker.steamID, + lastName: info.attacker.name + }); await this.models.PlayerTime.update( { leaveTime: info.time }, { where: { player: info.player.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }