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
ad5e5bf290
commit
37da4689d9
@ -109,6 +109,10 @@ export default class DBLogPlayerTime extends DBLog {
|
|||||||
|
|
||||||
async onPlayerConnected(info) {
|
async onPlayerConnected(info) {
|
||||||
if(info.player){
|
if(info.player){
|
||||||
|
await this.models.SteamUser.upsert({
|
||||||
|
steamID: info.attacker.steamID,
|
||||||
|
lastName: info.attacker.name
|
||||||
|
});
|
||||||
await this.models.PlayerTime.create({
|
await this.models.PlayerTime.create({
|
||||||
server: this.options.overrideServerID || this.server.id,
|
server: this.options.overrideServerID || this.server.id,
|
||||||
player: info.player.steamID,
|
player: info.player.steamID,
|
||||||
@ -120,6 +124,10 @@ export default class DBLogPlayerTime extends DBLog {
|
|||||||
|
|
||||||
async onPlayerDisconnected(info) {
|
async onPlayerDisconnected(info) {
|
||||||
if(info.player){
|
if(info.player){
|
||||||
|
await this.models.SteamUser.upsert({
|
||||||
|
steamID: info.attacker.steamID,
|
||||||
|
lastName: info.attacker.name
|
||||||
|
});
|
||||||
await this.models.PlayerTime.update(
|
await this.models.PlayerTime.update(
|
||||||
{ leaveTime: info.time },
|
{ leaveTime: info.time },
|
||||||
{ where: { player: info.player.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
|
{ where: { player: info.player.steamID, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
|
||||||
|
Loading…
Reference in New Issue
Block a user