聊天:加入和退出军团时处理频道
This commit is contained in:
@@ -327,13 +327,11 @@ export class GuildHandler {
|
|||||||
|
|
||||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid,rec);
|
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid,rec);
|
||||||
|
|
||||||
hasGuild = true;
|
hasGuild = true;
|
||||||
} else { // 不自动加入,插入申请表
|
} else { // 不自动加入,插入申请表
|
||||||
await UserGuildApplyModel.createUserGuildApply(role, guild, GUILD_APPLY_TYPE.APPLY);
|
await UserGuildApplyModel.createUserGuildApply(role, guild, GUILD_APPLY_TYPE.APPLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
await addRoleToGuildChannel(roleId, sid, code);
|
|
||||||
// 返回
|
// 返回
|
||||||
return resResult(STATUS.SUCCESS, { code, hasGuild });
|
return resResult(STATUS.SUCCESS, { code, hasGuild });
|
||||||
}
|
}
|
||||||
@@ -671,7 +669,8 @@ export class GuildHandler {
|
|||||||
await removeTrainRank(code, roleId, guild.trainId);
|
await removeTrainRank(code, roleId, guild.trainId);
|
||||||
let chatSid = await getGuildChannelSid(code);
|
let chatSid = await getGuildChannelSid(code);
|
||||||
|
|
||||||
this.app.rpc.chat.guildRemote.memberQuit.toServer(chatSid,code, roleId, guild);
|
const { sid } = await getRoleOnlineInfo(roleId);
|
||||||
|
this.app.rpc.chat.guildRemote.memberQuit.toServer(chatSid,code, roleId, guild, sid);
|
||||||
|
|
||||||
// 添加动态
|
// 添加动态
|
||||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [role.roleName]);
|
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [role.roleName]);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { nowSeconds } from "../pubUtils/timeUtil";
|
|||||||
import { pinus } from "pinus";
|
import { pinus } from "pinus";
|
||||||
import { ARMY } from "../pubUtils/dicParam";
|
import { ARMY } from "../pubUtils/dicParam";
|
||||||
import { sendMail } from "./mailService";
|
import { sendMail } from "./mailService";
|
||||||
import { setRank, getMyRank, initSingleRank } from "./redisService";
|
import { setRank, getMyRank, initSingleRank, getRoleOnlineInfo } from "./redisService";
|
||||||
import { GuildRankParam, GuildLeader } from "../domain/rank";
|
import { GuildRankParam, GuildLeader } from "../domain/rank";
|
||||||
import { lockData, lockDataNoRetry } from '../services/redLockService';
|
import { lockData, lockDataNoRetry } from '../services/redLockService';
|
||||||
import { ErrLogModel } from '../db/ErrLog';
|
import { ErrLogModel } from '../db/ErrLog';
|
||||||
@@ -18,6 +18,7 @@ import { MailType, MailModel } from '../db/Mail';
|
|||||||
import { pushMail } from '../pubUtils/interface';
|
import { pushMail } from '../pubUtils/interface';
|
||||||
import { getMailContent } from '../services/mailService';
|
import { getMailContent } from '../services/mailService';
|
||||||
import { DATA_NAME } from '../consts/dataName';
|
import { DATA_NAME } from '../consts/dataName';
|
||||||
|
import { addRoleToGuildChannel } from "./chatService";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 检查该玩家是否有权限做操作
|
* @description 检查该玩家是否有权限做操作
|
||||||
@@ -81,6 +82,10 @@ export async function joinGuild(code: string, guildName: string, lv: number, rol
|
|||||||
await UserGuildApplyModel.deleteApply(roleId); // 删除玩家所有对其他公会的申请
|
await UserGuildApplyModel.deleteApply(roleId); // 删除玩家所有对其他公会的申请
|
||||||
|
|
||||||
res.releaseCallback();//解锁
|
res.releaseCallback();//解锁
|
||||||
|
const { sid } = await getRoleOnlineInfo(roleId);
|
||||||
|
if (sid) {
|
||||||
|
await addRoleToGuildChannel(roleId, sid, code);
|
||||||
|
}
|
||||||
return { status: 0, guild, userGuild, roleName: role.roleName, memberCnt: guild.memberCnt, guildCe: guild.guildCe }
|
return { status: 0, guild, userGuild, roleName: role.roleName, memberCnt: guild.memberCnt, guildCe: guild.guildCe }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user