feat(gvg): 优化血量继承、实时刷新、遗迹天数、系统播报 6267076fc

This commit is contained in:
luying
2023-10-20 09:55:08 +08:00
parent c2ad7145c1
commit d9f911f520
14 changed files with 371 additions and 98 deletions

View File

@@ -1,6 +1,6 @@
import { isArray, isBoolean, isNumber, isString } from "underscore";
import { BLOCK_OPEATE, DEBUG_MAGIC_WORD, GM_MAIL_TYPE, GUILD_AUTH, GUILD_STRUCTURE, GVG_RESOURCE_TYPE, GVG_SEED_TYPE, LEAGUE_JOB, LINEUP_NUM, MSG_TYPE } from "../consts";
import { pvpEndParamInter } from "../pubUtils/interface";
import { gvgEndParamInter, pvpEndParamInter } from "../pubUtils/interface";
import { isDevelopEnv } from "./utilService";
export function checkRouteParam(route: string, msg: any) {
@@ -1779,6 +1779,8 @@ export function checkRouteParam(route: string, msg: any) {
{
if (!checkNaturalStrings(msg.battleCode)) return false;
if (!checkBoolean(msg.isSuccess)) return false;
if (!checkGvgEndHeroFormat(msg.myHeroes)) return false;
if (!checkGvgEndHeroFormat(msg.oppHeroes)) return false;
break;
}
case "guild.gvgBattleHandler.useItem":
@@ -1818,6 +1820,12 @@ export function checkRouteParam(route: string, msg: any) {
if (!checkStringIfExist(msg.notice)) return false;
break;
}
case "guild.gvgBattleHandler.getOppTeam":
{
if (!checkNaturalNumbers(msg.cityId)) return false;
if (!checkNaturalStrings(msg.teamCode)) return false;
break;
}
case "order.orderHandler.applyOrder":
{
let { productID, payType, activityId, paramStr, useVoucher } = msg;
@@ -2619,6 +2627,17 @@ function checkPvpEndHeroFormat(...params: pvpEndParamInter[][]) {
return true;
}
function checkGvgEndHeroFormat(...params: gvgEndParamInter[][]) {
for (let param of params) {
if (!checkArrayCanEmpty(param)) return false;
for (let { actorId, hp, others } of param) {
if (!checkNaturalNumbers(actorId, hp)) return false;
if (!checkStringIfExist(others)) return false;
}
}
return true;
}
function checkIsInEnum<T>(someEnum: T, value: T) {
return Object.values(someEnum).includes(value)
}