diff --git a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java index 814724449..e2afe9632 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java @@ -139,6 +139,7 @@ public enum ErrorCode implements IErrorCode { MAP_IN(105,"在地图探索中,不可以操作"), HERO_LIVE_AGAIN(106,"英雄{0}秒后复活"), REWARD_COLLECTING(107,"奖励正在积攒中!"), + JOINED_OTHER_FAMILY(108,"您已加入其他公会,无法创建公会!") ; private static final Set CodeSet = new HashSet<>(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildLogic.java index 5abbca64c..65c58de2e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildLogic.java @@ -138,6 +138,9 @@ public class GuildLogic { if(!enough){ throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); } + if(user.getPlayerInfoManager().getGuildId()!=0){ + throw new ErrorCodeException(ErrorCode.JOINED_OTHER_FAMILY); + } return ""; } @@ -283,8 +286,6 @@ public class GuildLogic { } try { applyToJoin(guildInfo,uid,false); - }catch (Exception e){ - LOGGER.error("the exception={}",e); }finally { RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY,Integer.toString(guildId), Integer.toString(uid)); } @@ -476,8 +477,6 @@ public class GuildLogic { MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(applyId),1, MessageTypeProto.MessageType.FAMILY_REFUSE_JOIN_INDICATION_VALUE,refuseName,true); break; } - }catch (Exception e){ - LOGGER.error("the exception={}",e); }finally { RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY,Integer.toString(guildId), Integer.toString(uid)); } @@ -496,10 +495,6 @@ public class GuildLogic { return; } GuilidManager.removeOneApplyGuildInfos(guildInfo.getId(),applyId); - if(targetUser.getPlayerInfoManager().getGuildId()!=0){ -// MessageUtil.sendErrorResponse(); - return; - } guildInfo.addMembers(GlobalsDef.MEMBER,applyId); targetUser.getPlayerInfoManager().setGuildId(guildInfo.getId()); PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(applyId), PlayerInfoCache.class); @@ -508,8 +503,6 @@ public class GuildLogic { AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, new AynMissionWorker(GameEvent.JOIN_FAMILY)); ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker); // targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY); - }catch (Exception e){ - LOGGER.error("the exception={}",e); }finally { RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY_JOIN,Integer.toString(applyId), Integer.toString(applyId)); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java index 703fbbab3..230c300da 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java @@ -94,7 +94,7 @@ public class MonsterUtil { totalMonsterForce+=monsterForce; } } - totalMonsterForce = (int)(totalMonsterForce*(1.1-0.1*monsterCount)); + totalMonsterForce = (int)(totalMonsterForce*((1.1-0.1*monsterCount)>0.8?(1.1-0.1*monsterCount):0.8)); if(totalMonsterForce>maxForce){ maxForce = totalMonsterForce; }