✨ feat(关卡): 关闭剧情弹幕
This commit is contained in:
@@ -3,6 +3,7 @@ import { ScriptBarrageModel } from "../../../db/ScriptBarrage";
|
|||||||
import { BarrageReturn } from '../../../domain/roleField/barrage';
|
import { BarrageReturn } from '../../../domain/roleField/barrage';
|
||||||
import { resResult, getRandEelm } from "../../../pubUtils/util";
|
import { resResult, getRandEelm } from "../../../pubUtils/util";
|
||||||
import { STATUS } from "../../../consts";
|
import { STATUS } from "../../../consts";
|
||||||
|
import { closeScriptBarrage } from "../../../pubUtils/sdkUtil";
|
||||||
|
|
||||||
export default function(app: Application) {
|
export default function(app: Application) {
|
||||||
return new BarrageHandler(app);
|
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) {
|
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 roleId: string = session.get('roleId');
|
||||||
const { warId, rid, index, content } = msg;
|
const { warId, rid, index, content } = msg;
|
||||||
const result = await ScriptBarrageModel.createBarrage(roleId, warId, rid, index, content);
|
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) {
|
public async getBarrageList(msg: {rid: string}, session: BackendSession) {
|
||||||
|
if(closeScriptBarrage()) return resResult(STATUS.SUCCESS, { barrageList: [] });
|
||||||
|
|
||||||
// const roleId: string = session.get('roleId');
|
// const roleId: string = session.get('roleId');
|
||||||
const { rid } = msg;
|
const { rid } = msg;
|
||||||
const result = await ScriptBarrageModel.getBarrageList(rid, 1000);
|
const result = await ScriptBarrageModel.getBarrageList(rid, 1000);
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ export interface DicServerConst {
|
|||||||
readonly NEED_REBATE: number;
|
readonly NEED_REBATE: number;
|
||||||
// 推送
|
// 推送
|
||||||
readonly PUSH_MSG: number;
|
readonly PUSH_MSG: number;
|
||||||
|
// 是否关闭剧情弹幕
|
||||||
|
readonly CLOSE_SCRIPT_BARRAGE: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const dicServerConst: DicServerConst = {} as DicServerConst;
|
export const dicServerConst: DicServerConst = {} as DicServerConst;
|
||||||
|
|||||||
@@ -193,3 +193,7 @@ export function needRebate() {
|
|||||||
export function needPushMsg() {
|
export function needPushMsg() {
|
||||||
return gameData.serverConst.PUSH_MSG == 1;
|
return gameData.serverConst.PUSH_MSG == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function closeScriptBarrage() {
|
||||||
|
return gameData.serverConst.CLOSE_SCRIPT_BARRAGE == 1;
|
||||||
|
}
|
||||||
@@ -36,5 +36,6 @@
|
|||||||
"CAN_PAY": 1,
|
"CAN_PAY": 1,
|
||||||
"SKIP_ENCODE": 0,
|
"SKIP_ENCODE": 0,
|
||||||
"NEED_REBATE": 0,
|
"NEED_REBATE": 0,
|
||||||
"PUSH_MSG": 0
|
"PUSH_MSG": 0,
|
||||||
|
"CLOSE_SCRIPT_BARRAGE": 1
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user