聊天:组队聊天和测试
This commit is contained in:
@@ -7,7 +7,7 @@ import { PrivateMessageModel, PrivateMessageParam, PrivateMessageType } from './
|
||||
import { GroupMessageParam, GroupMessageType } from '../db/GroupMessage';
|
||||
import { genCode, resResult } from '../pubUtils/util';
|
||||
import { pinus } from 'pinus';
|
||||
import { CHANNEL_PREFIX, MSG_CODE_LEN, MSG_SOURCE, MSG_STATUS, MSG_TYPE, ON_MSG_ROUTE, RICH_TEXT_TABLE } from '../consts';
|
||||
import { CHANNEL_PREFIX, MSG_CODE_LEN, MSG_SOURCE, MSG_STATUS, MSG_TYPE, ON_GROUP_MSG_ROUTE, ON_MSG_ROUTE, RICH_TEXT_TABLE } from '../consts';
|
||||
import { addRedisChannel, getRoleOnlineInfo, redisChannelServer } from './redisService';
|
||||
import { crc32 } from 'crc';
|
||||
import { HeroType } from '../db/Hero';
|
||||
@@ -222,3 +222,11 @@ export async function pushComposeOrangeHero(roleId: string, roleName: string, se
|
||||
export async function pushHeroStarMax(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
|
||||
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_STAR_MAX, heroInfo);
|
||||
}
|
||||
|
||||
export async function pushComBtlTeamMsg(teamCode: string, roleId: string, roleName: string, type: number, source: number, content: string, targetRoleId: string, targetMsgCode: string) {
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
|
||||
if (!msgData) return null;
|
||||
const channel = pinus.app.get('channelService').getChannel(teamCode);
|
||||
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, msgData));
|
||||
return msgData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user