移除功能开启检查
parent
a3b84a9b2d
commit
14d21eb6ec
|
@ -89,6 +89,7 @@ public class HandlerLogicThread extends Thread{
|
|||
whiteMsg.add(MessageTypeProto.MessageType.ADVENTURE_BOSSHURT_REQEUST_VALUE);
|
||||
whiteMsg.add(MessageTypeProto.MessageType.USER_FORCE_CHANGE_REQUEST_VALUE);
|
||||
whiteMsg.add(MessageTypeProto.MessageType.ENDLESS_SET_SKIPFIGHT_REQUEST_VALUE);
|
||||
whiteMsg.add(MessageTypeProto.MessageType.GET_QUESTION_REQUEST_VALUE);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1409,21 +1409,8 @@ public class HeroLogic {
|
|||
throw new Exception("英雄不存在或无装备"+heroId+"size"+equipIds.size());
|
||||
}
|
||||
|
||||
int[] equipSignUnlock = SGameSetting.getGameSetting().getEquipSignUnlock();
|
||||
if(equipSignUnlock[0]==1){
|
||||
if(user.getPlayerInfoManager().getLevel()<equipSignUnlock[0]){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,"玩家等级不够,无法装备!限制"+equipSignUnlock[0]+"级");
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if(hero.getStar()<equipSignUnlock[1]){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,"妖灵师等级不够,无法装备!限制"+equipSignUnlock[1]+"级");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//类型检查
|
||||
Map<Integer,Integer> currentType = new HashMap<>(); //pos2type
|
||||
|
||||
for (Map.Entry<Integer, String> entry: hero.getSoulEquipByPositionMap().entrySet()) {
|
||||
|
||||
SoulEquip equip = user.getEquipManager().getSoulEquipMap().get(entry.getValue());
|
||||
|
@ -1434,15 +1421,15 @@ public class HeroLogic {
|
|||
if (null == cfg ) {
|
||||
throw new Exception("装备配置不存在" + equip.getCfgId());
|
||||
}
|
||||
currentType.put(entry.getKey(),cfg.getType());
|
||||
if(equipIds.size()!=6){
|
||||
currentType.put(entry.getKey(),cfg.getType());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//check same type
|
||||
//check pos 开启
|
||||
//条件不足 放过
|
||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||
if(!checkPosAccess(soulEquipPos.getPosition(),user,hero)){
|
||||
if (!checkPosAccess(soulEquipPos.getPosition(), user, hero)) {
|
||||
continue;
|
||||
}
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(soulEquipPos.getEquipId());
|
||||
|
@ -1450,32 +1437,32 @@ public class HeroLogic {
|
|||
throw new Exception("装备不存在" + soulEquipPos.getEquipId());
|
||||
}
|
||||
SEquipSign cfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId());
|
||||
if (null == cfg ) {
|
||||
if (null == cfg) {
|
||||
throw new Exception("装备配置不存在" + soulEquip.getCfgId());
|
||||
}
|
||||
|
||||
if(currentType.keySet().contains(soulEquipPos.getPosition())&¤tType.get(soulEquipPos.getPosition())!=cfg.getType()){
|
||||
if(currentType.values().contains(cfg.getType())){
|
||||
continue;
|
||||
}
|
||||
if (currentType.keySet().contains(soulEquipPos.getPosition())) {
|
||||
currentType.remove(soulEquipPos.getPosition());
|
||||
}
|
||||
currentType.put(soulEquipPos.getPosition(),cfg.getType());
|
||||
if (currentType.values().contains(cfg.getType())) {
|
||||
MessageUtil.sendErrorResponse(session, 0, MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE, "魂印类型重复");
|
||||
return;
|
||||
}
|
||||
currentType.put(soulEquipPos.getPosition(), cfg.getType());
|
||||
}
|
||||
|
||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(soulEquipPos.getEquipId());
|
||||
soulEquip.setHeroId(heroId);
|
||||
}
|
||||
|
||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||
if(hero.getSoulEquipByPositionMap().containsKey(soulEquipPos.getPosition())){
|
||||
if (hero.getSoulEquipByPositionMap().containsKey(soulEquipPos.getPosition())) {
|
||||
String id = hero.getSoulEquipByPositionMap().get(soulEquipPos.getPosition());
|
||||
SoulEquip oldEquip = user.getEquipManager().getSoulEquipMap().get(id);
|
||||
if (null != oldEquip && !oldEquip.getId().equals( soulEquipPos.getEquipId())) {
|
||||
SoulEquip oldEquip = user.getEquipManager().getSoulEquipMap().get(id);
|
||||
if (null != oldEquip && !oldEquip.getId().equals(soulEquipPos.getEquipId())) {
|
||||
oldEquip.setHeroId("");
|
||||
}
|
||||
}
|
||||
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(),soulEquipPos.getEquipId());
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(soulEquipPos.getEquipId());
|
||||
soulEquip.setHeroId(heroId);
|
||||
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(), soulEquipPos.getEquipId());
|
||||
}
|
||||
|
||||
//发送成功消息
|
||||
|
|
Loading…
Reference in New Issue