聊天:推送部分军团消息
This commit is contained in:
@@ -14,6 +14,7 @@ import { checkAuth, addActive } from '../../../services/guildService';
|
||||
import { GuildModel } from '../../../db/Guild';
|
||||
import { getBossByLv } from '../../../pubUtils/data';
|
||||
import { lockData } from '../../../services/redLockService';
|
||||
import { pushGuildBossSucMsg } from '../../../services/chatService';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new GuildHandler(app);
|
||||
@@ -137,6 +138,7 @@ export class GuildHandler {
|
||||
async action (msg: { damage: number, battleCode: string }, session: BackendSession ) {
|
||||
const { battleCode, damage } = msg;
|
||||
const roleId: string = session.get('roleId');
|
||||
const roleName: string = session.get('roleName');
|
||||
const serverId: number = parseInt(session.get('serverId'));
|
||||
let userGuild = await UserGuildModel.getMyGuild(roleId, 'guildCode');
|
||||
if (!userGuild)
|
||||
@@ -153,6 +155,7 @@ export class GuildHandler {
|
||||
if (!flag) {
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
}
|
||||
pushGuildBossSucMsg(roleId, roleName, code, bossInstance);
|
||||
return resResult(STATUS.SUCCESS, { bossHp: 0 });
|
||||
} else {
|
||||
pushBossHpMessage(code, serverId, bossInstance.bossHp);
|
||||
|
||||
@@ -21,7 +21,7 @@ import { openGuildRefine } from '../../../services/guildRefineService';
|
||||
import { unlockTrain } from '../../../services/guildTrainService';
|
||||
import { removeBossRank } from '../../../services/guildBossService';
|
||||
import { removeTrainRank } from '../../../services/guildTrainService';
|
||||
import { pushGuildNoticeUpdateMsg } from '../../../services/chatService';
|
||||
import { pushGuildNoticeUpdateMsg, pushGuildUpStructureMsg } from '../../../services/chatService';
|
||||
export default function (app: Application) {
|
||||
return new GuildHandler(app);
|
||||
}
|
||||
@@ -735,6 +735,7 @@ export class GuildHandler {
|
||||
async upStructure(msg: { code: string, id: number }, session: BackendSession) {
|
||||
|
||||
const roleId = session.get('roleId');
|
||||
const roleName = session.get('roleName');
|
||||
const serverId = session.get('serverId');
|
||||
const sid = session.get('sid');
|
||||
const { code, id } = msg;
|
||||
@@ -778,6 +779,9 @@ export class GuildHandler {
|
||||
const rec = await GuildRecModel.createGuildRec(roleId, code, GUILD_REC_TYPE.STRUCTURE_UP, [structureName, resultStructure.lv.toString()]);
|
||||
this.app.rpc.chat.guildRemote.addRec.toServer(CHAT_SERVER,rec);
|
||||
|
||||
// 军团频道聊天消息
|
||||
pushGuildUpStructureMsg(roleId, roleName, result);
|
||||
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { ARMY } from '../../../pubUtils/dicParam';
|
||||
import { addActive } from '../../../services/guildService';
|
||||
import { GuildTrainReportModel } from '../../../db/GuildTrainReport';
|
||||
import { DATA_NAME } from '../../../consts/dataName';
|
||||
import { pushGuildTrainSucMsg } from '../../../services/chatService';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new GuildTrainHandler(app);
|
||||
@@ -238,6 +239,7 @@ export class GuildTrainHandler {
|
||||
//type 1:失败, 2:成功,3:表示系统战报即:被成功压制
|
||||
reports.push({ type: 3, time:nowSeconds(), score: addScore, roleName, trainId, hid, difficulty: battleRecord.record.difficulty });
|
||||
guildTrain = await unlockTrain(code, trainId + 1);
|
||||
pushGuildTrainSucMsg(roleId, roleName, code, hid);
|
||||
}
|
||||
res.releaseCallback();//解锁
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user