✨ feat(gvg): 添加推送
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Channel, pinus } from "pinus";
|
||||
import { CHANNEL_PREFIX, PUSH_BATCH, PUSH_INTERVAL, PUSH_ROUTE, STATUS } from "../consts";
|
||||
import { genCode, resResult } from "../pubUtils/util";
|
||||
import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId, getGroupShopSid } from "./chatService";
|
||||
import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId, getGroupShopSid, getGVGAreaChannelSid, getGVGAreaTeamChannelSid } from "./chatService";
|
||||
import { getAllOnlineRoles, getAllServers, getRoleOnlineInfo } from "./redisService";
|
||||
import { errlogger, infologger } from '../util/logger';
|
||||
import { MsgEncrypt } from "../pubUtils/sysUtil";
|
||||
@@ -61,6 +61,18 @@ export async function sendMessageToGuild(guildCode: string, route: string, data:
|
||||
await pinus.app.rpc.chat.chatRemote.pushMessage.toServer(channelSid, roomId, route, data);
|
||||
}
|
||||
|
||||
export async function sendMessageToGVGAreaWithSuc(groupId: number, serverType: number, areaId: number, route: string, data: any) {
|
||||
let channelSid = await getGVGAreaChannelSid(groupId, serverType, areaId);
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.GVG_AREAS, `${groupId}_${serverType}_${areaId}`);
|
||||
await pinus.app.rpc.chat.chatRemote.pushMessage.toServer(channelSid, roomId, route, data);
|
||||
}
|
||||
|
||||
export async function sendMessageToGVGAreaByTeamWithSuc(groupId: number, serverType: number, areaId: number, route: string, data: any) {
|
||||
let channelSid = await getGVGAreaTeamChannelSid(groupId, serverType, areaId);
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.GVG_AREA_BY_TEAM, `${groupId}_${serverType}_${areaId}`);
|
||||
await pinus.app.rpc.chat.chatRemote.pushMessage.toServer(channelSid, roomId, route, data);
|
||||
}
|
||||
|
||||
export async function sendMessageToCityWithSuc(serverId: number, cityId: number, route: string, data: any) {
|
||||
await sendMessageToCity(serverId, cityId, route, resResult(STATUS.SUCCESS, data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user