增加一个用于debug的游戏开始时间

This commit is contained in:
zhl 2021-04-30 10:28:10 +08:00
parent d5ae3f9b84
commit 2d31ec5c9a

View File

@ -107,8 +107,10 @@ class PuzzleController extends BaseController {
@role('anon') @role('anon')
@router('post /api/:accountid/puzzle/match') @router('post /api/:accountid/puzzle/match')
async joinMultipleGame(req, res) { async joinMultipleGame(req, res) {
const { shop, accountid } = req.params const { shop, accountid, debug_begin_sec } = req.params
let data = { shop } let data = { shop }
let beginSecond = (debug_begin_sec ? +debug_begin_sec : 20)
beginSecond = (Math.max(2, beginSecond)) * 1000
/** /**
* , * ,
* , , * , ,
@ -146,7 +148,6 @@ class PuzzleController extends BaseController {
history.members.set(accountid, new PuzzleStatusClass()) history.members.set(accountid, new PuzzleStatusClass())
history.room = roomId history.room = roomId
//TODO: 根据配置赋值 //TODO: 根据配置赋值
const beginSecond = 20 * 1000
history.total = 10 history.total = 10
history.begin = Date.now() + beginSecond history.begin = Date.now() + beginSecond
beginTime = history.begin beginTime = history.begin