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