Ejemplo n.º 1
0
  @Override
  public void handleReply() throws Exception {
    LlpMessage message = null;
    try {
      message = LlpJava.instance().getMessage("s_aroundAllRole");
      if (newList != null) {
        for (Long roleId : newList) {
          LlpMessage aroundAllRoleInfo = message.write("aroundAllRoleInfoList");

          if (ServerManager.instance().isOnline(roleId)) {
            Role role = ServerManager.instance().getOnlinePlayer(roleId);
            aroundAllRoleInfo.write("roleId", role.getId());
            aroundAllRoleInfo.write("name", role.getNick());
            aroundAllRoleInfo.write("figure", role.getFigure());
            aroundAllRoleInfo.write("vocation", role.getVocation().getName());
            aroundAllRoleInfo.write("level", role.getLevel());
          }
        }
      }
      channel.write(message);
    } finally {
      if (message != null) {
        message.destory();
      }
    }
  }
Ejemplo n.º 2
0
  /**
   * 小地图
   *
   * @param role 角色对象
   */
  public static void refreshMiniMap(Role role) {
    LlpMessage llpMessage = null;
    try {
      if (role != null && role.getChannel() != null) {
        llpMessage = LlpJava.instance().getMessage("s_refresh_miniMap");
        List<MapRaidsInfo> list = role.getRaidsTeamInfo().getRaidsFloor().getMapRaidsInfos();
        for (int i = 0; i < list.size(); i++) {
          MapRaidsInfo mapRaidsInfo = list.get(i);
          LlpMessage msg = llpMessage.write("raidsCellInfoList");
          msg.write("index", i);
          msg.write("state", mapRaidsInfo.getState());
          msg.write("number", mapRaidsInfo.numberOnMap());
        }
        role.getChannel().write(llpMessage);
      }

    } catch (Exception e) {
      LogManager.info("异常报告:通知客户端副本信息");
      e.printStackTrace();
    } finally {
      if (llpMessage != null) {
        llpMessage.destory();
      }
    }
  }
Ejemplo n.º 3
0
 @Override
 public void handleReply() throws Exception {
   LlpMessage message = null;
   try {
     message = LlpJava.instance().getMessage("s_shenbingReset");
     message.write("result", result);
     message.write("reason", reason);
     channel.write(message);
   } finally {
     if (message != null) {
       message.destory();
     }
   }
 }
Ejemplo n.º 4
0
 @Override
 public void handleReply() throws Exception {
   LlpMessage message = null;
   try {
     message = LlpJava.instance().getMessage("s_unloadEquip");
     message.write("result", result);
     message.write("reason", reason);
     channel.write(message);
   } finally {
     if (message != null) {
       message.destory();
     }
   }
   if (result == 0) {
     BagMessage.sendBag(online, cellsMap, false);
     BagMessage.sendEquip(online);
   }
 }
Ejemplo n.º 5
0
 @Override
 public void handleReply() throws Exception {
   LlpMessage message = null;
   try {
     message = LlpJava.instance().getMessage("s_partnerOut");
     message.write("result", result);
     message.write("reason", reason);
     if (result == 0) {
       PartnerMessage.sendPartners(online, partnerList);
       PartnerMessage.refreshFightPartner(online);
     }
     channel.write(message);
   } finally {
     if (message != null) {
       message.destory();
     }
   }
 }
Ejemplo n.º 6
0
 @Override
 public void handleReply() throws Exception {
   LlpMessage llpMessage = null;
   try {
     llpMessage = LlpJava.instance().getMessage("s_bodyIntensify");
     llpMessage.write("result", result);
     llpMessage.write("reason", reason);
     channel.write(llpMessage);
   } finally {
     if (llpMessage != null) {
       llpMessage.destory();
     }
   }
   if (result == 0) {
     // ======发送部位强化======
     SendMessage.sendBodyIntensify(online);
     SendMessage.sendSttribute(online);
   }
 }
Ejemplo n.º 7
0
  public static void refreshRaids(MapRaidsInfo mapRaidsInfo) {
    LlpMessage llpMessage = null;
    try {
      llpMessage = LlpJava.instance().getMessage("s_refresh_raids");
      llpMessage.write(
          "floorMax", mapRaidsInfo.getRaidsTeamInfo().getRaidsInfo().getFloorMax()); // 总层数
      llpMessage.write(
          "state", mapRaidsInfo.getRaidsTeamInfo().getRaidsState()); // 整个副本状态(0.未通关,1.通关)
      llpMessage.write("floor", mapRaidsInfo.getRaidsTeamInfo().getRaidsFloor().getFloor()); // 当前层数
      llpMessage.write(
          "floorState",
          mapRaidsInfo.getRaidsTeamInfo().getRaidsFloor().getState()); // 本层状态(0.未通关,1.通关)
      llpMessage.write("index", mapRaidsInfo.getIndex());
      llpMessage.write("cellState", mapRaidsInfo.getState()); // 状态(0.未通关,1.通关)

      //			System.out.println("floorMax======>" +
      // mapRaidsInfo.getRaidsTeamInfo().getRaidsInfo().getFloorMax());
      //			System.out.println("state======>" + mapRaidsInfo.getRaidsTeamInfo().getRaidsState());
      //			System.out.println("floor======>" +
      // mapRaidsInfo.getRaidsTeamInfo().getRaidsFloor().getFloor());
      //			System.out.println("floorState======>" +
      // mapRaidsInfo.getRaidsTeamInfo().getRaidsFloor().getState());
      //			System.out.println("index======>" + mapRaidsInfo.getIndex());
      //			System.out.println("cellState======>" + mapRaidsInfo.getState());

      for (Long roleId : mapRaidsInfo.allInMap()) {
        if (ServerManager.instance().isOnline(roleId)) {
          Role role = ServerManager.instance().getOnlinePlayer(roleId);
          //					System.out.println("roleId=" + roleId);
          role.getChannel().write(llpMessage);
        }
      }
    } catch (Exception e) {
      LogManager.info("异常报告:通知客户端副本信息");
      e.printStackTrace();
    } finally {
      if (llpMessage != null) {
        llpMessage.destory();
      }
    }
  }
Ejemplo n.º 8
0
  @Override
  public void handleReply() throws Exception {
    LlpMessage llpMessage = null;
    try {
      llpMessage = LlpJava.instance().getMessage("s_kill");
      llpMessage.write("result", result);
      llpMessage.write("reason", reason);
      channel.write(llpMessage);
    } finally {
      if (llpMessage != null) {
        llpMessage.destory();
      }
    }

    if (result == 0) {
      online.setBattle(true);
      BattleManager.instance().addBattleProcessor(new BattleProcessorCenter(battleInfo));
      online.setBattleId(battleInfo.getBattleId()); // 设置战斗编号
      FightMessage.sendEncounterResult(battleInfo, online);
    }
    online.setPrBattle(false);
  }
Ejemplo n.º 9
0
 /**
  * 刷新副本状态
  *
  * @param role 角色对象
  */
 public static void refreshRaids(Role role) {
   LlpMessage llpMessage = null;
   try {
     if (role != null && role.getChannel() != null && role.isLogon()) {
       llpMessage = LlpJava.instance().getMessage("s_refresh_raids");
       llpMessage.write("floorMax", role.getRaidsTeamInfo().getRaidsInfo().getFloorMax()); // 总层数
       llpMessage.write("state", role.getRaidsTeamInfo().getRaidsState()); // 整个副本状态(0.未通关,1.通关)
       llpMessage.write("floor", role.getRaidsTeamInfo().getRaidsFloor().getFloor()); // 当前层数
       llpMessage.write(
           "floorState", role.getRaidsTeamInfo().getRaidsFloor().getState()); // 本层状态(0.未通关,1.通关)
       MapRaidsInfo mapRaidsInfo = (MapRaidsInfo) role.getMapInfo().getBaseMap();
       llpMessage.write("index", mapRaidsInfo.getIndex());
       llpMessage.write("cellState", mapRaidsInfo.getState()); // 状态(0.未通关,1.通关)
       role.getChannel().write(llpMessage);
     }
   } catch (Exception e) {
     LogManager.info("异常报告:通知客户端副本信息");
     e.printStackTrace();
   } finally {
     if (llpMessage != null) {
       llpMessage.destory();
     }
   }
 }