diff --git a/game-server/app/servers/connector/filter/global.ts b/game-server/app/servers/connector/filter/global.ts index b8ed3b920..427b1fdda 100644 --- a/game-server/app/servers/connector/filter/global.ts +++ b/game-server/app/servers/connector/filter/global.ts @@ -10,7 +10,7 @@ import { getServerMainten } from "../../../services/gmService"; import { errlogger, infologger } from "../../../util/logger"; import { gameData } from "../../../pubUtils/data"; import { sendMessageToUser } from "../../../services/pushService"; -import { isCheckWord } from "../../../pubUtils/sdkUtil"; +import { isCheckWord, isSkipEncode } from "../../../pubUtils/sdkUtil"; import { isDevelopEnv } from "../../../services/utilService"; import { isNumber } from "underscore"; import { redisClient } from "../../../services/redisService"; @@ -53,7 +53,7 @@ class Filter { if(!this.checkFunction(routeRecord.route)) { return next(new Error('globalFilter'), resResult(STATUS.FUNCTION_CLOSE, { route: routeRecord.route })); } - + if(!checkRouteParam(routeRecord.route, msg)) { return next(new Error('globalFilter'), resResult(STATUS.WRONG_PARMS, { route: routeRecord.route })); } @@ -140,7 +140,7 @@ class Filter { // 这个接口是否需要加密解密 private checkPassEncrypt (route: string) { - return route.startsWith('gm.') || route == 'connector.entryHandler.gmEnter'; + return isSkipEncode(isDevelopEnv()) || route.startsWith('gm.') || route == 'connector.entryHandler.gmEnter' || route == 'gate.gateHandler.queryEntry'; } // 解密接口 diff --git a/game-server/app/servers/gate/handler/gateHandler.ts b/game-server/app/servers/gate/handler/gateHandler.ts index 9a8a99ca4..ca4b5b65e 100644 --- a/game-server/app/servers/gate/handler/gateHandler.ts +++ b/game-server/app/servers/gate/handler/gateHandler.ts @@ -1,6 +1,6 @@ import { STATUS } from './../../../consts/statusCode'; import { dispatch } from '../../../pubUtils/dispatcher'; -import { Application, BackendSession, HandlerService, } from 'pinus'; +import { Application, BackendSession, HandlerService, pinus, } from 'pinus'; import { resResult } from '../../../pubUtils/util'; export default function (app: Application) { diff --git a/game-server/app/services/pushService.ts b/game-server/app/services/pushService.ts index 59714634f..3a9b248a6 100644 --- a/game-server/app/services/pushService.ts +++ b/game-server/app/services/pushService.ts @@ -5,6 +5,8 @@ import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId import { getAllOnlineRoles, getRoleOnlineInfo } from "./redisService"; import { errlogger, infologger } from '../util/logger'; import { MsgEncrypt } from "../pubUtils/sysUtil"; +import { isSkipEncode } from "../pubUtils/sdkUtil"; +import { isDevelopEnv } from "./utilService"; export async function sendMessageToAllWithSuc(route: string, data: any, filterCb?: ({ lv, topLineupCe }) => boolean) { await sendMessageToAll(route, resResult(STATUS.SUCCESS, data), filterCb); @@ -181,7 +183,7 @@ function encryptMsg(event: string, json: any) { } function checkNotEncryptRoute(event: string) { - return [ + return isSkipEncode(isDevelopEnv()) || [ PUSH_ROUTE.PUSH_CURRENT_TIME, PUSH_ROUTE.RACE_START, PUSH_ROUTE.GUILD_ACTIVITY_END, diff --git a/shared/pubUtils/dictionary/DicServerConst.ts b/shared/pubUtils/dictionary/DicServerConst.ts index 8d9d2ebf3..bab966733 100644 --- a/shared/pubUtils/dictionary/DicServerConst.ts +++ b/shared/pubUtils/dictionary/DicServerConst.ts @@ -39,6 +39,8 @@ export interface DicServerConst { readonly TIME_STAMP_OVER: number; // 请求参数过期时间 readonly ACCESS_CODE_EXPIRE_TIME: number; + // 是否跳过加密 + readonly SKIP_ENCODE: number; } export const dicServerConst: DicServerConst = {} as DicServerConst; diff --git a/shared/pubUtils/sdkUtil.ts b/shared/pubUtils/sdkUtil.ts index b193f9e88..df08c1d8f 100644 --- a/shared/pubUtils/sdkUtil.ts +++ b/shared/pubUtils/sdkUtil.ts @@ -161,4 +161,8 @@ export function isCheckWord(isDevelop = false) { export function canPay() { return gameData.serverConst.CAN_PAY === 1; +} + +export function isSkipEncode(isDevelop = false) { + return gameData.serverConst.SKIP_ENCODE === 1 && isDevelop; } \ No newline at end of file diff --git a/shared/resource/jsons/server_const.json b/shared/resource/jsons/server_const.json index ed329d3f1..deb97f066 100644 --- a/shared/resource/jsons/server_const.json +++ b/shared/resource/jsons/server_const.json @@ -21,5 +21,6 @@ "DEBUG_PAY": 0, "DEBUG_TIME": 1, "CHECK_WORD": 1, - "CAN_PAY": 1 + "CAN_PAY": 1, + "SKIP_ENCODE": 0 } \ No newline at end of file