军团:更新排行榜信息
This commit is contained in:
@@ -78,7 +78,7 @@ export class GmRoleHandler {
|
|||||||
let params = new GuildFormParam(msg);
|
let params = new GuildFormParam(msg);
|
||||||
if(!params.checkParams()) return resResult(STATUS.WRONG_PARMS);
|
if(!params.checkParams()) return resResult(STATUS.WRONG_PARMS);
|
||||||
|
|
||||||
let guild = await GuildModel.findByCode(params.code);
|
let guild = await GuildModel.findByCode(params.code, null, '+members');
|
||||||
let structure = guild.structure||[];
|
let structure = guild.structure||[];
|
||||||
|
|
||||||
let updateParams: GuildUpdateParam = { code: params.code };
|
let updateParams: GuildUpdateParam = { code: params.code };
|
||||||
@@ -118,7 +118,12 @@ export class GmRoleHandler {
|
|||||||
// 设置玩家名
|
// 设置玩家名
|
||||||
if(updateParams.name != undefined || updateParams.lv != undefined) {
|
if(updateParams.name != undefined || updateParams.lv != undefined) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
if(updateParams.name != undefined) arr.push({ field: 'name', value: updateParams.name });
|
if(updateParams.name != undefined) {
|
||||||
|
arr.push({ field: 'name', value: updateParams.name });
|
||||||
|
for(let roleId of guild.members) {
|
||||||
|
await updateUserInfo(REDIS_KEY.USER_INFO, roleId, [{ field: 'guildName', value: updateParams.name }]);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(updateParams.lv != undefined) arr.push({ field: 'lv', value: updateParams.lv });
|
if(updateParams.lv != undefined) arr.push({ field: 'lv', value: updateParams.lv });
|
||||||
await updateUserInfo(REDIS_KEY.GUILD_INFO, params.code, arr);
|
await updateUserInfo(REDIS_KEY.GUILD_INFO, params.code, arr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export class GuildHandler {
|
|||||||
if (checkNameResult) return resResult(STATUS.GUILD_NAME_DUP);
|
if (checkNameResult) return resResult(STATUS.GUILD_NAME_DUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
const select = ['code', 'name', 'notice', 'introduce', 'ceLimit', 'isAuto', 'icon'];
|
const select = ['code', 'name', 'notice', 'introduce', 'ceLimit', 'isAuto', 'icon', '+members'];
|
||||||
let updateInfo: GuildUpdateParam = {};
|
let updateInfo: GuildUpdateParam = {};
|
||||||
if(name != undefined) updateInfo.name = name;
|
if(name != undefined) updateInfo.name = name;
|
||||||
if(notice != undefined) updateInfo.notice = notice;
|
if(notice != undefined) updateInfo.notice = notice;
|
||||||
@@ -152,7 +152,12 @@ export class GuildHandler {
|
|||||||
let chatSid = await getGuildChannelSid(code);
|
let chatSid = await getGuildChannelSid(code);
|
||||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { name, notice, introduce, ceLimit, isAuto });
|
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { name, notice, introduce, ceLimit, isAuto });
|
||||||
|
|
||||||
if(name != undefined) await updateUserInfo(REDIS_KEY.GUILD_INFO, code, [{ field: 'name', value: name }]);
|
if(name != undefined) {
|
||||||
|
await updateUserInfo(REDIS_KEY.GUILD_INFO, code, [{ field: 'name', value: name }]);
|
||||||
|
for(let roleId of guild.members) {
|
||||||
|
await updateUserInfo(REDIS_KEY.USER_INFO, roleId, [{ field: 'guildName', value: name }]);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (notice != undefined) {
|
if (notice != undefined) {
|
||||||
pushGuildNoticeUpdateMsg(roleId, roleName, guild);
|
pushGuildNoticeUpdateMsg(roleId, roleName, guild);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export async function treatGuildName(content: string) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let guild = await GuildModel.findByCode(params.code, params.serverId);
|
let guild = await GuildModel.findByCode(params.code, params.serverId, '+members');
|
||||||
if(guild && guild.sdkMark) { // 有设置标记的情况下
|
if(guild && guild.sdkMark) { // 有设置标记的情况下
|
||||||
if(params.type == 1) { // 公会名
|
if(params.type == 1) { // 公会名
|
||||||
let newName = "默认公会名";
|
let newName = "默认公会名";
|
||||||
@@ -143,6 +143,9 @@ export async function treatGuildName(content: string) {
|
|||||||
let chatSid = await getGuildChannelSid(params.code);
|
let chatSid = await getGuildChannelSid(params.code);
|
||||||
pinus.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, params.code, { name: newName }); // 军团推送
|
pinus.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, params.code, { name: newName }); // 军团推送
|
||||||
await updateUserInfo(REDIS_KEY.GUILD_INFO, params.code, [{ field: 'name', value: newName }]); // redis缓存信息
|
await updateUserInfo(REDIS_KEY.GUILD_INFO, params.code, [{ field: 'name', value: newName }]); // redis缓存信息
|
||||||
|
for(let roleId of guild.members) {
|
||||||
|
await updateUserInfo(REDIS_KEY.USER_INFO, roleId, [{ field: 'guildName', value: newName }]);
|
||||||
|
}
|
||||||
await RoleModel.updateGuildName(params.code, newName);
|
await RoleModel.updateGuildName(params.code, newName);
|
||||||
|
|
||||||
} else if (params.type == 2) { // 公会公告
|
} else if (params.type == 2) { // 公会公告
|
||||||
|
|||||||
Reference in New Issue
Block a user