Task【ID1005460】【玩法需求】猎妖之路 节点更新不对

back_recharge
zhangshanxue 2020-02-19 10:58:09 +08:00
parent 95b9eb58d5
commit cbfee44510
1 changed files with 21 additions and 19 deletions

View File

@ -119,22 +119,6 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
//更新节点状态 节点
final int oldlay = nodeInfo.getLay();
Set<CommonProto.ExpeditionNodeInfo> nodeInfos = new HashSet<>();
user.getExpeditionManager().getExpeditionNodeInfos().forEach((s, nodeInfo1) -> {
if (nodeInfo1.getLay() != oldlay) {
return;
}
CommonProto.ExpeditionNodeInfo.Builder build = CommonProto.ExpeditionNodeInfo.newBuilder()
.setSortId(nodeInfo1.getSortId())
.setState(nodeInfo1.getState());
if (nodeInfo1.getSortId() == nodeId) {
build.setBossTeaminfo(ExpeditionLogic.getExpeditionTeamInfoProto(nodeInfo1));
}else {
return;
}
nodeInfos.add(build.build());
});
Set<String> ids = new HashSet<>();
if (resultCode != 1) {
@ -156,14 +140,13 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
//更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
builder.addAllNodeInfo(nodeInfos);
builder.addAllNodeInfo(getNodePro(user,oldlay,nodeId));
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
Expedition.EndExpeditionBattleResponse.Builder response = Expedition.EndExpeditionBattleResponse.newBuilder();
response.setResult(resultCode);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_END_BATTLE_RESONSE_VALUE, response.build(), true);
System.out.print( response.build());
return;
} else {
//节点血量更新
@ -188,7 +171,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
//更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
builder.addAllNodeInfo(nodeInfos);
builder.addAllNodeInfo(getNodePro(user,oldlay,nodeId));
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
@ -206,4 +189,23 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_END_BATTLE_RESONSE_VALUE, response.build(), true);
}
private Set<CommonProto.ExpeditionNodeInfo> getNodePro(User user,int oldlay,int nodeId){
Set<CommonProto.ExpeditionNodeInfo> nodeInfos = new HashSet<>();
user.getExpeditionManager().getExpeditionNodeInfos().forEach((s, nodeInfo1) -> {
if (nodeInfo1.getLay() != oldlay) {
return;
}
CommonProto.ExpeditionNodeInfo.Builder build = CommonProto.ExpeditionNodeInfo.newBuilder()
.setSortId(nodeInfo1.getSortId())
.setState(nodeInfo1.getState());
if (nodeInfo1.getSortId() == nodeId) {
build.setBossTeaminfo(ExpeditionLogic.getExpeditionTeamInfoProto(nodeInfo1));
}else {
return;
}
nodeInfos.add(build.build());
});
return nodeInfos;
}
}