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
3cc5ec57b8
commit
a6c503c624
@ -191,20 +191,28 @@ export default class DBLogPlayerTime extends DBLog {
|
|||||||
async onUpdatedA2SInformation(info) {
|
async onUpdatedA2SInformation(info) {
|
||||||
await super.onUpdatedA2SInformation(info);
|
await super.onUpdatedA2SInformation(info);
|
||||||
|
|
||||||
const curDateTime = new Date();
|
// const curDateTime = new Date();
|
||||||
if ((this.seeding !== ServerState.live) && (info.a2sPlayerCount >= this.options.seedingThreshold)) {
|
// if ((this.seeding !== ServerState.live) && (info.a2sPlayerCount >= this.options.seedingThreshold)) {
|
||||||
console.log('switching to Live');
|
// console.log('switching to Live');
|
||||||
await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.live);
|
// await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.live);
|
||||||
} else if (this.seeding === false && (info.a2sPlayerCount - 20) < this.options.seedingThreshold) {
|
// } else if (this.seeding === false && (info.a2sPlayerCount - 20) < this.options.seedingThreshold) {
|
||||||
console.log('switching to seeding');
|
// console.log('switching to seeding');
|
||||||
await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.seeding);
|
// await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.seeding);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
async onNewGame(info){
|
async onNewGame(info){
|
||||||
await super.onNewGame(info);
|
await super.onNewGame(info);
|
||||||
|
|
||||||
console.log(info);
|
console.log(info);
|
||||||
|
const curDateTime = info.time;
|
||||||
|
if(info.layer.gamemode === 'Seed'){
|
||||||
|
console.log('switching to seeding');
|
||||||
|
await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.seeding);
|
||||||
|
} else {
|
||||||
|
console.log('switching to Live');
|
||||||
|
await this.updateCurrentTimeState(curDateTime, this.seeding, ServerState.live);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onPlayerConnected(info) {
|
async onPlayerConnected(info) {
|
||||||
|
Loading…
Reference in New Issue
Block a user