feat(关卡): 关闭剧情弹幕

This commit is contained in:
luying
2023-03-28 14:42:51 +08:00
parent 5bd61ed0b3
commit ba524593dd
4 changed files with 13 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { ScriptBarrageModel } from "../../../db/ScriptBarrage";
import { BarrageReturn } from '../../../domain/roleField/barrage';
import { resResult, getRandEelm } from "../../../pubUtils/util";
import { STATUS } from "../../../consts";
import { closeScriptBarrage } from "../../../pubUtils/sdkUtil";
export default function(app: Application) {
return new BarrageHandler(app);
@@ -13,6 +14,8 @@ export class BarrageHandler {
}
public async sendBarrage(msg: { warId: number, rid: string, index: string, content: string }, session: BackendSession) {
if(closeScriptBarrage()) return resResult(STATUS.FUNCTION_CLOSE);
const roleId: string = session.get('roleId');
const { warId, rid, index, content } = msg;
const result = await ScriptBarrageModel.createBarrage(roleId, warId, rid, index, content);
@@ -23,6 +26,8 @@ export class BarrageHandler {
}
public async getBarrageList(msg: {rid: string}, session: BackendSession) {
if(closeScriptBarrage()) return resResult(STATUS.SUCCESS, { barrageList: [] });
// const roleId: string = session.get('roleId');
const { rid } = msg;
const result = await ScriptBarrageModel.getBarrageList(rid, 1000);

View File

@@ -55,6 +55,8 @@ export interface DicServerConst {
readonly NEED_REBATE: number;
// 推送
readonly PUSH_MSG: number;
// 是否关闭剧情弹幕
readonly CLOSE_SCRIPT_BARRAGE: number;
}
export const dicServerConst: DicServerConst = {} as DicServerConst;

View File

@@ -192,4 +192,8 @@ export function needRebate() {
export function needPushMsg() {
return gameData.serverConst.PUSH_MSG == 1;
}
export function closeScriptBarrage() {
return gameData.serverConst.CLOSE_SCRIPT_BARRAGE == 1;
}

View File

@@ -36,5 +36,6 @@
"CAN_PAY": 1,
"SKIP_ENCODE": 0,
"NEED_REBATE": 0,
"PUSH_MSG": 0
"PUSH_MSG": 0,
"CLOSE_SCRIPT_BARRAGE": 1
}