✨ feat(gvg): 组建期聊天和邮件
This commit is contained in:
@@ -17,6 +17,7 @@ import { sendMessageToAllWithSuc, sendMessageToCityWithSuc, sendMessageToGuildWi
|
||||
import { comBtlLvInvalid } from './comBattleService';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { RegionModel } from '../db/Region';
|
||||
import { getGroupIdOfServer, getServersByGroupId } from './gvg/gvgService';
|
||||
|
||||
export * from './chatChannelService';
|
||||
export * from './sysChatService';
|
||||
@@ -163,6 +164,12 @@ export async function pushGroupMsgToRoom(msg: GroupMessageType) {
|
||||
} else if (msg.channel == CHANNEL_PREFIX.CITY) {
|
||||
let arr = msg.channelId.split('_');
|
||||
await sendMessageToCityWithSuc(parseInt(arr[0]), parseInt(arr[1]), PUSH_ROUTE.GROUP_MSG, { ...msg, roleInfo });
|
||||
} else if (msg.channel == CHANNEL_PREFIX.GVG) {
|
||||
let groupId = parseInt(msg.channelId);
|
||||
let serverIds = await getServersByGroupId(groupId);
|
||||
for(let serverId of serverIds) {
|
||||
await sendMessageToServerWithSuc(serverId, PUSH_ROUTE.GROUP_MSG, { ...msg, roleInfo });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,6 +222,20 @@ async function recentGroupMsgs(roomId: string, count?: number) {
|
||||
return result.filter(cur => cur) || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取最近的战区聊天消息
|
||||
* @export
|
||||
* @param {number} serverId 用区服编号做房间标识
|
||||
* @param {number} [count]
|
||||
* @returns
|
||||
*/
|
||||
export async function recentServerGroupMsgs(serverId: number, count?: number) {
|
||||
let groupId = await getGroupIdOfServer(serverId);
|
||||
console.log('####', groupId);
|
||||
const result = await recentGroupMsgs(groupRoomId(CHANNEL_PREFIX.GVG, groupId), count);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取最近的世界聊天消息
|
||||
* @export
|
||||
|
||||
Reference in New Issue
Block a user