Update db-log-addOn.js

This commit is contained in:
Skillet 2023-02-16 00:45:05 -05:00 committed by GitHub
parent 1cf304388b
commit b221f96d49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,16 +95,14 @@ export default class DBLogPlayerTime extends DBLog {
async onUpdatedA2SInformation(info) {
await super.onUpdatedA2SInformation(info);
if(info.a2sPlayerCount >= this.options.seedingThreshold && this.seeding === true) {
await this.models.PlayerTime.update(
if((this.seeding === true) && (info.a2sPlayerCount >= this.options.seedingThreshold)){
this.seeding = false;
await this.models.PlayerTime.update(
{ seedTime: info.time },
{ where: { seedTime: null, joinedSeeding: 1, leaveTime: null, server: this.options.overrideServerID || this.server.id } }
);
}
if(this.seeding === true && info.a2sPlayerCount >= this.options.seedingThreshold) this.seeding = false;
else if(this.seeding === false && (info.a2sPlayerCount-20) < this.options.seedingThreshold) this.seeding = true;
);
}else if(this.seeding === false && (info.a2sPlayerCount-20) < this.options.seedingThreshold) this.seeding = true;
}
async onPlayerConnected(info) {