diff --git a/src/api/controllers/puzzle.controller.ts b/src/api/controllers/puzzle.controller.ts index 758f37e..732a450 100644 --- a/src/api/controllers/puzzle.controller.ts +++ b/src/api/controllers/puzzle.controller.ts @@ -242,7 +242,7 @@ class PuzzleController extends BaseController { if (!activity) { throw new ZError(13, 'activity not found') } - let beginTime = activity.getCurrentTime() + let beginTime = activity.currentTime const now = Date.now() beginTime = beginTime < now ? now : beginTime if (now < activity.prepareBeginTime) { @@ -306,7 +306,7 @@ class PuzzleController extends BaseController { } beginTime = history.begin - history.expire = history.begin + (100 || 90) * 1000 + history.expire = history.begin + (activity.endTime - activity.currentTime + 20000) history.type = 1 await history.save() sessionMatch = history.id diff --git a/src/models/shop/ShopActivity.ts b/src/models/shop/ShopActivity.ts index f67789d..9167b89 100644 --- a/src/models/shop/ShopActivity.ts +++ b/src/models/shop/ShopActivity.ts @@ -170,24 +170,24 @@ export class ShopActivityClass extends BaseModule { } let result: any = {id: record.id, name: record.name, desc: record.desc} - result.current = record.getCurrentTime() + result.current = record.currentTime result.next = record.getNextTime(result.current) return result } public get prepareBeginTime() { - let begtime = this.getCurrentTime() + let begtime = this.currentTime return begtime - this.prepareTime * 60 * 1000 } public get endTime() { const cfg = new GameEnv() const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000 - let begtime = this.getCurrentTime() + let begtime = this.currentTime return begtime + gameTime } - public getCurrentTime() { + public get currentTime() { const cfg = new GameEnv() const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000 const today = moment().startOf('day').toDate().getTime()