军团:招募广播消息

This commit is contained in:
luying
2021-01-22 11:03:36 +08:00
4 changed files with 62 additions and 23 deletions

View File

@@ -709,6 +709,7 @@ export class GuildHandler {
//下发邮件
for(let roleId of members) {
let mail = await MailModel.addMail({roleId, goods: [], sendName: roleName, mailId: 1, content: info});
let key = 'login_roleId_' + roleId;
let sid = await getRedis(key);
if (!!sid) {
@@ -718,4 +719,25 @@ 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 });
}
}