后台:自动开服

This commit is contained in:
luying
2021-12-08 16:23:00 +08:00
parent 02c2096704
commit fc38485f94
8 changed files with 102 additions and 97 deletions

View File

@@ -3,6 +3,7 @@ import { isArray } from 'underscore';
import GMMail from "../../db/GMMail";
import ServerStategy from "../../db/ServerStategy";
import { RegionType } from "../../db/Region";
import { nowSeconds } from "../../pubUtils/timeUtil";
export class UpdateMailParams {
hasGoods: boolean = false; // 是否有道具
@@ -127,12 +128,28 @@ export class CreateServerParam {
circleMail?: GMMail;
stopRegisterTime: number = 0;
constructor(obj: CreateServerParam) {
for(let key in obj) {
this[key] = obj[key];
constructor(obj?: any) {
if(obj) {
for(let key in obj) {
this[key] = obj[key];
}
}
}
setByRegionStategy(region: RegionType, openTime: number) {
this.env = region.env;
this.openTime = openTime;
if(region.stategy) {
this.activityGroupId = region.stategy.activityGroupId;
this.hasOpenMail = !!region.stategy.openMail;
this.openMail = region.stategy.openMail;
this.hasCircleMail = !!region.stategy.circleMail;
this.circleMail = region.stategy.circleMail;
this.stopRegisterTime = region.stategy.stopRegisterTime;
}
}
checkParams() {
if(!this.env || !this.openTime || !this.stopRegisterTime || !isArray(this.activityGroupId) || this.activityGroupId.length <= 0 ) {
return false