增加法宝容错机制
parent
7b6fb24a7c
commit
24d05a21b2
|
@ -58,6 +58,12 @@ public class GetAllHerosHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
}
|
||||
//法宝容错处理
|
||||
String fabaoId = hero.getBauBlesId();
|
||||
if(user.getEquipManager().getBaubles(fabaoId) == null){
|
||||
//法宝已经被删除,删掉法宝信息
|
||||
hero.setBauBlesId("");
|
||||
}
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
}
|
||||
boolean isSendFinish = false;
|
||||
|
|
|
@ -126,7 +126,13 @@ public class EquipManager extends MongoBase {
|
|||
}
|
||||
|
||||
public Baubles getBaubles(String equipId) {
|
||||
if(!getEquipMap().containsKey(equipId)){
|
||||
return null;
|
||||
}
|
||||
PropertyItem item = getEquipMap().get(equipId);
|
||||
if(item == null){
|
||||
return null;
|
||||
}
|
||||
if (item instanceof Baubles){
|
||||
return (Baubles) item;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue