修改多人模式的过期时间

This commit is contained in:
zhl 2021-05-21 20:05:03 +08:00
parent a8ef955ae5
commit 16dc02e127
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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()