英雄图鉴修改
parent
77907afc30
commit
54778137a2
|
@ -132,7 +132,10 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
questState=user.getQuestionManager().getQuestState();
|
||||
}
|
||||
//图鉴信息
|
||||
Set<Integer> heroHandBookSet = user.getHeroManager().getHeroHandBook().keySet();
|
||||
Map<Integer, Integer> heroHandBook = user.getHeroManager().getHeroHandBook();
|
||||
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
||||
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
||||
|
||||
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
||||
int equipPool = user.getEquipManager().getSoulEquipPool();
|
||||
CommonProto.EndlessInfo.Builder endless = CommonProto.EndlessInfo.newBuilder();
|
||||
|
@ -154,7 +157,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setUserCreateTime((int)(playerInfoManager.getCreateTime()/1000))
|
||||
.addAllRedType(playerInfoManager.getReds())
|
||||
.setRandCount(alreadyCount)
|
||||
.addAllHeroHandBook(heroHandBookSet).addAllEquipHandBook(equipHandBookSet)
|
||||
.addAllHeroHandBook(heroHandBookList).addAllEquipHandBook(equipHandBookSet)
|
||||
.addAllGoodsTypeDuration(goodsTypeDurations)
|
||||
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
||||
.setTreasureLevel(playerInfoManager.getTreasureLevel())
|
||||
|
|
|
@ -57,7 +57,7 @@ public class HeroManager extends MongoBase {
|
|||
hero.init(this.getRootId(),getMongoKey() + ".heroMap." + hero.getId());
|
||||
updateString("heroMap." + hero.getId(), hero);
|
||||
heroMap.put(hero.getId(), hero);
|
||||
addHeroHandBook(hero.getTemplateId());
|
||||
addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
}
|
||||
|
||||
public Hero getHero(String heroId) {
|
||||
|
@ -86,12 +86,12 @@ public class HeroManager extends MongoBase {
|
|||
return totalCount;
|
||||
}
|
||||
|
||||
public void addHeroHandBook(int heroId){
|
||||
public void addHeroHandBook(int heroId,int star){
|
||||
if(heroHandBook.containsKey(heroId)){
|
||||
return;
|
||||
}
|
||||
heroHandBook.put(heroId,0);
|
||||
updateString("heroHandBook." + heroId, 0);
|
||||
heroHandBook.put(heroId,Math.max(heroHandBook.getOrDefault(heroId,0),star));
|
||||
updateString("heroHandBook." + heroId, star);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getHeroHandBook() {
|
||||
|
|
Loading…
Reference in New Issue