From c9ae1a8ccdfb5b4f627eb3e0803bb4ec8a988e7b Mon Sep 17 00:00:00 2001 From: lvxinran Date: Wed, 13 Nov 2019 14:31:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E6=80=AA=E7=89=A9=E6=88=98=E5=8A=9B=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/exception/ErrorCode.java | 1 + .../com/ljsd/jieling/logic/family/GuildLogic.java | 13 +++---------- .../java/com/ljsd/jieling/util/MonsterUtil.java | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) 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; }