优化:抽象推送方法
This commit is contained in:
@@ -6,7 +6,7 @@ import { difference } from 'underscore';
|
||||
* @Last Modified by: 梁桐川
|
||||
* @Last Modified time: 2021-08-27 17:47:56
|
||||
*/
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, MSG_SOURCE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON, getChannelType, CHANNEL_PREFIX, DEBUG_MAGIC_WORD } from './../../../consts';
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, MSG_SOURCE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON, getChannelType, CHANNEL_PREFIX, DEBUG_MAGIC_WORD, PUSH_ROUTE } from './../../../consts';
|
||||
import Role, { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
@@ -18,8 +18,7 @@ import { checkRoleInQueue, rmRoleFromQueue, setTeamSearchReq } from '../../../se
|
||||
import { getRandBlueprtId, clearComBtlTimer, getFrd, updateRobotHurtByTime, comBtlLvInvalid, clearRobotHurtTimer, setDismissTimer, dismissTeam, handleComBtlProgress, getComBattleFriendAdd, teammateInBlackList, blueprtIdValid, hasEnoughBlueprt, addRoleToTeam, addRoleStToTeam, addValidSearchingRoles, validToJoin, addRobotsToTeam, addRobotsLater, teamIsFullToStart, oneTeamNotInBlack, getAllAssistCnt, checkHasMyTeam } from '../../../services/comBattleService';
|
||||
import { setAp } from '../../../services/actionPointService';
|
||||
import { roleLevelup } from '../../../services/normalBattleService';
|
||||
import { addUserToChannel, getSimpleRoleInfo } from '../../../services/roleService';
|
||||
import { ChannelUser } from '../../../domain/ChannelUser';
|
||||
import { getSimpleRoleInfo } from '../../../services/roleService';
|
||||
import { pushComBtlTeamMsg, pushFriendTeamInviteMsg, pushNormalItemMsg, pushTeamInviteMsg } from '../../../services/chatService';
|
||||
import { EXTERIOR } from '../../../pubUtils/dicParam';
|
||||
import { getZeroPointD, getTimeFunD, getSeconds, nowSeconds } from '../../../pubUtils/timeUtil';
|
||||
@@ -27,6 +26,7 @@ import { FriendParams } from '../../../domain/roleField/friend';
|
||||
import { checkTask, checkTaskInComBattleStart } from '../../../services/task/taskService';
|
||||
import { gameData, getWarByBlueprtId } from '../../../pubUtils/data';
|
||||
import { HeroModel } from '../../../db/Hero';
|
||||
import { addUserToTeamChannel, delTeamChannel, removeFromTeamChannel, sendMessageToTeam } from '../../../services/pushService';
|
||||
|
||||
export default function(app: Application) {
|
||||
return new ComBattleHandler(app);
|
||||
@@ -67,30 +67,26 @@ export class ComBattleHandler {
|
||||
return resResult(STATUS.COM_BATTLE_CREATE_CE_LIMIT)
|
||||
}
|
||||
|
||||
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, true);
|
||||
|
||||
// 创建队伍数据结构
|
||||
let comTeam = new MemComBtlTeam(teamCode, pub, blueprtId, roleId, ceLimit);
|
||||
let comTeam = new MemComBtlTeam(teamCode, pub, blueprtId, roleId, ceLimit, sid);
|
||||
addRoleToTeam(comTeam, roleInfo, true, false);
|
||||
addUserToChannel(channel, new ChannelUser(roleId, sid));
|
||||
addUserToTeamChannel(teamCode, true, roleId, sid);
|
||||
// 将正在匹配的符合要求的玩家加入队伍,并推送入队消息
|
||||
await addValidSearchingRoles(comTeam, channelService);
|
||||
await addValidSearchingRoles(comTeam);
|
||||
|
||||
// 队伍数据持久化
|
||||
const team = await ComBattleTeamModel.createTeam(comTeam);
|
||||
if (!team) {
|
||||
channel.destroy();
|
||||
delTeamChannel(teamCode);
|
||||
return resResult(STATUS.COM_BATTLE_CREATE_ERR);
|
||||
}
|
||||
this.teamMap.set(teamCode, comTeam);
|
||||
|
||||
// 倒计时一定时间给队长匹配机器人
|
||||
if (pub === true) {
|
||||
await addRobotsLater(comTeam, roleInfo, this.teamMap, this.teamDisTimer, channel);
|
||||
await addRobotsLater(comTeam, roleInfo, this.teamMap, this.teamDisTimer);
|
||||
}
|
||||
setDismissTimer(comTeam, this.teamMap, roleId, this.teamDisTimer, channel);
|
||||
setDismissTimer(comTeam, this.teamMap, roleId, this.teamDisTimer);
|
||||
return resResult(STATUS.SUCCESS, { teamCode, roleStatus: comTeam.roleStatus });
|
||||
}
|
||||
|
||||
@@ -133,17 +129,15 @@ export class ComBattleHandler {
|
||||
await rmRoleFromQueue(roleId, sid, lvs);
|
||||
// 创建队伍
|
||||
let blueprtId = getRandBlueprtId(lvs).pop();
|
||||
let comTeam = new MemComBtlTeam(teamCode, false, blueprtId, 'robot', 0)
|
||||
let comTeam = new MemComBtlTeam(teamCode, false, blueprtId, 'robot', 0, '')
|
||||
|
||||
let isFrd = await getFrd(roleId);
|
||||
// 将玩家加入队伍
|
||||
addRoleToTeam(comTeam, roleInfo, false, isFrd);
|
||||
let channelService = thiz.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, true);
|
||||
addUserToChannel(channel, new ChannelUser(roleId, sid));
|
||||
addUserToTeamChannel(teamCode, true, roleId, sid);
|
||||
|
||||
// 创建并添加机器人
|
||||
await addRobotsToTeam(comTeam, roleId, topLineupCe, playerLv, thiz.teamMap, thiz.teamDisTimer, channel, 2);
|
||||
await addRobotsToTeam(comTeam, roleId, topLineupCe, playerLv, thiz.teamMap, thiz.teamDisTimer, 2);
|
||||
|
||||
await ComBattleTeamModel.createTeam(comTeam);
|
||||
thiz.teamMap.set(teamCode, comTeam);
|
||||
@@ -213,12 +207,10 @@ export class ComBattleHandler {
|
||||
addRoleStToTeam(teamStatus, roleStatus);
|
||||
|
||||
// 推送队伍信息给所有玩家
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
addUserToChannel(channel, new ChannelUser(roleId, sid));
|
||||
channel.pushMessage('onTeamJoin', resResult(STATUS.SUCCESS, {teamInfo: teamStatus}));
|
||||
addUserToTeamChannel(teamCode, false, roleId, sid);
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAM_JOIN, { teamInfo: teamStatus });
|
||||
|
||||
setDismissTimer(teamStatus, this.teamMap, roleId, this.teamDisTimer, channel);
|
||||
setDismissTimer(teamStatus, this.teamMap, roleId, this.teamDisTimer);
|
||||
return resResult(STATUS.SUCCESS, { teamInfo: teamStatus});
|
||||
}
|
||||
|
||||
@@ -291,9 +283,7 @@ export class ComBattleHandler {
|
||||
}
|
||||
});
|
||||
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
channel.pushMessage('onTeammateReady', resResult(STATUS.SUCCESS, {teamCode, roleId, heroes}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAMMATE_READY, {teamCode, roleId, heroes});
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -326,9 +316,7 @@ export class ComBattleHandler {
|
||||
}
|
||||
});
|
||||
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
channel.pushMessage('onTeammateReady', resResult(STATUS.SUCCESS, {teamCode, roleId, heroes}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAMMATE_READY, {teamCode, roleId, heroes});
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -364,15 +352,9 @@ export class ComBattleHandler {
|
||||
teamStatus.blacklist.push(roleIdToRm);
|
||||
}
|
||||
|
||||
// 推送移除消息
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
// 先推送离队消息,再将玩家从房间中移除
|
||||
channel.pushMessage('onLeaveTeam', resResult(STATUS.SUCCESS, {teamCode, roleId: roleIdToRm}));
|
||||
let users: string[] = channel.getMembers();
|
||||
if (users.indexOf(roleIdToRm) !== -1) {
|
||||
channel.removeMember(roleIdToRm);
|
||||
}
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.LEAVE_TEAM, {teamCode, roleId: roleIdToRm});
|
||||
removeFromTeamChannel(teamCode, roleIdToRm);
|
||||
clearComBtlTimer(teamCode, this.teamDisTimer); // 移除队员停止解散计时
|
||||
let thiz = this;
|
||||
setTimeout(async () => {
|
||||
@@ -386,7 +368,7 @@ export class ComBattleHandler {
|
||||
}
|
||||
if (!roleSt) return;
|
||||
let { topLineupCe, lv } = roleSt;
|
||||
await addRobotsToTeam(curTeamStatus, roleId, topLineupCe, lv, thiz.teamMap, thiz.teamDisTimer, channel, 3 - curTeamStatus.roleIds.length);
|
||||
await addRobotsToTeam(curTeamStatus, roleId, topLineupCe, lv, thiz.teamMap, thiz.teamDisTimer, 3 - curTeamStatus.roleIds.length);
|
||||
}
|
||||
}, COM_BTL_CONST.ASSIST_TIME);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
@@ -404,9 +386,7 @@ export class ComBattleHandler {
|
||||
let { teamCode } = msg;
|
||||
let teamStatus = this.teamMap.get(teamCode);
|
||||
if(!teamStatus) return resResult(STATUS.SUCCESS);
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
let result = await dismissTeam(teamStatus, this.teamMap, roleId, this.teamDisTimer, channel);
|
||||
let result = await dismissTeam(teamStatus, this.teamMap, roleId, this.teamDisTimer);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -434,31 +414,26 @@ export class ComBattleHandler {
|
||||
if (!team) return resResult(STATUS.COM_BATTLE_START_ERR);
|
||||
|
||||
clearComBtlTimer(teamCode, this.teamDisTimer); // 战斗开始停止解散计时
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
|
||||
await getComBattleFriendAdd(teamStatus.roleStatus);
|
||||
channel.pushMessage('onComBtlStart', resResult(STATUS.SUCCESS, {teamCode, roleStatus: teamStatus.roleStatus}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.COMBATTLE_START, {teamCode, roleStatus: teamStatus.roleStatus});
|
||||
// 每场倒计时结算
|
||||
let thiz = this;
|
||||
setTimeout(async () => {
|
||||
let teamStatus = thiz.teamMap.get(teamCode);
|
||||
if (teamStatus && teamStatus.status === COM_TEAM_STATUS.FIGHTING) {
|
||||
clearRobotHurtTimer(teamStatus, this.robotHurtTimer);
|
||||
let channelService = thiz.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
let team = await ComBattleTeamModel.syncTeamData({teamCode, status: COM_TEAM_STATUS.LOOSE, roleStatus: teamStatus.roleStatus, bossHpArr: teamStatus.bossHpArr}, true);
|
||||
if (!team) return resResult(STATUS.COM_BATTLE_RESULT_ERR);
|
||||
// // 将藏宝图加回去
|
||||
// await addItems(roleId, roleName, sid, [{ id: team.blueprtId, count: 1 }])
|
||||
teamStatus.timeout = true;
|
||||
channel.pushMessage('onTeamComplete', resResult(STATUS.SUCCESS, {teamCode, result: false, timeout: true}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAM_COMPLETE, {teamCode, result: false, timeout: true});
|
||||
thiz.teamMap.delete(teamCode);
|
||||
}
|
||||
}, COM_BTL_CONST.BTL_TIME_LMT);
|
||||
teamStatus.roleStatus.forEach((st, idx) => {
|
||||
if (st.isRobot === true) {
|
||||
updateRobotHurtByTime(teamStatus, st, COM_BTL_CONST.ROBOT_BASE_TIME_INTERVAL + idx, channel, this.robotHurtTimer, this.teamMap);
|
||||
updateRobotHurtByTime(teamStatus, st, COM_BTL_CONST.ROBOT_BASE_TIME_INTERVAL + idx, this.robotHurtTimer, this.teamMap);
|
||||
}
|
||||
});
|
||||
await checkTaskInComBattleStart(teamStatus.roleStatus, teamStatus.capId, teamStatus.blueprtId);
|
||||
@@ -515,11 +490,9 @@ export class ComBattleHandler {
|
||||
teamStatus.bossCurHp = cal.sub(teamStatus.bossCurHp, totalHurtHp);
|
||||
if (teamStatus.bossCurHp < 0) teamStatus.bossCurHp = 0;
|
||||
// 推送本次行动情况
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
const roleStatus = teamStatus.roleStatus.map(st => {return {roleId: st.roleId, totalDmg: st.totalDmg, killed: st.killed}});
|
||||
channel.pushMessage('onTeammateAct', resResult(STATUS.SUCCESS, { teamCode, bossCurHp: teamStatus.bossCurHp, bossHpArr: teamStatus.bossHpArr, roleStatus, actRoleId: roleId, actBossHurts }));
|
||||
const result = await handleComBtlProgress(teamStatus, this.robotHurtTimer, this.teamMap, channel);
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAMMATE_ACT, { teamCode, bossCurHp: teamStatus.bossCurHp, bossHpArr: teamStatus.bossHpArr, roleStatus, actRoleId: roleId, actBossHurts });
|
||||
const result = await handleComBtlProgress(teamStatus, this.robotHurtTimer, this.teamMap);
|
||||
if (result && result.code !== 0) return result;
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
@@ -535,19 +508,17 @@ export class ComBattleHandler {
|
||||
let teamStatus = this.teamMap.get(teamCode);
|
||||
if (!teamStatus || !teamStatus.roleIds || teamStatus.roleIds.indexOf(roleId) === -1) return resResult(STATUS.COM_BATTLE_TEAM_INVALID);
|
||||
|
||||
let channelService = this.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
if (isSuccess && teamStatus.bossCurHp <= 0) {
|
||||
let team = await ComBattleTeamModel.updateResult(teamCode, roleId, isSuccess);
|
||||
if (!team) return resResult(STATUS.COM_BATTLE_RESULT_ERR);
|
||||
channel.pushMessage('onTeamComplete', resResult(STATUS.SUCCESS, {teamCode, result: isSuccess}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAM_COMPLETE, {teamCode, result: isSuccess});
|
||||
} else if (!isSuccess) {
|
||||
let team = await ComBattleTeamModel.updateResult(teamCode, roleId, isSuccess);
|
||||
if (!team) return resResult(STATUS.COM_BATTLE_RESULT_ERR);
|
||||
if (team.status === COM_TEAM_STATUS.LOOSE) {
|
||||
channel.pushMessage('onTeamComplete', resResult(STATUS.SUCCESS, {teamCode, result: isSuccess}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAM_COMPLETE, {teamCode, result: isSuccess});
|
||||
} else {
|
||||
channel.pushMessage('onTeammateAct', resResult(STATUS.SUCCESS, {teamCode, bossCurHp: teamStatus.bossCurHp, roleStatus: {roleId, battleStatus: 2}}));
|
||||
sendMessageToTeam(teamCode, PUSH_ROUTE.TEAMMATE_ACT, {teamCode, bossCurHp: teamStatus.bossCurHp, roleStatus: {roleId, battleStatus: 2}});
|
||||
}
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { bossCurHp: teamStatus.bossCurHp });
|
||||
@@ -705,10 +676,11 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let serverId = session.get('serverId');
|
||||
let guildCode = session.get('guildCode');
|
||||
const { teamCode } = msg;
|
||||
let teamStatus = this.teamMap.get(teamCode);
|
||||
if(!teamStatus) return resResult(STATUS.WRONG_PARMS);
|
||||
const { msgDataWorld, msgDataGuild } = await pushTeamInviteMsg(roleId, roleName, serverId, teamCode, teamStatus.blueprtId);
|
||||
const { msgDataWorld, msgDataGuild } = await pushTeamInviteMsg(roleId, roleName, serverId, guildCode, teamCode, teamStatus.blueprtId);
|
||||
if (!msgDataWorld || !msgDataGuild) return resResult(STATUS.WRONG_PARMS);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -20,141 +20,6 @@ export class ComBattleRemote {
|
||||
|
||||
private channelService: ChannelService;
|
||||
|
||||
public async create(uid: string, sid: string, name: string, flag: boolean) {
|
||||
console.log('comBattleRemote create: ', name, flag);
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
if (!!channel) {
|
||||
let username = uid.split('*')[0];
|
||||
let param = {
|
||||
user: username
|
||||
};
|
||||
channel.pushMessage('onAdd', resResult(STATUS.SUCCESS, param));
|
||||
|
||||
if (!!channel) {
|
||||
channel.add(uid, sid);
|
||||
}
|
||||
}
|
||||
return this.get(name, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add user into chat channel.
|
||||
*
|
||||
* @param {String} uid unique id for user
|
||||
* @param {String} sid server id
|
||||
* @param {String} name channel name
|
||||
* @param {boolean} flag channel parameter
|
||||
*
|
||||
*/
|
||||
public async add(uid: string, sid: string, name: string, flag: boolean) {
|
||||
console.log('comBattleRemote add: ', name, flag);
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
if (!!channel && !this.get(name, false).includes(uid)) {
|
||||
let username = uid.split('*')[0];
|
||||
let param = {
|
||||
user: username
|
||||
};
|
||||
channel.pushMessage('onAdd', resResult(STATUS.SUCCESS, param));
|
||||
|
||||
if (!!channel) {
|
||||
channel.add(uid, sid);
|
||||
}
|
||||
}
|
||||
return this.get(name, flag);
|
||||
}
|
||||
|
||||
public async available(uid: string, sid: string, name: string, flag: boolean) {
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
if (!!channel) {
|
||||
const users = this.get(name, false);
|
||||
if (users.includes(uid)) {
|
||||
console.log('不得重复加入');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user from chat channel.
|
||||
*
|
||||
* @param {Object} opts parameters for request
|
||||
* @param {String} name channel name
|
||||
* @param {boolean} flag channel parameter
|
||||
* @return {Array} users uids in channel
|
||||
*
|
||||
*/
|
||||
private get(name: string, flag: boolean) {
|
||||
let users: string[] = [];
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
if (!!channel) {
|
||||
users = channel.getMembers();
|
||||
}
|
||||
for (let i = 0; i < users.length; i++) {
|
||||
users[i] = users[i].split('*')[0];
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kick user out chat channel.
|
||||
*
|
||||
* @param {String} uid unique id for user
|
||||
* @param {String} sid server id
|
||||
* @param {String} name channel name
|
||||
*
|
||||
*/
|
||||
public async kick(uid: string, sid: string, name: string) {
|
||||
let channel = this.channelService.getChannel(name, false);
|
||||
// leave channel
|
||||
if (!!channel) {
|
||||
channel.leave(uid, sid);
|
||||
}
|
||||
let username = uid.split('*')[0];
|
||||
let param = {
|
||||
user: username
|
||||
};
|
||||
channel.pushMessage('onLeave', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
|
||||
public async hurt(uid: string, sid: string, name: string, bossHurt: number, actorHurt: [{ actorId: number, actorHurt: number }]) {
|
||||
try {
|
||||
console.log('hurt channel name: ', name);
|
||||
let channelService = this.app.get('channelService');
|
||||
this.bossHp -= bossHurt;
|
||||
let channel = channelService.getChannel(name, false);
|
||||
if (!!channel) {
|
||||
if (this.bossHp < 0) {
|
||||
this.bossHp = 0;
|
||||
}
|
||||
channel.pushMessage('bossHp', resResult(STATUS.SUCCESS, { bossHp: this.bossHp }));
|
||||
}
|
||||
return this.bossHp;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
// public async leaveFromBattle(roleId: string, teamCode: string ) {
|
||||
// try {
|
||||
// let teamMap: Map<string, MemComBtlTeam> = this.app.get('teamMap');
|
||||
// if(teamMap && teamMap.has(teamCode)) {
|
||||
// let myTeam = teamMap.get(teamCode);
|
||||
// for(let roleStatus of myTeam.roleStatus) {
|
||||
// if(roleStatus.roleId == roleId) {
|
||||
// roleStatus.battleStatus = 2; // 自己失败了
|
||||
// }
|
||||
// }
|
||||
// let channelService = this.app.get('channelService');
|
||||
// let channel = channelService.getChannel(teamCode, false);
|
||||
|
||||
// await handleComBtlProgress(myTeam, this.app.get('robotHurtTimer'), teamMap, channel); // 结算
|
||||
// }
|
||||
// } catch(e) {
|
||||
// errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
// }
|
||||
// }
|
||||
|
||||
public async checkMyTeam(roleId: string ) {
|
||||
try {
|
||||
let teamMap: Map<string, MemComBtlTeam> = this.app.get('teamMap');
|
||||
|
||||
@@ -17,65 +17,6 @@ export class ChatHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Send messages to users
|
||||
*
|
||||
* @param {Object} msg message from client
|
||||
* @param {Object} session
|
||||
*
|
||||
*/
|
||||
async send(msg: { content: string, target: string }, session: BackendSession) {
|
||||
let rid = session.get('rid');
|
||||
let username = session.uid.split('*')[0];
|
||||
let channelService = this.app.get('channelService');
|
||||
let param = {
|
||||
msg: msg.content,
|
||||
from: username,
|
||||
target: msg.target
|
||||
};
|
||||
let channel = channelService.getChannel(rid, false);
|
||||
|
||||
// the target is all users
|
||||
if (msg.target === '*') {
|
||||
channel.pushMessage('onChat', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
// the target is specific user
|
||||
else {
|
||||
let tuid = msg.target + '*' + rid;
|
||||
let tsid = channel.getMember(tuid)['sid'];
|
||||
channelService.pushMessageByUids('onChat', resResult(STATUS.SUCCESS, param), [{
|
||||
uid: tuid,
|
||||
sid: tsid
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
async send2(msg: { content: string, target: string }, session: BackendSession) {
|
||||
let rid = session.get('rid');
|
||||
let username = session.uid.split('*')[0];
|
||||
let channelService = this.app.get('channelService');
|
||||
let param = {
|
||||
msg: msg.content,
|
||||
from: username,
|
||||
target: msg.target
|
||||
};
|
||||
let channel = channelService.getChannel(rid, false);
|
||||
|
||||
// the target is all users
|
||||
if (msg.target === '*') {
|
||||
channel.pushMessage('onChat', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
// the target is specific user
|
||||
else {
|
||||
let tuid = msg.target + '*' + rid;
|
||||
let tsid = channel.getMember(tuid)['sid'];
|
||||
channelService.pushMessageByUids('onChat', resResult(STATUS.SUCCESS, param), [{
|
||||
uid: tuid,
|
||||
sid: tsid
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 群聊发送接口
|
||||
* @param {{ channel: string, type: number, content: string, targetRoleId: string, targetMsgCode: string }} msg
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
import { GroupMessageType } from './../../../db/GroupMessage';
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { ON_ADD_CHANNEL_ROUTE, ON_GROUP_MSG_ROUTE, ON_LEAVE_CHANNEL_ROUTE, STATUS, CHANNEL_PREFIX } from '../../../consts';
|
||||
import { PrivateMessageType } from '../../../db/PrivateMessage';
|
||||
import { addUserToChannel, getSimpleRoleInfo } from '../../../services/roleService';
|
||||
import { ChannelUser } from '../../../domain/ChannelUser';
|
||||
import { getWorldChannelSid, groupRoomId } from '../../../services/chatService';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { GeneralRankParam } from '../../../domain/rank';
|
||||
import { getAllGuildActivityStatus } from '../../../services/guildActivity/guildActivityService';
|
||||
import { MailParam } from '../../../domain/roleField/mail';
|
||||
import { RankFirstType } from '../../../db/RankFirst';
|
||||
import { LotType } from '../../../db/Lot';
|
||||
import { _checkFilterWords, getTire, taflush } from '../../../services/sdkService';
|
||||
import { _checkFilterWords, taflush } from '../../../services/sdkService';
|
||||
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
|
||||
import { errlogger } from '../../../util/logger';
|
||||
import { addUserToChannel, sendMessageToChannel, sendMessgeToChannelByBatch } from '../../../services/pushService';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -41,10 +30,6 @@ export class ChatRemote {
|
||||
}
|
||||
|
||||
private channelService: ChannelService;
|
||||
private GUILD_ACTIVITY_END = 'onGuildActivityEnd';
|
||||
private RACE_ACTIVITY_START = 'onRaceStart';
|
||||
private RANK_TOP_UPDATE = 'onRankTopUpdated';
|
||||
private GUILD_ACTIVITY_STATUS_UPDATE = 'onGuildActivityStatus'; // 军团活动状态变化
|
||||
|
||||
/**
|
||||
* @description 添加用户到频道
|
||||
@@ -57,7 +42,7 @@ export class ChatRemote {
|
||||
try {
|
||||
let channel = this.channelService.getChannel(channelName, true);
|
||||
if (!channel) return;
|
||||
addUserToChannel(channel, new ChannelUser(roleId, sid));
|
||||
addUserToChannel(channel, roleId, sid);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
@@ -82,80 +67,36 @@ export class ChatRemote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 推送群消息到频道
|
||||
* @param {Partial<GroupMessageType>} msg
|
||||
* @memberof ChatRemote
|
||||
* 向频道推送消息
|
||||
* @param roomId 房间号
|
||||
* @param path 推送地址
|
||||
* @param data 推送数据
|
||||
* @returns
|
||||
*/
|
||||
public async sendGroupMsg(roomId: string, msg: Partial<GroupMessageType>) {
|
||||
public async pushMessage(roomId: string, path: string, data: any, isBatch = false) {
|
||||
try {
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
const roleInfo = await getSimpleRoleInfo(msg.roleId);
|
||||
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, { ...msg, roleInfo }));
|
||||
if(isBatch) { // 分批推送
|
||||
sendMessgeToChannelByBatch(channel, path, data);
|
||||
} else {
|
||||
sendMessageToChannel(channel, path, data);
|
||||
}
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 推送私聊消息
|
||||
* @param {Partial<PrivateMessageType>} msg
|
||||
* @memberof ChatRemote
|
||||
*/
|
||||
public async sendPrivateMsg(msg: Partial<PrivateMessageType>) {
|
||||
public async deleteChannel(roomId: string) {
|
||||
try {
|
||||
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 全服推送活动结束通知
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendGuildActivityEnd(serverId: number) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
channel.pushMessage(this.GUILD_ACTIVITY_END, resResult(STATUS.SUCCESS, {}));
|
||||
channel.destroy();
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 全服推送竞赛活动开始通知
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendRaceActivityStart(serverId: number) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
channel.pushMessage(this.RACE_ACTIVITY_START, resResult(STATUS.SUCCESS, {}));
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 全服推送排行榜更新信息
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendRankTopUpdated(serverId: number, ranks: (RankFirstType & {status: number})[]) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
channel.pushMessage(this.RANK_TOP_UPDATE, resResult(STATUS.SUCCESS, { ranks }));
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
@@ -167,113 +108,6 @@ export class ChatRemote {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 全服推送军团活动状态变化
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendGuildActivityUpdate(serverId: number) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
let guildActivities = getAllGuildActivityStatus();
|
||||
channel.pushMessage(this.GUILD_ACTIVITY_STATUS_UPDATE, resResult(STATUS.SUCCESS, { guildActivities }));
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向全服推送邮件
|
||||
* @param serverId 服务器id
|
||||
* @param path 推送地址
|
||||
* @param mails 邮件内容
|
||||
*/
|
||||
public async sendMail(serverId: number, path: string, data: { mails: MailParam[] }) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return;
|
||||
channel.pushMessage(path, resResult(STATUS.SUCCESS, data));
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 全服推送维护
|
||||
* @param serverId
|
||||
*/
|
||||
public async sendServerMaintenance(serverId: number) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return { result: false, serverId };
|
||||
channel.pushMessage('onServerMaintenance', resResult(STATUS.SERVER_MAINTENANCE));
|
||||
return { result: true, serverId };
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async pushCurrentTime(serverId: number, time: number) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if (!channel) return { result: false, serverId };
|
||||
|
||||
channel.pushMessage('onPushCurrentTime', resResult(STATUS.SUCCESS, { time }));
|
||||
return { result: true, serverId };
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 实时推送军团拍卖出价
|
||||
* @param guildCode
|
||||
*/
|
||||
public async sendGuildAuction(guildCode: string, lot: LotType) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.GUILD, guildCode);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if(!channel) return false;
|
||||
|
||||
channel.pushMessage('onAuctionOver', resResult(STATUS.SUCCESS, { lot }));
|
||||
return true;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async sendWorldAuction(serverId: number, lot: LotType) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if(!channel) return false;
|
||||
|
||||
channel.pushMessage('onAuctionOver', resResult(STATUS.SUCCESS, { lot }));
|
||||
return true;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async sendAuctionUpdate(serverId: number, params: { lots: LotType[] }) {
|
||||
try {
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
let channel = this.channelService.getChannel(roomId, false);
|
||||
if(!channel) return false;
|
||||
|
||||
channel.pushMessage('onAuctionUpdate', resResult(STATUS.SUCCESS, params));
|
||||
return true;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async checkFilterWords(word: string) {
|
||||
try {
|
||||
return await _checkFilterWords(word);
|
||||
|
||||
@@ -1,463 +0,0 @@
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS, CHANNEL_PREFIX } from '../../../consts';
|
||||
import { GuildType } from '../../../db/Guild';
|
||||
import { RoleType } from '../../../db/Role';
|
||||
import { GuildRecType } from '../../../db/GuildRec';
|
||||
import { leaveGuildChannel, groupRoomId } from '../../../services/chatService';
|
||||
import { GuildRankParams, WoodenHorse, Event } from '../../../domain/battleField/guildActivity';
|
||||
import { MailParam } from '../../../domain/roleField/mail';
|
||||
import { pick } from 'underscore';
|
||||
import { LotType } from '../../../db/Lot';
|
||||
import { DividendType } from '../../../db/Dividend';
|
||||
import { getRoleOnlineInfo } from '../../../services/redisService';
|
||||
import { errlogger } from '../../../util/logger';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
return new GuildRemote(app);
|
||||
}
|
||||
|
||||
export class GuildRemote {
|
||||
|
||||
constructor(private app: Application) {
|
||||
this.app = app;
|
||||
this.channelService = app.get('channelService');
|
||||
}
|
||||
|
||||
private channelService: ChannelService;
|
||||
private MEMBER_QUIT = 'onMemberQuit';
|
||||
private DISMISS = 'onDismiss';
|
||||
private GUILD_INFO_UPDATE = 'onGuildInfoUpdate';
|
||||
private DEMOTION = 'onDemotion';
|
||||
private PROMOTION = 'onPromotion';
|
||||
private GUILD_REC_ADD = 'onGuildRecAdd';
|
||||
private GUILD_BOSS_OPEN = 'onGuildBossStatus';
|
||||
private GATE_ACT_RANK = 'onGuildGateRankUpdate'; // 军团活动排行榜
|
||||
private CITY_ACT_RANK = 'onGuildCityRankUpdate'; // 军团活动排行榜
|
||||
private GUILD_GATE_ACT_HP = 'onGuildGateHpUpdate'; // 军团活动蛮夷入侵排行榜
|
||||
private GUILD_ACTIVITY_END = 'onGuildActivityEnd'; // 军团活动结束
|
||||
private GUILD_CITY_DECLARE = 'onGuildCityDeclare'; // 有军团对这个城池进行宣战了
|
||||
private GUILD_CITY_ACT_HP = 'onGuildCityGateHpUpdate'; // 诸侯入侵城门血条
|
||||
private GUILD_RACE_UPDATE = 'onRaceHorseUpdate'; /// 更新木牛流马
|
||||
private GUILD_RACE_JOIN = 'onRaceHorseJoin'
|
||||
private GUILD_RACE_EVENT = 'onRaceEventUpdate'; /// 更新木牛流马
|
||||
private GUILD_POP_UP_ACTIVITY = 'onActivityTaskUpdate'; /// 向军团成员发送弹窗礼包
|
||||
private GUILD_TRAIN_RESET = 'onGuildTainReset'; // 试炼场重置
|
||||
private GUILD_BOSS_ENCOURAGE = 'onGuildBossEncourage'; // 鼓舞
|
||||
private AUCTION_UPDATE = 'onAuctionUpdate'; // 拍卖行更新
|
||||
private AUCTION_ADD = 'onAuctionAdd'; // 拍卖行增加
|
||||
private DIVIDEND_UPDATE = 'onDividendsUpdate'; // 拍卖行更新
|
||||
private DIVIDEND_ADD = 'onDividendsAdd';
|
||||
|
||||
/**
|
||||
* 封装,军团相关channel名: 'guild'+guildCode
|
||||
* @param guildCode 军团code
|
||||
* @param create 是否创建channel
|
||||
*/
|
||||
private getChannel(guildCode: string, create: boolean = false) {
|
||||
let channelName = groupRoomId(CHANNEL_PREFIX.GUILD, guildCode);
|
||||
let channel = this.channelService.getChannel(channelName, create);
|
||||
return channel
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装,向单人发推送
|
||||
* @param guildCode 军团code
|
||||
* @param path 推送地址
|
||||
* @param roleId 玩家id
|
||||
* @param message 推送信息
|
||||
* @param sid 玩家服
|
||||
*/
|
||||
private async pushMessageByUids(guildCode: string, path: string, roleId: string, message: { code: string, roleId?: string }, sid?: string) {
|
||||
|
||||
let channel = this.getChannel(guildCode);
|
||||
let uids = [];
|
||||
if (!sid) {
|
||||
let onlineUser = await getRoleOnlineInfo(roleId);
|
||||
sid = onlineUser.sid;
|
||||
}
|
||||
if (sid) {
|
||||
uids.push({ uid: roleId, sid });
|
||||
this.channelService.pushMessageByUids(path, resResult(STATUS.SUCCESS, message), uids);
|
||||
}
|
||||
return channel
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装,向channel发推送
|
||||
* @param guildCode 军团code
|
||||
* @param path 推送地址
|
||||
* @param message 推送信息
|
||||
*/
|
||||
private pushMessage(guildCode: string, path: string, message: any) {
|
||||
let channel = this.getChannel(guildCode);
|
||||
if (!!channel) {
|
||||
channel.pushMessage(path, resResult(STATUS.SUCCESS, message));
|
||||
}
|
||||
return channel
|
||||
}
|
||||
|
||||
/**
|
||||
* 诸侯混战,按城池区分channel
|
||||
* @param cityId 城池id
|
||||
* @param create 是否创建channel
|
||||
*/
|
||||
private getCityChannel(cityId: number, create: boolean = false) {
|
||||
let channelName = groupRoomId(CHANNEL_PREFIX.CITY, cityId);
|
||||
let channel = this.channelService.getChannel(channelName, create);
|
||||
return channel
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装,向channel发推送
|
||||
* @param cityId 城池id
|
||||
* @param path 推送地址
|
||||
* @param message 推送信息
|
||||
*/
|
||||
private pushMessageToCity(cityId: number, path: string, message: any) {
|
||||
let channel = this.getCityChannel(cityId);
|
||||
if (!!channel) {
|
||||
channel.pushMessage(path, resResult(STATUS.SUCCESS, message));
|
||||
}
|
||||
return channel
|
||||
}
|
||||
|
||||
/**
|
||||
* 踢出某个成员
|
||||
* @param guildCode 军团code
|
||||
* @param roleId 踢出玩家roleId
|
||||
* @param guild 军团信息
|
||||
* @param sid 玩家sid
|
||||
*/
|
||||
public memberQuit(guildCode: string, roleId: string, guild: GuildType, sid?: string) {
|
||||
try {
|
||||
// 被踢出公会
|
||||
this.pushMessageByUids(guildCode, this.MEMBER_QUIT, roleId, {
|
||||
code: guildCode,
|
||||
roleId
|
||||
}, sid);
|
||||
// 更新人数减少
|
||||
this.updateInfo(guildCode, { memberCnt: guild.memberCnt, guildCe: guild.guildCe });
|
||||
leaveGuildChannel(roleId, sid, guildCode);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解散军团
|
||||
* @param guildCode 军团code
|
||||
*/
|
||||
public dismiss(guildCode: string) {
|
||||
try {
|
||||
let channel = this.pushMessage(guildCode, this.DISMISS, { code: guildCode });
|
||||
if (!!channel) {
|
||||
channel.destroy();
|
||||
}
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新军团信息
|
||||
* @param guildCode 军团code
|
||||
* @param info 军团相关信息
|
||||
*/
|
||||
public updateInfo(guildCode: string, info: any) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_INFO_UPDATE, info);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更换团长信息
|
||||
* @param guildCode 军团code
|
||||
* @param managerCnt 管理员人数
|
||||
* @param newLeader 新的团长
|
||||
* @param oldLeaderId 旧团长
|
||||
*/
|
||||
public changeLeader(guildCode: string, managerCnt: number, newLeader: RoleType, oldLeaderId: string) {
|
||||
try{
|
||||
let { roleId, roleName, frame, head, spine, lv, quitTime } = newLeader;
|
||||
this.updateInfo(guildCode, { managerCnt, leader: { roleId, roleName, frame, head, spine, lv, quitTime } });
|
||||
this.demotion(guildCode, oldLeaderId);
|
||||
this.promotion(guildCode, roleId);
|
||||
}catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向旧团长推送降职信息
|
||||
* @param guildCode 军团code
|
||||
* @param roleId 旧团长id
|
||||
*/
|
||||
public demotion(guildCode: string, roleId: string) {
|
||||
try {
|
||||
this.pushMessageByUids(guildCode, this.DEMOTION, roleId, {
|
||||
code: guildCode
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向新团长推送升职信息
|
||||
* @param guildCode 军团code
|
||||
* @param roleId 新团长id
|
||||
*/
|
||||
public promotion(guildCode: string, roleId: string) {
|
||||
try {
|
||||
this.pushMessageByUids(guildCode, this.PROMOTION, roleId, {
|
||||
code: guildCode
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加动态
|
||||
* @param guildRecType 动态
|
||||
*/
|
||||
public addRec(guildRecType: GuildRecType) {
|
||||
try {
|
||||
let { guildCode, type, params, createTime } = guildRecType;
|
||||
this.pushMessage(guildCode, this.GUILD_REC_ADD, { type, params, createTime });
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向军团推送城门血量
|
||||
* @param guildCode
|
||||
*/
|
||||
public pushGateHp(guildCode: string, gateHp: number) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_GATE_ACT_HP, { gateHp });
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向军团推送排行榜名次
|
||||
* @param guildCode
|
||||
*/
|
||||
public pushRank(guildCode: string, msg: GuildRankParams) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GATE_ACT_RANK, msg);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向军团推送排行榜名次
|
||||
* @param guildCode
|
||||
*/
|
||||
public pushCityActRank(guildCode: string, msg: GuildRankParams) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.CITY_ACT_RANK, msg);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 向军团推送结束活动
|
||||
* @param guildCode
|
||||
*/
|
||||
public async sendGuildActivityEnd(guildCode: string) {
|
||||
try {
|
||||
console.log("MSG END")
|
||||
this.pushMessage(guildCode, this.GUILD_ACTIVITY_END, {});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 向城池推送有宣战
|
||||
* @param cityId 城池
|
||||
* @param declareGuildCode 宣战的军团code
|
||||
* @param declareCount 宣战数量
|
||||
*/
|
||||
public async sendGuildCityDeclare(cityId: number, declareGuildCode: string, declareCount: number) {
|
||||
try {
|
||||
this.pushMessageToCity(cityId, this.GUILD_CITY_DECLARE, {
|
||||
cityId,
|
||||
declareGuildCode,
|
||||
declareCount
|
||||
});
|
||||
this.pushMessage(declareGuildCode, this.GUILD_CITY_DECLARE, {
|
||||
cityId,
|
||||
declareGuildCode,
|
||||
declareCount
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 推送城池城门血条
|
||||
* @param cityId 城池
|
||||
* @param gateHp 血条
|
||||
*/
|
||||
public async pushCityGateHp(cityId: number, gateHp: number, maxHp: number) {
|
||||
try {
|
||||
this.pushMessageToCity(cityId, this.GUILD_CITY_ACT_HP, {
|
||||
cityId,
|
||||
gateHp,
|
||||
maxHp
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 推送木牛流马状态
|
||||
* @param guildCode 军团
|
||||
* @param woodenHorseList 木马
|
||||
* @param ranks 军团排名和自己所在的排名
|
||||
*/
|
||||
public async pushRaceHorseUpdate(guildCode: string, woodenHorseList: WoodenHorse[], ranks: GuildRankParams, events: Event[]) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_RACE_UPDATE, {
|
||||
timestamp: Date.now(),
|
||||
woodenHorseList,
|
||||
...ranks,
|
||||
events
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 当有人加入这个木牛流马
|
||||
* @param guildCode 军团
|
||||
* @param woodenHorse 木马
|
||||
*/
|
||||
public async pushRaceHorseJoin(guildCode: string, woodenHorse: WoodenHorse) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_RACE_JOIN, {
|
||||
timestamp: Date.now(),
|
||||
woodenHorse
|
||||
});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 向军团推送事件
|
||||
* @param guildCode
|
||||
*/
|
||||
public async sendRaceEvent(guildCode: string, events: Event[]) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_RACE_EVENT, { timestamp: Date.now(), events });
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 当团长开启演武台时
|
||||
* @param guildCode
|
||||
* @param warId
|
||||
* @param bossHp
|
||||
* @param status
|
||||
*/
|
||||
public async pushBossStatus(guildCode: string, result: any) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_BOSS_OPEN, pick(result, ['status', 'bossInfo', 'leaderOpenCnt']));
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 向军团推送弹窗礼包数据活动
|
||||
* @param guildCode
|
||||
*/
|
||||
public async sendPopUpActivity(guildCode: string, data: any[]) {
|
||||
try {
|
||||
console.log("sendPopUpActivity")
|
||||
this.pushMessage(guildCode, this.GUILD_POP_UP_ACTIVITY, data);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 军团邮件
|
||||
* @param guildCode 军团code
|
||||
* @param path 推送地址
|
||||
* @param data 军团内容
|
||||
*/
|
||||
public async sendMailToGuild(guildCode: string, path: string, data: { mails: MailParam[] }) {
|
||||
try {
|
||||
this.pushMessage(guildCode, path, data);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async sendTrainReset(guildCode: string) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_TRAIN_RESET, {});
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async pushEncourage(guildCode: string, param: {encourageCnt: number; encourageMax: number; myEncourageCnt: number;}) {
|
||||
try {
|
||||
this.pushMessage(guildCode, this.GUILD_BOSS_ENCOURAGE, param);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async pushAuctionUpdate(guildCode: string, param: { lots: LotType[]; dividends: DividendType[] }) {
|
||||
try {
|
||||
if(param.lots) this.pushMessage(guildCode, this.AUCTION_UPDATE, { lots: param.lots });
|
||||
if(param.dividends) this.pushMessage(guildCode, this.DIVIDEND_UPDATE, { dividends: param.dividends });
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async pushAuctionAdd(guildCode: string, param: { lots: LotType[]; dividends: DividendType[] }) {
|
||||
try {
|
||||
if(param.lots) this.pushMessage(guildCode, this.AUCTION_ADD, { lots: param.lots });
|
||||
if(param.dividends) this.pushMessage(guildCode, this.DIVIDEND_ADD, { dividends: param.dividends });
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 活动推送
|
||||
* @param guildCode 军团code
|
||||
* @param path 推送地址
|
||||
* @param param 内容
|
||||
*/
|
||||
public async pushActivityToGuild(guildCode: string, path: string, param: any) {
|
||||
try {
|
||||
this.pushMessage(guildCode, path, param);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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] });
|
||||
|
||||
|
||||
@@ -28,69 +28,5 @@ export class GMRemote {
|
||||
|
||||
private channelService: ChannelService;
|
||||
|
||||
/**
|
||||
* Add user into chat channel.
|
||||
*
|
||||
* @param {String} uid unique id for user
|
||||
* @param {String} sid server id
|
||||
* @param {String} name channel name
|
||||
* @param {boolean} flag channel parameter
|
||||
*
|
||||
*/
|
||||
public async add(uid: string, sid: string, name: string, flag: boolean) {
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
let username = uid.split('*')[0];
|
||||
let param = {
|
||||
user: username
|
||||
};
|
||||
channel.pushMessage('onAdd', resResult(STATUS.SUCCESS, param));
|
||||
|
||||
if (!!channel) {
|
||||
channel.add(uid, sid);
|
||||
}
|
||||
|
||||
return this.get(name, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user from chat channel.
|
||||
*
|
||||
* @param {Object} opts parameters for request
|
||||
* @param {String} name channel name
|
||||
* @param {boolean} flag channel parameter
|
||||
* @return {Array} users uids in channel
|
||||
*
|
||||
*/
|
||||
private get(name: string, flag: boolean) {
|
||||
let users: string[] = [];
|
||||
let channel = this.channelService.getChannel(name, flag);
|
||||
if (!!channel) {
|
||||
users = channel.getMembers();
|
||||
}
|
||||
for (let i = 0; i < users.length; i++) {
|
||||
users[i] = users[i].split('*')[0];
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kick user out chat channel.
|
||||
*
|
||||
* @param {String} uid unique id for user
|
||||
* @param {String} sid server id
|
||||
* @param {String} name channel name
|
||||
*
|
||||
*/
|
||||
public async kick(uid: string, sid: string, name: string) {
|
||||
let channel = this.channelService.getChannel(name, false);
|
||||
// leave channel
|
||||
if (!!channel) {
|
||||
channel.leave(uid, sid);
|
||||
}
|
||||
let username = uid.split('*')[0];
|
||||
let param = {
|
||||
user: username
|
||||
};
|
||||
channel.pushMessage('onLeave', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DividendModel } from './../../../db/Dividend';
|
||||
import { Application, BackendSession, ChannelService, HandlerService, pinus, } from "pinus";
|
||||
import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, DATA_NAME, LOT_STATUS, CHANNEL_PREFIX, MAIL_TYPE, ITEM_CHANGE_REASON, TA_EVENT, ROLE_RECEIVE_STATUS } from "../../../consts";
|
||||
import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, DATA_NAME, LOT_STATUS, CHANNEL_PREFIX, MAIL_TYPE, ITEM_CHANGE_REASON, TA_EVENT, ROLE_RECEIVE_STATUS, PUSH_ROUTE } from "../../../consts";
|
||||
import { LotModel } from "../../../db/Lot";
|
||||
import { ItemReward } from "../../../domain/dbGeneral";
|
||||
import { genCode, resResult } from "../../../pubUtils/util";
|
||||
@@ -21,6 +21,7 @@ import { addRoleToGuildAuctionChannel, addRoleToWorldAuctionChannel, channelServ
|
||||
import { RewardInter } from '../../../pubUtils/interface';
|
||||
import { sendMailByContent } from '../../../services/mailService';
|
||||
import { reportTAEvent } from '../../../services/sdkService';
|
||||
import { sendMessageToServerWithSuc } from '../../../services/pushService';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -326,9 +327,7 @@ export class AuctionHandler {
|
||||
}
|
||||
|
||||
let serverId = session.get('serverId');
|
||||
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
|
||||
const channelSid = await channelServer(roomId);
|
||||
await pinus.app.rpc.chat.chatRemote.pushCurrentTime.toServer(channelSid, serverId, new Date(time).getTime());
|
||||
await sendMessageToServerWithSuc(serverId, PUSH_ROUTE.PUSH_CURRENT_TIME, { time: new Date(time).getTime() });
|
||||
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Application, ChannelService, BackendSession, pinus, HandlerService, } from "pinus";
|
||||
import { GUILD_ACTIVITY_TYPE, STATUS, REDIS_KEY, GUILD_POINT_WAYS, CITY_STATUS, TASK_TYPE, ITEM_CHANGE_REASON } from "../../../consts";
|
||||
import { GUILD_ACTIVITY_TYPE, STATUS, REDIS_KEY, GUILD_POINT_WAYS, CITY_STATUS, TASK_TYPE, ITEM_CHANGE_REASON, PUSH_ROUTE } from "../../../consts";
|
||||
import { resResult } from "../../../pubUtils/util";
|
||||
import { getGuildActivityStatus, getCityActivityObj, getCityStatus as pubGetCityStatus, getCities, getCityActivityRank, sendSingleCityActEndMsg, getPreDayActiveData } from "../../../services/guildActivity/guildActivityService";
|
||||
import { getGuildActivityStatus, getCityActivityObj, getCityStatus as pubGetCityStatus, getCities, getCityActivityRank, sendSingleCityActEndMsg, getPreDayActiveData, sendGuildCityDeclare } from "../../../services/guildActivity/guildActivityService";
|
||||
import { GuildActivityCityModel } from "../../../db/GuildActivityCity";
|
||||
import { gameData } from "../../../pubUtils/data";
|
||||
import { UserGuildActivityRecModel } from "../../../db/UserGuildActivityRec";
|
||||
@@ -17,6 +17,7 @@ import { checkTask } from "../../../services/task/taskService";
|
||||
import { guildInter } from "../../../pubUtils/interface";
|
||||
import { dispatch } from "../../../pubUtils/dispatcher";
|
||||
import { ServerRecordModel } from "../../../db/ServerRecords";
|
||||
import { sendMessageToCityWithSuc, sendMessageToGuildWithSuc } from "../../../services/pushService";
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -124,9 +125,7 @@ export class CityActivityHandler {
|
||||
}
|
||||
|
||||
let rec = await GuildActivityCityModel.declare(serverId, cityId, guildCode);
|
||||
|
||||
let chatSid = await getCityChannelSid(guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.sendGuildCityDeclare.toServer(chatSid, cityId, guildCode, rec.declareCount);
|
||||
await sendGuildCityDeclare(cityId, guildCode, rec.declareCount);
|
||||
|
||||
let obj = getCityActivityObj();
|
||||
obj.pushGuild(guildCode, serverId, cityId);
|
||||
@@ -276,8 +275,8 @@ export class CityActivityHandler {
|
||||
await sendSingleCityActEndMsg(cityId, serverId);
|
||||
}
|
||||
// 推送 城门血量
|
||||
let chatSid = await getCityChannelSid(cityId);
|
||||
pinus.app.rpc.chat.guildRemote.pushCityGateHp.toServer(chatSid, cityId, gateHp, maxHp);
|
||||
await sendMessageToCityWithSuc(cityId, PUSH_ROUTE.GUILD_CITY_ACT_HP, { cityId, gateHp, maxHp });
|
||||
|
||||
await pinus.app.rpc.guild.guildActivityRemote.sendRankToGuilds.broadcast(this.aid);
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Application, BackendSession, pinus, HandlerService, } from 'pinus';
|
||||
import { resResult, genCode, getRandSingleEelm } from '../../../pubUtils/util';
|
||||
import { AUCTION_SOURCE, DEBUG_MAGIC_WORD, ITEM_CHANGE_REASON, MAIL_TYPE, STATUS, TASK_TYPE } from '../../../consts';
|
||||
import { AUCTION_SOURCE, DEBUG_MAGIC_WORD, ITEM_CHANGE_REASON, MAIL_TYPE, PUSH_ROUTE, STATUS, TASK_TYPE } from '../../../consts';
|
||||
import { BossInstanceModel } from '../../../db/BossInstance';
|
||||
import { BattleRecordModel } from '../../../db/BattleRecord';
|
||||
import { nowSeconds, getZeroPoint, getSeconds } from '../../../pubUtils/timeUtil';
|
||||
import { getBossInstanceInfo, checkBossBattleMemberExists, pushBossHpMessage, addBossInstance, refreshUserGuildOfBoss, refreshGuildOfBoss, getBossHp, getBossInstanceInfoByData } from '../../../services/guildBossService';
|
||||
import { getBossInstanceInfo, checkBossBattleMemberExists, pushBossHpMessage, addBossInstance, refreshUserGuildOfBoss, refreshGuildOfBoss, getBossHp, getBossInstanceInfoByData, pushBossStatus } from '../../../services/guildBossService';
|
||||
import { findWhere } from 'underscore'
|
||||
import { GUILD_STRUCTURE, GUILD_BOSS_STATUS, GUILD_POINT_WAYS } from '../../../consts/constModules/guildConst';
|
||||
import { DATA_NAME } from '../../../consts/dataName';
|
||||
@@ -21,7 +21,7 @@ import * as dicParam from '../../../pubUtils/dicParam';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { sendMailToGuildByContent } from '../../../services/mailService';
|
||||
import { genAuction } from '../../../services/auctionService';
|
||||
import { getPreDayActiveData } from '../../../services/guildActivity/guildActivityService';
|
||||
import { sendMessageToGuildWithSuc } from '../../../services/pushService';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -87,9 +87,7 @@ export class GuildHandler {
|
||||
res.releaseCallback();
|
||||
|
||||
let result = await getBossInstanceInfoByData(bossInstance, userGuild, guild);
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
pinus.app.rpc.chat.guildRemote.pushBossStatus.toServer(chatSid, code, result );
|
||||
|
||||
await pushBossStatus(code, result);
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
}
|
||||
|
||||
@@ -192,9 +190,7 @@ export class GuildHandler {
|
||||
}
|
||||
|
||||
let result = await getBossInstanceInfoByData(bossInstance, userGuild);
|
||||
let chatSid = await getGuildChannelSid(guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.pushBossStatus.toServer(chatSid, guildCode, result );
|
||||
|
||||
await pushBossStatus(guildCode, result);
|
||||
pushGuildBossSucMsg(roleId, roleName, guildCode, bossInstance);
|
||||
|
||||
res.releaseCallback();//解锁
|
||||
@@ -270,8 +266,7 @@ export class GuildHandler {
|
||||
encourageMax: dicBossBase.encourageSum,
|
||||
myEncourageCnt: myEncourageCntResult
|
||||
}
|
||||
let chatSid = await getGuildChannelSid(userGuild.guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.pushEncourage.toServer(chatSid, userGuild.guildCode, result);
|
||||
await sendMessageToGuildWithSuc(userGuild.guildCode, PUSH_ROUTE.GUILD_BOSS_ENCOURAGE, result);
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Application, BackendSession, ChannelService, HandlerService, } from 'pi
|
||||
import { resResult, getRandEelm, shouldRefresh, sortArrRandom } from '../../../pubUtils/util';
|
||||
import { STATUS, GUILD_OPERATE, GUILD_AUTH, GUILD_JOB, GUILD_APPLY_TYPE, GUILD_STRUCTURE, GUILD_REC_TYPE, GUILD_STRUCTURE_NAME, MAIL_TYPE, REDIS_KEY, GUILD_SELECT, USER_GUILD_SELECT, TASK_TYPE, DEBUG_MAGIC_WORD, CHANNEL_PREFIX, MSG_TYPE, MSG_SOURCE, ITEM_CHANGE_REASON, TA_EVENT, GUILD_DISMISS_WAY, GUILD_MASTER_CHANGE_WAY, GUILD_QUIT_WAY } from '../../../consts';
|
||||
import { UserGuildModel, UserGuildType } from '../../../db/UserGuild';
|
||||
import { checkAuth, joinGuild, getGuildWithRefActive, getUserGuildWithRefActive, addActive, settleGuildWeekly, getMyGuildInfo, refreshUserGuild, setUserGuildSession, getInvitationList } from '../../../services/guildService';
|
||||
import { checkAuth, joinGuild, getGuildWithRefActive, getUserGuildWithRefActive, addActive, settleGuildWeekly, getMyGuildInfo, refreshUserGuild, setUserGuildSession, getInvitationList, addGuildRecord, pushChangeGuildLeader, pushGuildMemberQuit, pushGuildDismiss, pushGuildInfoUpdate } from '../../../services/guildService';
|
||||
import { GuildModel, GuildType, GuildUpdateParam } from '../../../db/Guild';
|
||||
import { RoleModel, RoleType } from '../../../db/Role';
|
||||
import { ARMY } from '../../../pubUtils/dicParam';
|
||||
@@ -92,9 +92,7 @@ export class GuildHandler {
|
||||
addRoleToGuildChannel(roleId, sid, guild.code);
|
||||
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, guild.code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
let chatSid = await getGuildChannelSid(guild.code);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await addGuildRecord(roleId, guild.code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
|
||||
// 返回
|
||||
const result = { ...guild, rank, myInfo: { ...userGuild, isOnline: true } };
|
||||
@@ -150,8 +148,7 @@ export class GuildHandler {
|
||||
if(isAuto != undefined) updateInfo.isAuto = isAuto;
|
||||
if(icon != undefined) updateInfo.icon = icon;
|
||||
const guild = await GuildModel.updateInfo(code, updateInfo, {}, select.join(' '));
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { name, notice, introduce, ceLimit, isAuto });
|
||||
await pushGuildInfoUpdate(code, { name, notice, introduce, ceLimit, isAuto });
|
||||
|
||||
if(name != undefined) {
|
||||
await updateUserInfo(REDIS_KEY.GUILD_INFO, code, [{ field: 'name', value: name }]);
|
||||
@@ -239,19 +236,17 @@ export class GuildHandler {
|
||||
|
||||
// 添加动态
|
||||
if (auth == GUILD_AUTH.MANAGER) {
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.SET_MANAGER, [role.roleName]);
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { managerCnt: guild.managerCnt });
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await pushGuildInfoUpdate(code, { managerCnt: guild.managerCnt });
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.SET_MANAGER, [role.roleName]);
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_SET_MANAGER, memberRoleId, { sendName: roleName, params: [guild.name] });
|
||||
} else if (auth == GUILD_AUTH.LEADER) {
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.SET_LEADER, [roleName, role.roleName]);
|
||||
this.app.rpc.chat.guildRemote.changeLeader.toServer(chatSid, code, guild.managerCnt, role, roleId);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await pushChangeGuildLeader(code, guild.managerCnt, role, roleId);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.SET_LEADER, [roleName, role.roleName]);
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_SET_LEADER, memberRoleId, { sendName: roleName, params: [guild.name] });
|
||||
|
||||
reportTAEvent(roleId, TA_EVENT.GUILD_MASTER_CHANGE, { way: GUILD_MASTER_CHANGE_WAY, change_id_after: memberRoleId }, ip);
|
||||
} else {
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { managerCnt: guild.managerCnt });
|
||||
await pushGuildInfoUpdate(code, { managerCnt: guild.managerCnt });
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_SET_MEMBER, memberRoleId, { sendName: roleName, params: [guild.name] });
|
||||
}
|
||||
|
||||
@@ -317,12 +312,10 @@ export class GuildHandler {
|
||||
}
|
||||
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
// 更新人数增加
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
await pushGuildInfoUpdate(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);
|
||||
hasGuild = true;
|
||||
} else { // 不自动加入,插入申请表
|
||||
await UserGuildApplyModel.createUserGuildApply(role, guild, GUILD_APPLY_TYPE.APPLY);
|
||||
@@ -365,13 +358,10 @@ export class GuildHandler {
|
||||
for (let { roleId } of applyList) {
|
||||
const joinResult = await joinGuild(code, guild.name, guild.lv, roleId, serverId, session);
|
||||
if (joinResult.status == -1) continue;
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
// 更新人数增加
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
await pushGuildInfoUpdate(code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [joinResult.roleName]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [joinResult.roleName]);
|
||||
roleIds.push(roleId);
|
||||
}
|
||||
} else { // 拒绝申请,删除申请
|
||||
@@ -491,12 +481,10 @@ export class GuildHandler {
|
||||
return joinResult.resResult;
|
||||
}
|
||||
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
// 更新人数增加
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
await pushGuildInfoUpdate(code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [joinResult.roleName]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [joinResult.roleName]);
|
||||
|
||||
code = guild.code;
|
||||
}
|
||||
@@ -572,11 +560,8 @@ export class GuildHandler {
|
||||
await this.app.rpc.connector.connectorRemote.setOtherUserGuildSession.broadcast(members.map(roleId => { return { roleId, userGuild: null } })); // 更新session
|
||||
|
||||
// 删除channel
|
||||
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
await guildDismisActivity(code, serverId);
|
||||
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 });
|
||||
@@ -613,10 +598,8 @@ export class GuildHandler {
|
||||
await removeBossRank(code, roleId);
|
||||
await removeTrainRank(code, roleId, guild.trainId);
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [roleName]);
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
this.app.rpc.chat.guildRemote.memberQuit.toServer(chatSid, code, roleId, guild, sid);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [roleName]);
|
||||
await pushGuildMemberQuit(roleId, code, guild, sid);
|
||||
|
||||
setUserGuildSession(session, null);
|
||||
reportTAEvent(roleId, TA_EVENT.GUILD_QUIT, { name: guild.name, way: GUILD_QUIT_WAY.QUIT }, ip);
|
||||
@@ -646,14 +629,11 @@ export class GuildHandler {
|
||||
//删除排名信息
|
||||
await removeBossRank(code, roleId);
|
||||
await removeTrainRank(code, roleId, guild.trainId);
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
|
||||
const { isOnline, sid } = await getRoleOnlineInfo(memberRoleId);
|
||||
this.app.rpc.chat.guildRemote.memberQuit.toServer(chatSid, code, roleId, guild, sid);
|
||||
await pushGuildMemberQuit(roleId, code, guild, sid);
|
||||
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [role.roleName]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.QUIT_GUILD, [role.roleName]);
|
||||
if(isOnline) {
|
||||
await this.app.rpc.connector.connectorRemote.setOtherUserGuildSession.toServer(sid,[{ roleId: memberRoleId, userGuild }]);
|
||||
changeGuildActivity('', serverId, memberRoleId, sid);
|
||||
@@ -717,11 +697,8 @@ export class GuildHandler {
|
||||
const guild = await GuildModel.updateInfo(code, { leader: topUser._id }, { managerCnt: managerCntInc }, 'managerCnt name'); // 如果有转让团长设置leader
|
||||
|
||||
// 添加动态
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.IMPEACH, [oldRoleName, topUser.roleName]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
|
||||
this.app.rpc.chat.guildRemote.changeLeader.toServer(chatSid, code, guild.managerCnt, topUser, leaderRoleId);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.IMPEACH, [oldRoleName, topUser.roleName]);
|
||||
await pushChangeGuildLeader(code, guild.managerCnt, topUser, leaderRoleId);
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_IMPEACH, leaderRoleId, { sendName: roleName, params: [guild.name] });
|
||||
await sendMailByContent(MAIL_TYPE.GUILD_BE_SET_LEADER, topUser.roleId, { sendName: roleName, params: [guild.name] });
|
||||
|
||||
@@ -776,14 +753,12 @@ export class GuildHandler {
|
||||
const resultStructure = result.structure.find(cur => cur.id == id);
|
||||
|
||||
// 修改信息
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { ...result });
|
||||
await pushGuildInfoUpdate(code, { ...result });
|
||||
await updateUserInfo(REDIS_KEY.GUILD_INFO, code, [{ field: 'lv', value: result.lv }]);
|
||||
|
||||
// 添加动态
|
||||
const structureName = GUILD_STRUCTURE_NAME.get(id);
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.STRUCTURE_UP, [structureName, resultStructure.lv.toString()]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.STRUCTURE_UP, [structureName, resultStructure.lv.toString()]);
|
||||
|
||||
// 军团频道聊天消息
|
||||
pushGuildUpStructureMsg(roleId, roleName, result, resultStructure);
|
||||
@@ -909,10 +884,7 @@ export class GuildHandler {
|
||||
const { guild, userGuild } = result;
|
||||
|
||||
let { activeDaily, activeWeekly } = guild;
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { activeDaily, activeWeekly });
|
||||
|
||||
await pushGuildInfoUpdate(code, { activeDaily, activeWeekly });
|
||||
return resResult(STATUS.SUCCESS, { activeDaily, activeWeekly, myInfo: userGuild });
|
||||
}
|
||||
|
||||
@@ -934,8 +906,7 @@ export class GuildHandler {
|
||||
// return resResult(STATUS.TOKEN_ERR);
|
||||
// }
|
||||
const guild = await GuildModel.updateInfo(code, {}, { fund: count }, 'fund');
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { fund: guild.fund });
|
||||
await pushGuildInfoUpdate(code, { fund: guild.fund });
|
||||
return resResult(STATUS.SUCCESS, { code, fund: guild.fund });
|
||||
}
|
||||
|
||||
@@ -1001,10 +972,8 @@ export class GuildHandler {
|
||||
await removeBossRank(oldCode, roleId);
|
||||
await removeTrainRank(oldCode, roleId, guild.trainId);
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, oldCode, GUILD_REC_TYPE.QUIT_GUILD, [roleName]);
|
||||
let chatSid = await getGuildChannelSid(oldCode);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
this.app.rpc.chat.guildRemote.memberQuit.toServer(chatSid, oldCode, roleId, guild, sid);
|
||||
await addGuildRecord(roleId, oldCode, GUILD_REC_TYPE.QUIT_GUILD, [roleName]);
|
||||
await pushGuildMemberQuit(roleId, oldCode, guild, sid);
|
||||
|
||||
setUserGuildSession(session, userGuild);
|
||||
}
|
||||
@@ -1015,12 +984,9 @@ export class GuildHandler {
|
||||
}
|
||||
|
||||
// 添加动态
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
await addGuildRecord(roleId, code, GUILD_REC_TYPE.JOIN_GUILD, [roleName]);
|
||||
// 更新人数增加
|
||||
let chatSid = await getGuildChannelSid(code);
|
||||
|
||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(chatSid, rec);
|
||||
await pushGuildInfoUpdate(code, { memberCnt: joinResult.memberCnt, guildCe: joinResult.guildCe });
|
||||
return resResult(STATUS.SUCCESS, { code });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import { GuildTrainReportModel } from '../../../db/GuildTrainReport';
|
||||
import { DATA_NAME } from '../../../consts/dataName';
|
||||
import { pushGuildTrainSucMsg } from '../../../services/chatService';
|
||||
import { checkTaskInGuildTrain } from '../../../services/task/taskService';
|
||||
import { sendPopUpActivityData } from '../../../services/guildActivity/guildActivityService';
|
||||
import { guildInter, RewardInter } from '../../../pubUtils/interface';
|
||||
import { getGuildTrainGkInfo } from '../../../pubUtils/data';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Application, ChannelService, BackendSession, HandlerService, } from "pinus";
|
||||
import { GUILD_ACTIVITY_TYPE, STATUS, GUILD_ACTIVITY_STATUS, GUILD_POINT_WAYS, REDIS_KEY, TASK_TYPE } from "../../../consts";
|
||||
import { GUILD_ACTIVITY_TYPE, STATUS, GUILD_ACTIVITY_STATUS, GUILD_POINT_WAYS, REDIS_KEY, TASK_TYPE, PUSH_ROUTE } from "../../../consts";
|
||||
import { resResult } from "../../../pubUtils/util";
|
||||
import { getGuildActivityStatus, getRaceActivityObj, getRaceActivityRank, getWoodenHorseList, calWoodenHorseAndSend, raceActivitySettleReward } from "../../../services/guildActivity/guildActivityService";
|
||||
import { UserGuildModel } from "../../../db/UserGuild";
|
||||
@@ -11,6 +11,7 @@ import { checkTask } from "../../../services/task/taskService";
|
||||
import { guildInter } from "../../../pubUtils/interface";
|
||||
import { getGuildChannelSid } from "../../../services/chatService";
|
||||
import { ServerRecordModel } from "../../../db/ServerRecords";
|
||||
import { sendMessageToGuildWithSuc } from "../../../services/pushService";
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -88,8 +89,8 @@ export class RaceActivityHandler {
|
||||
if (!woodenHorse) return resResult(STATUS.GUILD_AUTH_NOT_ENOUGH);
|
||||
|
||||
let events = obj.getEvents(guildCode, woodenHorse.distance);
|
||||
let chatSid = await getGuildChannelSid(guildCode);
|
||||
this.app.rpc.chat.guildRemote.pushRaceHorseJoin.toServer(chatSid, guildCode, woodenHorse);
|
||||
await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.GUILD_RACE_JOIN, { timestamp: Date.now(), woodenHorse });
|
||||
|
||||
// 全服活跃统计
|
||||
await ServerRecordModel.addActiveGuild(serverId, guildCode);
|
||||
// 任务
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { sendAllGuildRanks, sendGuildActEndMsg, calWoodenHorseAndSend, sendRaceStartMsg, setDicGuildActivity, setDicAuctionTime } from '../../../services/guildActivity/guildActivityService';
|
||||
import { sendAllGuildRanks, calWoodenHorseAndSend, sendRaceStartMsg, setDicGuildActivity, setDicAuctionTime, settleGuildActivityReward } from '../../../services/guildActivity/guildActivityService';
|
||||
import { gameData } from '../../../pubUtils/data';
|
||||
import { setWeek } from '../../../pubUtils/timeUtil';
|
||||
import { sendUngotDividend } from '../../../services/auctionService';
|
||||
@@ -14,10 +14,8 @@ export class GuildActivityRemote {
|
||||
|
||||
constructor(private app: Application) {
|
||||
this.app = app;
|
||||
this.channelService = app.get('channelService');
|
||||
}
|
||||
|
||||
private channelService: ChannelService;
|
||||
private currentTime: number = Date.now();
|
||||
private setTime: number = Date.now();
|
||||
|
||||
@@ -37,7 +35,7 @@ export class GuildActivityRemote {
|
||||
*/
|
||||
public async guildActivityEnd(aid: number) {
|
||||
try {
|
||||
await sendGuildActEndMsg(aid);
|
||||
await settleGuildActivityReward(aid);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,8 @@ export class GuildRemote {
|
||||
|
||||
constructor(private app: Application) {
|
||||
this.app = app;
|
||||
this.channelService = app.get('channelService');
|
||||
}
|
||||
|
||||
private channelService: ChannelService;
|
||||
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,6 @@ import { ComBattleRemote } from './battle/remote/comBattleRemote';
|
||||
import { BattleRemote } from './battle/remote/battleRemote';
|
||||
import { ConnectorRemote } from './connector/remote/connectorRemote';
|
||||
import { SystimerRemote } from './systimer/remote/systimerRemote';
|
||||
import { GuildRemote } from './chat/remote/guildRemote';
|
||||
import { GMRemote } from './gm/remote/gmRemote';
|
||||
import { RoleRemote } from './role/remote/roleRemote';
|
||||
import { GuildActivityRemote } from './guild/remote/guildActivityRemote';
|
||||
@@ -26,7 +25,6 @@ declare global {
|
||||
};
|
||||
chat: {
|
||||
chatRemote: RemoterClass<FrontendSession, ChatRemote>;
|
||||
guildRemote: RemoterClass<FrontendSession, GuildRemote>;
|
||||
};
|
||||
connector: {
|
||||
connectorRemote: RemoterClass<FrontendSession, ConnectorRemote>;
|
||||
|
||||
Reference in New Issue
Block a user