@Override public C3863_Arena3V3DetailRespMessage getArena3V3DetailRespMessage(RoleInstance role) { C3863_Arena3V3DetailRespMessage resp = new C3863_Arena3V3DetailRespMessage(); ArenaType arenaType = ArenaType._3V3; if (this.isOpenDarkDoor) { arenaType = ArenaType._3V3_DARK_DOOR; } ArenaConfig config = GameContext.getArenaApp().getArenaConfig(arenaType); if (null == config) { return null; } Reward3V3Config lastReward = this.getReward3V3Config(role.getRoleArena().getLastArenaLevel3v3()); if (null == lastReward) { return null; } RoleArena roleArena = role.getRoleArena(); if (null == roleArena) { return null; } float currentArenaLevel3v3 = roleArena.getArenaLevel3v3(); Reward3V3Config currentReward = this.getReward3V3Config(currentArenaLevel3v3); if (null == currentReward) { return null; } resp.setActiveId(config.getActiveId()); resp.setCurrentArenaLevel3v3((int) currentArenaLevel3v3); resp.setCurrentArenaLevel3v3Name(currentReward.getName()); Reward3V3Config nextReward = this.getNextReward3V3Config(currentArenaLevel3v3); resp.setNextArenaLevel3v3(nextReward.getArenaMinLevel()); resp.setNextArenaLevel3v3Name(nextReward.getName()); resp.setCycle3v3Score(roleArena.getCycle3v3Score()); resp.setMaxCycle3v3Score(lastReward.getMaxCycleScore()); resp.setWin(roleArena.getCycleWin3v3()); resp.setFail(roleArena.getCycleFail3v3()); resp.setArenaScore(role.getArena3v3Score()); resp.setMaxArenaScore(lastReward.getMaxRoleScore()); resp.setDesc(config.getDesc()); // 兑换参数 resp.setExchangeParam(config.getExchangeMenuId()); ApplyInfo info = GameContext.getArenaApp().getApplyInfo(role.getRoleId()); if (null == info) { return resp; } Team team = role.getTeam(); if (team == null || team.isLeader(role)) { resp.setArenaType(ApplyState.had_apply.getType()); } else { resp.setArenaType((byte) 2); } Date applyDate = new Date(info.getCreateDate()); resp.setTime(DateUtil.dateDiffSecond(applyDate, new Date())); return resp; }
@Override public void pushArena3v3RespMessage(RoleInstance role) { try { Team team = role.getTeam(); if (team != null && !team.isLeader(role)) { return; } if (this.isOpenDarkDoor) { // TODO: // GameContext.getDarkDoorApp().applyState(role.getRoleId(), // (byte)ArenaType._3V3_DARK_DOOR.getType()); return; } C3863_Arena3V3DetailRespMessage resp = this.getArena3V3DetailRespMessage(role); if (null == resp) { return; } role.getBehavior().sendMessage(resp); } catch (Exception e) { logger.error("ArenaApp.pushArena3v3RespMessage error:", e); } }