世界消息

This commit is contained in:
luying
2021-01-22 09:46:40 +08:00
parent b2785450ac
commit 65320fb9e0
3 changed files with 65 additions and 21 deletions

View File

@@ -14,6 +14,7 @@ import { UserGuildApplyModel } from '../../../db/UserGuildApply';
import { hasStructureConsume, getStructureConsume, gameData } from '../../../pubUtils/data';
import { GuildRecModel } from '../../../db/GuildRec';
import { MailModel } from '../../../db/Mail';
import { getRedis } from '../../../services/redisService';
export default function (app: Application) {
return new GuildHandler(app);
@@ -717,4 +718,26 @@ export class GuildHandler {
return resResult(STATUS.SUCCESS, { isSuccess: true });
}
// 团长发送世界频道
async recruit(msg: { code: string, info: string }, session: BackendSession) {
const roleId = session.get('roleId');
// const roleName = session.get('roleName');
const sid = session.get('sid');
const serverId = session.get('serverId');
const { code, info } = msg;
const checkResult = await checkAuth(GUILD_OPERATE.RECRUIT, roleId, code);
if (!checkResult) return resResult(STATUS.GUILD_AUTH_NOT_ENOUGH);
const guild = await GuildModel.findByCode(code, serverId);
if(!guild) return resResult(STATUS.GUILD_NOT_FOUND);
// 发送世界频道消息
this.app.rpc.chat.chatRemote.sendWorldMessage.toServer('chat-server-1', serverId, { info });
return resResult(STATUS.SUCCESS, { isSuccess: true });
}
}