军团活动:修复活动结束信号发送bug

This commit is contained in:
luying
2021-03-25 15:37:03 +08:00
parent 0e8a8245a0
commit 7c0ede3e52
8 changed files with 99 additions and 36 deletions

View File

@@ -1,11 +1,11 @@
import { GroupMessageType } from './../../../db/GroupMessage';
import { Application, ChannelService } from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { ON_ADD_CHANNEL_ROUTE, ON_GROUP_MSG_ROUTE, ON_LEAVE_CHANNEL_ROUTE, STATUS } from '../../../consts';
import { ON_ADD_CHANNEL_ROUTE, ON_GROUP_MSG_ROUTE, ON_LEAVE_CHANNEL_ROUTE, STATUS, CHANNEL_PREFIX } from '../../../consts';
import { PrivateMessageType } from '../../../db/PrivateMessage';
import { addUserToChannel, getSimpleRoleInfo } from '../../../services/roleService';
import { ChannelUser } from '../../../domain/ChannelUser';
import { getWorldChannelSid } from '../../../services/chatService';
import { getWorldChannelSid, groupRoomId } from '../../../services/chatService';
export default function (app: Application) {
return new ChatRemote(app);
@@ -172,7 +172,7 @@ export class ChatRemote {
* @param serverId
*/
public async sendGuildActivityEnd(serverId: number) {
let roomId = await getWorldChannelSid(serverId);
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
let channel = this.channelService.getChannel(roomId, false);
if (!channel) return;
channel.pushMessage(this.GUILD_ACTIVITY_END, resResult(STATUS.SUCCESS, { }));