军团活动:蛮夷入侵定时任务及推送

This commit is contained in:
luying
2021-03-18 21:07:06 +08:00
parent 2cf3b0ffe0
commit 7e7be94688
11 changed files with 289 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ import { ON_ADD_CHANNEL_ROUTE, ON_GROUP_MSG_ROUTE, ON_LEAVE_CHANNEL_ROUTE, STATU
import { PrivateMessageType } from '../../../db/PrivateMessage';
import { addUserToChannel, getSimpleRoleInfo } from '../../../services/roleService';
import { ChannelUser } from '../../../domain/ChannelUser';
import { getWorldChannelSid } from '../../../services/chatService';
export default function (app: Application) {
return new ChatRemote(app);
@@ -29,6 +30,7 @@ export class ChatRemote {
}
private channelService: ChannelService;
private GUILD_ACTIVITY_END = 'onGuildActivityEnd';
/**
* 加入世界频道(分服).
@@ -163,4 +165,16 @@ export class ChatRemote {
public async sendPrivateMsg(msg: Partial<PrivateMessageType>) {
}
/**
* @description 全服推送活动结束通知
* @param serverId
*/
public async sendGuildActivityEnd(serverId: number) {
let roomId = await getWorldChannelSid(serverId);
let channel = this.channelService.getChannel(roomId, false);
if (!channel) return;
channel.pushMessage(this.GUILD_ACTIVITY_END, resResult(STATUS.SUCCESS, { }));
}
}