back_recharge
zhangshanxue 2019-09-17 17:42:19 +08:00
commit 1bf2ab65c7
3 changed files with 28 additions and 25 deletions

View File

@ -95,17 +95,13 @@ public class ChatLogic {
int uid = iSession.getUid(); int uid = iSession.getUid();
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
PlayerManager playerInfoManager = user.getPlayerInfoManager(); PlayerManager playerInfoManager = user.getPlayerInfoManager();
if(playerInfoManager.getSilence()==1){
MessageUtil.sendErrorResponse(iSession,0,msgId,"您已被系统禁言");
return;
}
FriendManager friendManager = user.getFriendManager(); FriendManager friendManager = user.getFriendManager();
long nowTime = System.currentTimeMillis(); long nowTime = System.currentTimeMillis();
String tmp = SensitivewordFilter.replaceSensitiveWord(message, 1, "*"); String tmp = SensitivewordFilter.replaceSensitiveWord(message, 1, "*");
if(!tmp.equals(message)){ if(!tmp.equals(message)||playerInfoManager.getSilence()==1){
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1); ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1);
ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build(); ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build();
MessageUtil.sendMessage(iSession,1,msgId,response,true); MessageUtil.sendMessage(iSession,1,msgId,response,true);

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 BLOODY_PERSON_BATTLE_INFO = "BLOODY_PERSON_BATTLE_INFO";
public static final String MATCH_SERVER_INFO = "MATCH_SERVER_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 LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
public static final String BLOODY_SERVER_INFO = "BLOODY_SERVER_INFO";
public final static String CDKEY = "CDKEY"; public final static String CDKEY = "CDKEY";
@ -194,7 +195,7 @@ public class RedisKey {
familyKey.add(FAMILY_FIGHT_TOTAL_EXP); familyKey.add(FAMILY_FIGHT_TOTAL_EXP);
} }
public static String getKey(String type, String key, boolean withoutServerId) { 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; return type + RedisKey.Delimiter_colon + key;
} }

View File

@ -119,29 +119,35 @@ public class CombatLogic {
MapManager mapManager = user.getMapManager(); MapManager mapManager = user.getMapManager();
Map<String, Map<Integer, Integer>> heroAllAttributeMap = bufferAddByEatFoodOrEventTrigger(foodIdOrEventId, mapManager.getHeroAllAttributeMap()); Map<String, Map<Integer, Integer>> heroAllAttributeMap = bufferAddByEatFoodOrEventTrigger(foodIdOrEventId, mapManager.getHeroAllAttributeMap());
mapManager.setHeroAllAttributeMap(heroAllAttributeMap); 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); SFoodsConfig sFoodsConfig = SFoodsConfig.getsFoodsConfigByFoodId(foodIdOrEventId);
int contiue = sFoodsConfig.getContiue(); int contiue = sFoodsConfig.getContiue();
if(contiue==0){ if(contiue==0){
contiue=-1; contiue=-1;
int teamId = mapManager.getTeamId(); // int teamId = mapManager.getTeamId();
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId); // List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
Map<Integer,Integer> foodAddMap = new HashMap<>(); // Map<Integer,Integer> foodAddMap = new HashMap<>();
getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig); // getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) { // for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId()); // Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) { // if (hero == null) {
continue; // continue;
} // }
Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId()); // Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){ // if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
continue; // continue;
} // }
//
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute); // HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
HeroLogic.getInstance().calInteractAdd(heroAllAttribute); // HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
heroAllAttributeMap.put(hero.getId(), heroAllAttribute); // heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
} // }
mapManager.setHeroAllAttributeMap(heroAllAttributeMap); // mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
} }
mapManager.eatFood(foodIdOrEventId,contiue); mapManager.eatFood(foodIdOrEventId,contiue);
} }