聊天:添加跑马灯功能
This commit is contained in:
@@ -10,6 +10,7 @@ import { pinus } from 'pinus';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { BossInstanceType } from '../db/BossInstance';
|
||||
import { getSimpleRoleInfo } from './roleService';
|
||||
import { GroupMessageType } from '../db/GroupMessage';
|
||||
|
||||
async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
|
||||
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality', 'star', 'starStage', 'colorStar', 'colorStarStage']);
|
||||
@@ -140,6 +141,15 @@ export async function pushVestigeFirstMsg(roleId: string, roleName: string, serv
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function createMarqueeMsg(roleId: string, roleName: string, serverId: number | string, content: string) {
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.SEND_MARQUEE, content, null, null);
|
||||
return msgData;
|
||||
}
|
||||
|
||||
export async function pushMarqueeMsg(msgData: GroupMessageType) {
|
||||
await pushGroupMsgToRoom(msgData);
|
||||
}
|
||||
|
||||
function shouldPushTowerMsg(lv: number) {
|
||||
// 100 层之后每 50 层触发
|
||||
return lv >= 100 && lv % 50 === 0;
|
||||
|
||||
Reference in New Issue
Block a user