设置时间
This commit is contained in:
+1
-1
@@ -188,4 +188,4 @@ if (app.isMaster()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// start app
|
// start app
|
||||||
app.start();
|
app.start();
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ export class PvpHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async debugPvpSeasonResetTime(msg: {day: number}, session: BackendSession) {
|
async debugPvpSeasonResetTime(msg: {day: number}, session: BackendSession) {
|
||||||
let { day } = msg;
|
let { day:hour } = msg;
|
||||||
let { seasonNum, seasonEndTime } = await pinus.app.rpc.systimer.systimerRemote.resetPvpSeasonTime.toServer('systimer-server-1', day);
|
let { seasonNum, seasonEndTime } = await pinus.app.rpc.systimer.systimerRemote.resetPvpSeasonTime.toServer('systimer-server-1', hour);
|
||||||
return resResult(STATUS.SUCCESS, { seasonNum, seasonEndTime });
|
return resResult(STATUS.SUCCESS, { seasonNum, seasonEndTime });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,18 +165,19 @@ function getScore(arr, score) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetPvpSeasonTime(day: number) {
|
export async function resetPvpSeasonTime(hour: number) {
|
||||||
seasonJobId.cancel();
|
seasonJobId.cancel();
|
||||||
let seasonEndTime = 0;
|
let seasonEndTime = 0;
|
||||||
let seasonNum = 1;
|
let seasonNum = 1;
|
||||||
|
|
||||||
let systemConfig = await SystemConfigModel.findSystemConfig();
|
let systemConfig = await SystemConfigModel.findSystemConfig();
|
||||||
if (!systemConfig) {
|
if (!systemConfig) {
|
||||||
let warIds = getPvpGkWarIds();
|
let warIds = getPvpGkWarIds();
|
||||||
let warId = warIds[0];//TODO随机地图
|
let warId = warIds[0];//TODO随机地图
|
||||||
seasonEndTime = day * PER_DAY + getTodayZeroPoint();
|
seasonEndTime = hour * 60 * 60 + getTodayZeroPoint();
|
||||||
systemConfig = await SystemConfigModel.createSystemConfig( seasonEndTime, warId );
|
systemConfig = await SystemConfigModel.createSystemConfig( seasonEndTime, warId );
|
||||||
} else {
|
} else {
|
||||||
seasonEndTime = day * PER_DAY + getTodayZeroPoint();
|
seasonEndTime = hour * 60 * 60 + getTodayZeroPoint();
|
||||||
seasonNum = systemConfig.seasonNum + 1;
|
seasonNum = systemConfig.seasonNum + 1;
|
||||||
await SystemConfigModel.updateSystemConfig({ seasonEndTime, seasonNum: seasonNum});
|
await SystemConfigModel.updateSystemConfig({ seasonEndTime, seasonNum: seasonNum});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user