红点:推送排行榜总榜
This commit is contained in:
@@ -7,6 +7,7 @@ import { addUserToChannel, getSimpleRoleInfo } from '../../../services/roleServi
|
||||
import { ChannelUser } from '../../../domain/ChannelUser';
|
||||
import { getWorldChannelSid, groupRoomId } from '../../../services/chatService';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { GeneralRankParamRole, GeneralRankParamBattle } from '../../../domain/rank';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new ChatRemote(app);
|
||||
@@ -33,6 +34,7 @@ export class ChatRemote {
|
||||
private channelService: ChannelService;
|
||||
private GUILD_ACTIVITY_END = 'onGuildActivityEnd';
|
||||
private RACE_ACTIVITY_START = 'onRaceStart';
|
||||
private RANK_TOP_UPDATE = 'onRankTopUpdated';
|
||||
|
||||
/**
|
||||
* 加入世界频道(分服).
|
||||
@@ -190,6 +192,18 @@ export class ChatRemote {
|
||||
channel.pushMessage(this.RACE_ACTIVITY_START, resResult(STATUS.SUCCESS, { }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 全服推送排行榜更新信息
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendRankTopUpdated(serverId: number, rank: (GeneralRankParamRole|GeneralRankParamBattle)&{general: number}) {
|
||||
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
channel.pushMessage(this.RANK_TOP_UPDATE, resResult(STATUS.SUCCESS, { rank }));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user