🐞 fix(gvg): 修复gvg显示问题

This commit is contained in:
luying
2023-02-22 21:04:21 +08:00
parent 1190d64d24
commit c9e9184567
6 changed files with 21 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ import { RoleModel } from '../../../db/Role';
import { getFriendRelationType } from '../../../services/friendService';
import { GVGLeagueModel } from '../../../db/GVGLeague';
import { getGroupIdOfServer } from '../../../services/gvg/gvgService';
import { getGuildCodeString } from '../../../services/gvg/gvgRecService';
export default function (app: Application) {
@@ -35,7 +36,7 @@ export class ChatHandler {
const guildCode = session.get('guildCode');
const sid = session.get('sid');
let channelId = '';
let channelId = '', otherInfo = '';
if (channel === CHANNEL_PREFIX.WORLD) channelId = `${serverId}`;
if (channel === CHANNEL_PREFIX.GUILD) channelId = guildCode;
if (channel === CHANNEL_PREFIX.GVG) {
@@ -46,8 +47,9 @@ export class ChatHandler {
let myLeague = await GVGLeagueModel.findLeagueByGuild(guildCode);
if(!myLeague) return resResult(STATUS.GVG_NOT_JOIN_LEAGUE);
channelId = myLeague.leagueCode;
otherInfo = getGuildCodeString(myLeague);
}
const msgData = await createGroupMsg(roleId, roleName, channel, channelId, type, MSG_SOURCE.ROLE_SEND_TEXT, content, targetRoleId, targetMsgCode);
const msgData = await createGroupMsg(roleId, roleName, channel, channelId, type, MSG_SOURCE.ROLE_SEND_TEXT, content, targetRoleId, targetMsgCode, otherInfo);
if (!msgData) return resResult(STATUS.WRONG_PARMS);
await pushGroupMsgToRoom(msgData);