红点:军团活动推送

This commit is contained in:
luying
2021-06-16 14:49:51 +08:00
parent d794deffad
commit bc2b89042f
5 changed files with 45 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import { ChannelUser } from '../../../domain/ChannelUser';
import { getWorldChannelSid, groupRoomId } from '../../../services/chatService';
import { reloadResources } from '../../../pubUtils/data';
import { GeneralRankParamRole, GeneralRankParamBattle } from '../../../domain/rank';
import { getAllGuildActivityStatus } from '../../../services/guildActivityService';
export default function (app: Application) {
return new ChatRemote(app);
@@ -35,6 +36,7 @@ export class ChatRemote {
private GUILD_ACTIVITY_END = 'onGuildActivityEnd';
private RACE_ACTIVITY_START = 'onRaceStart';
private RANK_TOP_UPDATE = 'onRankTopUpdated';
private GUILD_ACTIVITY_STATUS_UPDATE = 'onGuildActivityStatus'; // 军团活动状态变化
/**
* 加入世界频道(分服).
@@ -210,4 +212,17 @@ export class ChatRemote {
public async reloadResources() {
reloadResources();
}
/**
* @description 全服推送军团活动状态变化
* @param serverId
*/
public async sendGuildActivityUpdate(serverId: number) {
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
let channel = this.channelService.getChannel(roomId, false);
if (!channel) return;
let guildActivities = getAllGuildActivityStatus();
channel.pushMessage(this.GUILD_ACTIVITY_STATUS_UPDATE, resResult(STATUS.SUCCESS, { guildActivities }));
}
}