助战异常,宝物报null,已处理
parent
73e8edece0
commit
ce5a23492e
|
@ -232,23 +232,33 @@ public class CBean2Proto {
|
|||
return lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编译助战状态
|
||||
* @param propertyItems 装备列表
|
||||
* @return proto对象
|
||||
*/
|
||||
private static List<CommonProto.Equip> buildHelpFightEquip(List<PropertyItem> propertyItems){
|
||||
List<CommonProto.Equip> resultEquip = new ArrayList<>();
|
||||
if (propertyItems != null && !propertyItems.isEmpty()){
|
||||
for (PropertyItem item : propertyItems) {
|
||||
if (item == null){
|
||||
continue;
|
||||
}
|
||||
resultEquip.add(getPropertyEquipProto(item));
|
||||
}
|
||||
}
|
||||
return resultEquip;
|
||||
}
|
||||
|
||||
/**
|
||||
* 助战,redis类型转proto
|
||||
*/
|
||||
public static CommonProto.HelpFightList helpHeroProto(HelpHero helpHero) throws Exception {
|
||||
User otherUser = UserManager.getUser(helpHero.getUid());
|
||||
// 魂宝灵宝
|
||||
List<CommonProto.Equip> jewels = new ArrayList<>();
|
||||
List<PropertyItem> jewel = helpHero.getJewels();
|
||||
if (jewel != null && !jewel.isEmpty()){
|
||||
jewel.forEach(item->jewels.add(getPropertyEquipProto(item)));
|
||||
}
|
||||
List<CommonProto.Equip> jewels = buildHelpFightEquip(helpHero.getJewels());
|
||||
// 法相
|
||||
List<CommonProto.Equip> faxiang = new ArrayList<>();
|
||||
List<PropertyItem> faxiangs = helpHero.getFaxiangs();
|
||||
if (faxiangs != null && !faxiangs.isEmpty()){
|
||||
faxiangs.forEach(item->faxiang.add(getPropertyEquipProto(item)));
|
||||
}
|
||||
List<CommonProto.Equip> faxiang = buildHelpFightEquip(helpHero.getFaxiangs());
|
||||
// 装备详细信息
|
||||
List<CommonProto.Equip> equips = new ArrayList<>();
|
||||
Map<Integer, Integer> equip = helpHero.getHero().getEquipByPositionMap();
|
||||
|
@ -286,7 +296,7 @@ public class CBean2Proto {
|
|||
* 助战,hero对象转redis类型
|
||||
* 存入redis时调用
|
||||
*/
|
||||
public static HelpHero heroToHelpHero(User user,Hero hero) throws Exception {
|
||||
public static HelpHero heroToHelpHero(User user,Hero hero) {
|
||||
// 获取神将类型
|
||||
HelpTypeEnum type = HelpTypeEnum.getType(hero.getPropertyId());
|
||||
// 英雄镜像
|
||||
|
@ -296,7 +306,6 @@ public class CBean2Proto {
|
|||
List<PropertyItem> jewels = clonePropertyItemList(equipManager, heroVo.getJewelInfo());
|
||||
// 法相
|
||||
List<PropertyItem> faxiangs = clonePropertyItemList(equipManager, heroVo.getFaxiangList());
|
||||
|
||||
// 结果返回,援助类型不在这里写
|
||||
HelpHero helpHero = new HelpHero();
|
||||
helpHero.setUid(user.getId());
|
||||
|
|
Loading…
Reference in New Issue