diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/HongmengGetInfoRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/HongmengGetInfoRequestHandler.java index 4ed5d85a9..1feab5931 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/HongmengGetInfoRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/HongmengGetInfoRequestHandler.java @@ -8,14 +8,14 @@ import rpc.protocols.HeroInfoProto; import rpc.protocols.MessageTypeProto; @Component -public class HongmengGetInfoRequestHandler extends BaseHandler { +public class HongmengGetInfoRequestHandler extends BaseHandler { @Override public MessageTypeProto.MessageType getMessageCode() { return MessageTypeProto.MessageType.HONGMENG_GET_INFO_REQUEST; } @Override - public void processWithProto(ISession session, HeroInfoProto.ResonanceRequest proto) throws Exception { - HeroLogic.getInstance().getHongmengInfo(session, MessageTypeProto.MessageType.HONGMENG_GET_INFO_RESPONSE); + public void processWithProto(ISession session, HeroInfoProto.GetHongmengInfoRequest proto) throws Exception { + HeroLogic.getInstance().addOrUpdateHongmeng(session, true); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 119848b07..00c6be171 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -4316,32 +4316,26 @@ public class HeroLogic{ if(isInTeam(user,heroId,1)){ Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid())); } - - MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true); } // ================================共鸣、鸿蒙碑========================= // /** - * 获取鸿蒙阵信息 + * 推送鸿蒙阵信息 * @param session - * @param messageType * @throws Exception */ - public void getHongmengInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception { - // 刷新鸿蒙阵 - addOrUpdateHongmeng(session); - - HeroInfoProto.GetHongmengInfoResponse getHongmengInfoResponse = HeroInfoProto.GetHongmengInfoResponse.newBuilder().build(); - MessageUtil.sendMessage(session, 1, messageType.getNumber(), getHongmengInfoResponse); + public void addOrUpdateHongmeng(ISession session) throws Exception { + addOrUpdateHongmeng(session,false); } /** * 添加或更新鸿蒙守卫 * @param session + * @param judge true:返回,false:推送 */ - public void addOrUpdateHongmeng(ISession session) throws Exception { + public void addOrUpdateHongmeng(ISession session, boolean judge) throws Exception { User user = UserManager.getUser(session.getUid()); // 鸿蒙阵开启条件 @@ -4551,8 +4545,11 @@ public class HeroLogic{ .addAllHongmengResonacnes(hongmengResonancesProto) .setHongmengTabletMax(tabletMax) .build(); - - MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.HONGMENG_INFO_INDICATION.getNumber(),hongmengInfoIndication,true); + if (judge){ + MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HONGMENG_GET_INFO_RESPONSE_VALUE, hongmengInfoIndication, true); + }else { + MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.HONGMENG_INFO_INDICATION_VALUE,hongmengInfoIndication,true); + } } /**