feat(gvg): 添加激战期战斗录像支持

This commit is contained in:
liangtongchuan
2023-02-24 20:22:41 +08:00
parent 6bbd5e9dd3
commit f9bd5a76eb
3 changed files with 13 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import { getRandEelmWithWeight } from 'app/pubUtils/util';
import { getLocalRplUrl, getRemoteRplUrl } from 'app/pubUtils/battleUtils'
import { ChannelInfoModel } from '@db/ChannelInfo';
import { GVGVestigeRecModel } from '@db/GVGVestigeRec';
import { GVGBattleRecModel } from '@db/GVGBattleRec';
const sendToWormhole = require('stream-wormhole');
const pump = require('mz-modules/pump');
@@ -224,7 +225,7 @@ export default class GameController extends Controller {
if (!battleRec) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_NOT_FOUND);
let { warType, roleId } = battleRec;
if (warType !== WAR_TYPE.PVP && warType !== WAR_TYPE.LADDER && warType !== WAR_TYPE.GVG_VESTIGE) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_RPL_NOT_SUPPORT);
if (warType !== WAR_TYPE.PVP && warType !== WAR_TYPE.LADDER && warType !== WAR_TYPE.GVG_VESTIGE && warType !== WAR_TYPE.GVG_BATTLE) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_RPL_NOT_SUPPORT);
writePath = getLocalRplUrl(roleId, warType, battleCode);
try {
@@ -249,6 +250,8 @@ export default class GameController extends Controller {
updateDBRes = await LadderMatchRecModel.updateRplStatus(battleCode, true);
} else if (warType == WAR_TYPE.GVG_VESTIGE) {
updateDBRes = await GVGVestigeRecModel.updateRplStatus(battleCode, true);
} else if (warType == WAR_TYPE.GVG_BATTLE) {
updateDBRes = await GVGBattleRecModel.updateRplStatus(battleCode, true);
}
if (!updateDBRes) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_RPL_UPDATE_ERR);
remoteUrl = `${getRemoteRplUrl(ctx.app.config.realEnv, roleId, warType, battleCode)}/${battleCode}.bin`;