主动回答题, 发送广播消息
This commit is contained in:
parent
2f22a90283
commit
14ad098f36
@ -8,7 +8,12 @@ import {
|
||||
import { ZError } from '../../common/ZError'
|
||||
import { BaseConst } from '../../constants/BaseConst'
|
||||
import { mission_vo } from '../../config/parsers/mission_vo'
|
||||
import { createRoom, joinRoom, updateScore } from '../../services/WsSvr'
|
||||
import {
|
||||
broadcast,
|
||||
createRoom,
|
||||
joinRoom,
|
||||
updateScore
|
||||
} from '../../services/WsSvr'
|
||||
import { RoomState } from '../../services/RoomState'
|
||||
import { retry } from '../../utils/promise.util'
|
||||
import { RoomLockErr } from '../../common/RoomLockErr'
|
||||
@ -89,6 +94,7 @@ class PuzzleController extends BaseController {
|
||||
await history.save()
|
||||
if (mode == 1) {
|
||||
let score = result ? 3 : -1
|
||||
await broadcast(history.room, 'answer', {accountid, result, score})
|
||||
await updateScore(history.room, [{accountid, score }])
|
||||
|
||||
// if (checkSubFinish(history, id)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user