匹配增加测试用的题目数量

This commit is contained in:
zhl 2021-05-06 17:36:39 +08:00
parent 32c2662a6f
commit bbb80f3314

View File

@ -8,23 +8,15 @@ import {
import { ZError } from '../../common/ZError' import { ZError } from '../../common/ZError'
import { BaseConst } from '../../constants/BaseConst' import { BaseConst } from '../../constants/BaseConst'
import { mission_vo } from '../../config/parsers/mission_vo' import { mission_vo } from '../../config/parsers/mission_vo'
import { import { createRoom, joinRoom, updateScore } from '../../services/WsSvr'
createRoom, joinRoom,
updateScore
} from '../../services/WsSvr'
import { RoomState } from '../../services/RoomState' import { RoomState } from '../../services/RoomState'
import { retry } from '../../utils/promise.util' import { retry } from '../../utils/promise.util'
import { RoomLockErr } from '../../common/RoomLockErr' import { RoomLockErr } from '../../common/RoomLockErr'
import { Schedule } from '../../clock/Schedule' import { Schedule } from '../../clock/Schedule'
import { import { startGame, transformRecord } from '../../services/GameLogic'
checkSubFinish, sendOneQuestion,
startGame,
transformRecord
} from '../../services/GameLogic'
import { ObjectId } from 'bson' import { ObjectId } from 'bson'
class PuzzleController extends BaseController { class PuzzleController extends BaseController {
@role('anon') @role('anon')
@router('post /api/:accountid/puzzle/list') @router('post /api/:accountid/puzzle/list')
@ -139,7 +131,7 @@ 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, debug_begin_sec } = req.params const { shop, accountid, debug_begin_sec, debug_qcount } = req.params
let data: any = { shop, maxTime: 3600 } let data: any = { shop, maxTime: 3600 }
let beginSecond = (debug_begin_sec ? +debug_begin_sec : 20) let beginSecond = (debug_begin_sec ? +debug_begin_sec : 20)
beginSecond = (Math.max(2, beginSecond)) * 1000 beginSecond = (Math.max(2, beginSecond)) * 1000
@ -201,7 +193,7 @@ class PuzzleController extends BaseController {
history.members.set(accountid, memberData) history.members.set(accountid, memberData)
history.room = roomId history.room = roomId
//TODO: 根据配置赋值 //TODO: 根据配置赋值
history.total = 10 history.total = debug_qcount || 10
history.begin = Date.now() + beginSecond history.begin = Date.now() + beginSecond
beginTime = history.begin beginTime = history.begin
history.expire = history.begin + (100 || 90) * 1000 history.expire = history.begin + (100 || 90) * 1000