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
  public static void refreshMiniMap(RaidsTeamInfo raidsTeamInfo) {
    LlpMessage llpMessage = null;
    try {
      llpMessage = LlpJava.instance().getMessage("s_refresh_miniMap");
      List<MapRaidsInfo> list = raidsTeamInfo.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());
      }
      for (Long roleId : raidsTeamInfo.getMemberIds()) {
        if (ServerManager.instance().isOnline(roleId)) {
          Role role = ServerManager.instance().getOnlinePlayer(roleId);
          role.getChannel().write(llpMessage);
        }
      }

    } catch (Exception e) {
      LogManager.info("异常报告:通知客户端副本信息");
      e.printStackTrace();
    } finally {
      if (llpMessage != null) {
        llpMessage.destory();
      }
    }
  }
Ejemplo n.º 3
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.º 4
0
  @Override
  public void handleReceived(LlpMessage msg) {
    Set<Long> list = online.getMapInfo().getBaseMap().allInMap();
    newList = new ArrayList<Long>();

    for (Long id : list) {
      Role role = ServerManager.instance().getOnlinePlayer(id);
      if (role != null && role.getTeam() == null && id != online.getId() && !newList.contains(id)) {
        newList.add(id);
      }
    }
  }