修改多人模式的过期时间
This commit is contained in:
parent
a8ef955ae5
commit
16dc02e127
@ -242,7 +242,7 @@ class PuzzleController extends BaseController {
|
|||||||
if (!activity) {
|
if (!activity) {
|
||||||
throw new ZError(13, 'activity not found')
|
throw new ZError(13, 'activity not found')
|
||||||
}
|
}
|
||||||
let beginTime = activity.getCurrentTime()
|
let beginTime = activity.currentTime
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
beginTime = beginTime < now ? now : beginTime
|
beginTime = beginTime < now ? now : beginTime
|
||||||
if (now < activity.prepareBeginTime) {
|
if (now < activity.prepareBeginTime) {
|
||||||
@ -306,7 +306,7 @@ class PuzzleController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
beginTime = history.begin
|
beginTime = history.begin
|
||||||
history.expire = history.begin + (100 || 90) * 1000
|
history.expire = history.begin + (activity.endTime - activity.currentTime + 20000)
|
||||||
history.type = 1
|
history.type = 1
|
||||||
await history.save()
|
await history.save()
|
||||||
sessionMatch = history.id
|
sessionMatch = history.id
|
||||||
|
@ -170,24 +170,24 @@ export class ShopActivityClass extends BaseModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let result: any = {id: record.id, name: record.name, desc: record.desc}
|
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)
|
result.next = record.getNextTime(result.current)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public get prepareBeginTime() {
|
public get prepareBeginTime() {
|
||||||
let begtime = this.getCurrentTime()
|
let begtime = this.currentTime
|
||||||
return begtime - this.prepareTime * 60 * 1000
|
return begtime - this.prepareTime * 60 * 1000
|
||||||
}
|
}
|
||||||
|
|
||||||
public get endTime() {
|
public get endTime() {
|
||||||
const cfg = new GameEnv()
|
const cfg = new GameEnv()
|
||||||
const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000
|
const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000
|
||||||
let begtime = this.getCurrentTime()
|
let begtime = this.currentTime
|
||||||
return begtime + gameTime
|
return begtime + gameTime
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCurrentTime() {
|
public get currentTime() {
|
||||||
const cfg = new GameEnv()
|
const cfg = new GameEnv()
|
||||||
const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000
|
const gameTime = (cfg.pvpInterval + cfg.effectTimeLong) * this.qcount * 1000
|
||||||
const today = moment().startOf('day').toDate().getTime()
|
const today = moment().startOf('day').toDate().getTime()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user