From 9bb07f5b21831fdfbd7c0b64b9885a44b1018fed Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Thu, 18 Mar 2021 15:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=EF=BC=9A=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E5=BB=BA=E7=AD=91=E5=8D=87=E7=BA=A7=E5=8F=AA=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/battle/handler/guildHandler.ts | 2 +- game-server/app/services/sysChatService.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/game-server/app/servers/battle/handler/guildHandler.ts b/game-server/app/servers/battle/handler/guildHandler.ts index 823fe7f87..767fbba22 100644 --- a/game-server/app/servers/battle/handler/guildHandler.ts +++ b/game-server/app/servers/battle/handler/guildHandler.ts @@ -780,7 +780,7 @@ export class GuildHandler { this.app.rpc.chat.guildRemote.addRec.toServer(CHAT_SERVER,rec); // 军团频道聊天消息 - pushGuildUpStructureMsg(roleId, roleName, result); + pushGuildUpStructureMsg(roleId, roleName, result, resultStructure); return resResult(STATUS.SUCCESS, result); } diff --git a/game-server/app/services/sysChatService.ts b/game-server/app/services/sysChatService.ts index fc5fe24b7..69fc2f8da 100644 --- a/game-server/app/services/sysChatService.ts +++ b/game-server/app/services/sysChatService.ts @@ -5,7 +5,7 @@ import { GuildType } from '../db/Guild'; import { CHANNEL_PREFIX, HERO_GROW_MAX, HERO_INITIAL_QUALITY, MSG_SOURCE, MSG_TYPE, ON_GROUP_MSG_ROUTE, STATUS, WAR_TYPE } from '../consts'; import { createGroupMsg, pushGroupMsgToRoom } from './chatService'; import { pick } from 'lodash'; -import { isArray, isString } from 'underscore'; +import { isString } from 'underscore'; import { pinus } from 'pinus'; import { resResult } from '../pubUtils/util'; import { BossInstanceType } from '../db/BossInstance'; @@ -53,10 +53,9 @@ export async function pushGuildNoticeUpdateMsg(roleId: string, roleName: string, return msgData; } -export async function pushGuildUpStructureMsg(roleId: string, roleName: string, guildInfo: Partial) { - const { code, structure } = guildInfo; - if (!code || !structure || !isArray(structure)) return null; - const guild = pick(guildInfo, ['code', 'structure', 'name']); +export async function pushGuildUpStructureMsg(roleId: string, roleName: string, guildInfo: Partial, structure: {id: number, lv: number}) { + const { code, name } = guildInfo; + const guild = { code, name, structure }; const content = JSON.stringify({ roleId, roleName, guild }); const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.GUILD, code, MSG_TYPE.RICH_TEXT, MSG_SOURCE.GUILD_STRUCTURE_LV_UP, content, null, null); await pushGroupMsgToRoom(msgData);