Task【ID1006213】【新战斗版本】大闹天宫(猎妖之路功能优化)

back_recharge
zhangshanxue 2020-05-22 23:45:59 +08:00
parent 6302d70fed
commit 03a0cb9d51
5 changed files with 23 additions and 11 deletions

View File

@ -146,7 +146,7 @@ public class EndConfirmExpeditionBattleRequestHandler extends BaseHandler<Expedi
//更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
builder.addAllNodeInfo(EndExpeditionBattleRequest.getNodePro(user,oldlay,nodeId));
builder.addNodeInfo(EndExpeditionBattleRequest.getNodePro(user,oldlay,nodeId));
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);

View File

@ -164,13 +164,11 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
);
}
//更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
Set<CommonProto.ExpeditionNodeInfo> collect = nodeInfos.stream().filter(expeditionNodeInfo -> expeditionNodeInfo.getSortId() != nodeId).collect(Collectors.toSet());
builder.addAllNodeInfo(getNodePro(user,oldlay,nodeId));
builder.addAllNodeInfo(collect);
builder.addNodeInfo(getNodePro(user,oldlay,nodeId));
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
}
@ -212,7 +210,12 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
//出队伍
user.getTeamPosManager().updateTeamPosByTeamId(1001,teamPosHeroInfos);
nodeInfo.setState(ExpeditionLogic.NODESTATE_NOT_GET);
if (ExpeditionLogic.isBattleNode(nodeInfo.getType())) {
nodeInfo.setState(ExpeditionLogic.NODESTATE_NOT_GET);
}
if(!STableManager.getConfig(SExpeditionFloorConfig.class).containsKey(oldlay+1))
{//最后一层直接更新 领取宝箱时候校验
user.getExpeditionManager().setLay(oldlay+1);
@ -223,7 +226,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
//更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
builder.addAllNodeInfo(getNodePro(user,oldlay,nodeId));
SExpeditionNodeConfig sExpeditionNodeConfig = STableManager.getConfig(SExpeditionNodeConfig.class).get(nodeInfo.getType());
if (sExpeditionNodeConfig == null) {
@ -268,9 +271,9 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
}
}
builder.addNodeInfo(getNodePro(user,oldlay,nodeId));
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
//drop
Expedition.EndExpeditionBattleResponse.Builder response = Expedition.EndExpeditionBattleResponse.newBuilder();
@ -280,8 +283,8 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
}
public static Set<CommonProto.ExpeditionNodeInfo> getNodePro(User user,int oldlay,int nodeId){
return getNodePro(user, oldlay, Collections.singletonList(nodeId));
public static CommonProto.ExpeditionNodeInfo getNodePro(User user,int oldlay,int nodeId){
return getNodePro(user, oldlay, Collections.singletonList(nodeId)).iterator().next();
}

View File

@ -77,7 +77,7 @@ public class TakeLayRewardHandler extends BaseHandler<Expedition.TakeExpeditionB
if(user.getExpeditionManager().getRewardBox().contains(laycfg)){
throw new ErrorCodeException(ErrorCode.newDefineCode("已领取"));
}
user.getExpeditionManager().addRewardBox(laycfg);
//drop
int[][] reward = boxMap.get(laycfg);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.EXPEDITION_BOX_REWARD);
@ -116,6 +116,7 @@ public class TakeLayRewardHandler extends BaseHandler<Expedition.TakeExpeditionB
ExpeditionManager manager = user.getExpeditionManager();
manager.clearExpeditionNodeInfos();
}
user.getExpeditionManager().addRewardBox(laycfg);
Expedition.TakeExpeditionBoxRewardResponse builder = Expedition.TakeExpeditionBoxRewardResponse.newBuilder().setDrop(drop).addAllLeve(objects).build();
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_BOXREWARD_RESONSE_VALUE, builder, true);

View File

@ -193,6 +193,7 @@ public class ExpeditionManager extends MongoBase {
public Map<String, Hero> getHeroMap() {
updateString("heroMap" , heroMap);
return heroMap;
}
@ -203,6 +204,11 @@ public class ExpeditionManager extends MongoBase {
equipMap.put(equip.getId(),equip);
}
public void clearEquip() throws Exception {
updateString("equipMap", equipMap);
equipMap.clear();
}
public void clearEquipToTemp() throws Exception {
updateString("equipMapTemp" , equipMapTemp);
equipMapTemp.clear();

View File

@ -95,7 +95,9 @@ public class ExpeditionLogic {
manager.getHeroHPWithChange().clear();
manager.setCurrentTime(openTimeOfFuntionCacheByType.getTimes());
manager.clearHeroToTemp();
manager.getHeroMap().clear();
manager.clearEquipToTemp();
manager.clearEquip();
manager.setFreshTime((int)(System.currentTimeMillis()/1000));
checkAndResetTreasure(user);
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Expedition.getFunctionType());
@ -463,7 +465,7 @@ public class ExpeditionLogic {
try {
ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
}catch (Exception e){
e.printStackTrace();
// e.printStackTrace();
}
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
int i1 = ranndomFromWeight(type2holy2weight);