优化:抽象推送方法
This commit is contained in:
@@ -11,7 +11,6 @@ import { GM_MAIL_STATUS, GM_MAIL_TYPE, MAIL_TIME_TYPE, REF_CIRCLE_MAIL_TIME } fr
|
||||
import { RewardInter } from '../../../pubUtils/interface';
|
||||
import { MarqueeModel } from '../../../db/Marquee';
|
||||
import { ServerlistModel } from '../../../db/Serverlist';
|
||||
import { pushCurrentTime } from '../../../services/chatService';
|
||||
import { checkActivityEditable, checkActivityGroupType, checkActivityGroupTypeWithId } from '../../../services/activity/activityService';
|
||||
import { ActivityModel } from '../../../db/Activity';
|
||||
import { ActivityGroupModel } from '../../../db/ActivityGroup';
|
||||
@@ -23,6 +22,7 @@ import moment = require('moment');
|
||||
import { sendUngotDividend } from '../../../services/auctionService';
|
||||
import { taflush } from '../../../services/sdkService';
|
||||
import { ActivityInRemote } from '../../../domain/activityField/activityField';
|
||||
import { pushCurrentTime } from '../../../services/auctionService';
|
||||
let timer: NodeJS.Timer;
|
||||
export default function (app: Application) {
|
||||
return new GmHandler(app);
|
||||
|
||||
@@ -22,6 +22,7 @@ import { SkinModel } from '../../../db/Skin';
|
||||
import { PvpDefenseModel } from '../../../db/PvpDefense';
|
||||
import { createHeroes } from '../../../services/role/createHero';
|
||||
import { calculateCeWithHero } from '../../../services/playerCeService';
|
||||
import { pushChangeGuildLeader, pushGuildDismiss, pushGuildInfoUpdate } from '../../../services/guildService';
|
||||
|
||||
let timer: NodeJS.Timer;
|
||||
export default function (app: Application) {
|
||||
@@ -163,9 +164,7 @@ export class GmRoleHandler {
|
||||
}
|
||||
}
|
||||
updateParams.structure = structure;
|
||||
let chatSid = await getGuildChannelSid(params.code);
|
||||
console.log('*****', params.code, updateParams)
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, params.code, updateParams);
|
||||
await pushGuildInfoUpdate(params.code, updateParams);
|
||||
// 设置玩家名
|
||||
if(updateParams.name != undefined || updateParams.lv != undefined) {
|
||||
let arr = [];
|
||||
@@ -206,10 +205,7 @@ export class GmRoleHandler {
|
||||
await this.app.rpc.connector.connectorRemote.setOtherUserGuildSession.broadcast(members.map(roleId => { return { roleId, userGuild: null } })); // 更新session
|
||||
|
||||
// 删除channel
|
||||
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
this.app.rpc.chat.guildRemote.dismiss.toServer(chatSid, code);
|
||||
|
||||
await pushGuildDismiss(code);
|
||||
let r = new Rank(REDIS_KEY.GUILD_ACTIVE_RANK, { serverId });
|
||||
await r.removeFromRank({ guildCode: code });
|
||||
let r2 = new Rank(REDIS_KEY.GUILD_LV_RANK, { serverId });
|
||||
@@ -247,9 +243,7 @@ export class GmRoleHandler {
|
||||
guild = await GuildModel.updateInfo(code, { leader: role._id }, { managerCnt: managerCntInc }, 'managerCnt name'); // 如果有转让团长设置leader
|
||||
|
||||
// 添加动态
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
|
||||
this.app.rpc.chat.guildRemote.changeLeader.toServer(chatSid, code, guild.managerCnt, role, leader.roleId);
|
||||
await pushChangeGuildLeader(code, guild.managerCnt, role, leader.roleId);
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_IMPEACH, leader.roleId, { params: [guild.name] });
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_SET_LEADER, roleId, { params: [guild.name] });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user