聊天:军团建筑升级只推送升级的数据
This commit is contained in:
@@ -780,7 +780,7 @@ export class GuildHandler {
|
|||||||
this.app.rpc.chat.guildRemote.addRec.toServer(CHAT_SERVER,rec);
|
this.app.rpc.chat.guildRemote.addRec.toServer(CHAT_SERVER,rec);
|
||||||
|
|
||||||
// 军团频道聊天消息
|
// 军团频道聊天消息
|
||||||
pushGuildUpStructureMsg(roleId, roleName, result);
|
pushGuildUpStructureMsg(roleId, roleName, result, resultStructure);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, result);
|
return resResult(STATUS.SUCCESS, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 { 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 { createGroupMsg, pushGroupMsgToRoom } from './chatService';
|
||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
import { isArray, isString } from 'underscore';
|
import { isString } from 'underscore';
|
||||||
import { pinus } from 'pinus';
|
import { pinus } from 'pinus';
|
||||||
import { resResult } from '../pubUtils/util';
|
import { resResult } from '../pubUtils/util';
|
||||||
import { BossInstanceType } from '../db/BossInstance';
|
import { BossInstanceType } from '../db/BossInstance';
|
||||||
@@ -53,10 +53,9 @@ export async function pushGuildNoticeUpdateMsg(roleId: string, roleName: string,
|
|||||||
return msgData;
|
return msgData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function pushGuildUpStructureMsg(roleId: string, roleName: string, guildInfo: Partial<GuildType>) {
|
export async function pushGuildUpStructureMsg(roleId: string, roleName: string, guildInfo: Partial<GuildType>, structure: {id: number, lv: number}) {
|
||||||
const { code, structure } = guildInfo;
|
const { code, name } = guildInfo;
|
||||||
if (!code || !structure || !isArray(structure)) return null;
|
const guild = { code, name, structure };
|
||||||
const guild = pick(guildInfo, ['code', 'structure', 'name']);
|
|
||||||
const content = JSON.stringify({ roleId, roleName, guild });
|
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);
|
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);
|
await pushGroupMsgToRoom(msgData);
|
||||||
|
|||||||
Reference in New Issue
Block a user