Key修改

back_recharge
lvxinran 2019-09-17 16:48:57 +08:00
parent 1127ca61ce
commit d26f1239ab
2 changed files with 27 additions and 20 deletions

View File

@ -176,6 +176,7 @@ public class RedisKey {
public static final String BLOODY_PERSON_BATTLE_INFO = "BLOODY_PERSON_BATTLE_INFO";
public static final String MATCH_SERVER_INFO = "MATCH_SERVER_INFO";
public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
public static final String BLOODY_SERVER_INFO = "BLOODY_SERVER_INFO";
public final static String CDKEY = "CDKEY";
@ -194,7 +195,7 @@ public class RedisKey {
familyKey.add(FAMILY_FIGHT_TOTAL_EXP);
}
public static String getKey(String type, String key, boolean withoutServerId) {
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)){
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||familyKey.contains(type)){
return type + RedisKey.Delimiter_colon + key;
}

View File

@ -119,29 +119,35 @@ public class CombatLogic {
MapManager mapManager = user.getMapManager();
Map<String, Map<Integer, Integer>> heroAllAttributeMap = bufferAddByEatFoodOrEventTrigger(foodIdOrEventId, mapManager.getHeroAllAttributeMap());
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
if(SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId()).getType()==4){
for(Map.Entry<String, Map<Integer, Integer>> entry:heroAllAttributeMap.entrySet()){
int per =(int) (entry.getValue().get(HeroAttributeEnum.CurHP.getPropertyId()) / (double) entry.getValue().get(HeroAttributeEnum.Hp.getPropertyId())*10000);
user.getMapManager().updateEndlessHeroHp(entry.getKey(),per);
}
}
SFoodsConfig sFoodsConfig = SFoodsConfig.getsFoodsConfigByFoodId(foodIdOrEventId);
int contiue = sFoodsConfig.getContiue();
if(contiue==0){
contiue=-1;
int teamId = mapManager.getTeamId();
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
Map<Integer,Integer> foodAddMap = new HashMap<>();
getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
continue;
}
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
}
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
// int teamId = mapManager.getTeamId();
// List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
// Map<Integer,Integer> foodAddMap = new HashMap<>();
// getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
// for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
// Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
// if (hero == null) {
// continue;
// }
// Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
// if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
// continue;
// }
//
// HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
// HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
// heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
// }
// mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
}
mapManager.eatFood(foodIdOrEventId,contiue);
}