🐞 fix(路由): 诸侯混战和gvg激战期路由修改

This commit is contained in:
luying
2023-05-29 19:42:59 +08:00
parent fc633f6a7b
commit 7327144feb

View File

@@ -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}`;
}
}
}