diff --git a/game-server/app/util/routeUtil.ts b/game-server/app/util/routeUtil.ts index a1113f946..f87527a3d 100644 --- a/game-server/app/util/routeUtil.ts +++ b/game-server/app/util/routeUtil.ts @@ -2,6 +2,8 @@ import { dispatch } from '../pubUtils/dispatcher'; import { Session, Application } from 'pinus'; import { redisClient } from '../services/redisService'; +import { getGroupIdOfServer } from '../services/serverService'; +import { SERVER_GROUP_FUN_TYPE } from '../consts'; export async function chat(session: Session, msg: any, app: Application, cb: (err: Error, serverId?: string) => void) { let chatServers = app.getServersByType('chat'); @@ -96,10 +98,10 @@ export async function guild(session: Session, msg: any, app: Application, cb: (e 'guild.cityActivityHandler.hitGate', 'guild.cityActivityHandler.battleEnd' ].indexOf(arg.route) !== -1) { - if (arg.body.cityId) { + let serverId = session.get('serverId'); needDispatch = true; - rid = arg.body.cityId.toString(); + rid = `${serverId}_${arg.body.cityId}`; } } else if (['guild.raceActivityHandler.getRaceActivity', 'guild.raceActivityHandler.leavePage', @@ -131,8 +133,10 @@ export async function guild(session: Session, msg: any, app: Application, cb: (e 'guild.gvgBattleHandler.debugAttacks', ].indexOf(arg.route) !== -1) { if (arg.body.cityId) { + let serverId = session.get('serverId'); + let groupId = await getGroupIdOfServer(serverId, SERVER_GROUP_FUN_TYPE.GVG); needDispatch = true; - rid = arg.body.cityId.toString(); + rid = `${groupId}_${arg.body.cityId}`; } } }