聊天:内联推送条件

This commit is contained in:
liangtongchuan
2021-03-11 14:16:36 +08:00
parent f23c29b647
commit 6bf7c2cf69
2 changed files with 9 additions and 7 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
import { EPlace, HeroType } from '../db/Hero';
import { GuildType } from '../db/Guild';
import { CHANNEL_PREFIX, 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 { pick } from 'lodash';
import { isArray, isString } from 'underscore';
@@ -21,10 +21,16 @@ export async function pushHeroQualityUpMsg(roleId: string, roleName: string, ser
}
export async function pushComposeOrangeHero(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
if (heroInfo.quality < HERO_INITIAL_QUALITY.ORANGE) {
return;
}
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.COMPOSE_ORANGE_HERO, heroInfo);
}
export async function pushHeroStarMax(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
if (heroInfo.star !== HERO_GROW_MAX.STAR) {
return;
}
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_STAR_MAX, heroInfo);
}