后台:自动开服
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user