From 5bb8e95aa1f05dd54fa3b93cce68fee687de48ad Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 31 Oct 2019 14:47:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/jieling/logic/family/GuildLogic.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 c1076808d..25ceb6d4e 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 @@ -284,9 +284,6 @@ public class GuildLogic { } RedisUtil.getInstence().expire(RedisKey.getKey(RedisKey.FAMILY_JOIN,String.valueOf(uid),false), TimeUtils.DAY); addGuildLog(guildInfo.getId(),GuildDef.Log.JOIN,user.getPlayerInfoManager().getNickName()); - PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class); - cache.setGuildPosition(GlobalsDef.MEMBER); - RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache); Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build(); Family.FamilyJoinResponse response = Family.FamilyJoinResponse.newBuilder().setFamilyJoinIndicaion(build).build(); MessageUtil.sendMessage(session,1,msgId,response,true); @@ -499,6 +496,9 @@ public class GuildLogic { } guildInfo.addMembers(GlobalsDef.MEMBER,applyId); targetUser.getPlayerInfoManager().setGuildId(guildInfo.getId()); + PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(applyId), PlayerInfoCache.class); + cache.setGuildPosition(GlobalsDef.MEMBER); + RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(applyId),cache); }catch (Exception e){ LOGGER.error("the exception={}",e); }finally { From fab234e8103053f4d5a564d3d89064ed28cc07e5 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Tue, 29 Oct 2019 13:51:59 +0800 Subject: [PATCH 2/4] battle & fix export excel --- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 2 +- .../main/java/com/ljsd/GameApplication.java | 1 - .../SArenaRobotStaticConfig.java | 47 +++++++++++++++++++ .../ljsd/jieling/logic/hero/HeroLogic.java | 27 ----------- test/src/main/java/ExcelUtils.java | 2 +- 5 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/SArenaRobotStaticConfig.java diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index 57eaea19a..dfd822059 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -279,7 +279,7 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe atkEle == 3 and defEle == 1 or atkEle == 5 and defEle == 6 or atkEle == 6 and defEle == 5 - baseDamage = restrain and floor(max(baseDamage*1.5, 0.1*attack)) or floor(max(baseDamage, 0.1*attack)) + baseDamage = restrain and floor(max(baseDamage*1.25, 0.1*attack)) or floor(max(baseDamage, 0.1*attack)) for i=1, atkRole.exCalDmgList.size do local func = atkRole.exCalDmgList.buffer[i] diff --git a/serverlogic/src/main/java/com/ljsd/GameApplication.java b/serverlogic/src/main/java/com/ljsd/GameApplication.java index 8ee196abe..0da92f667 100644 --- a/serverlogic/src/main/java/com/ljsd/GameApplication.java +++ b/serverlogic/src/main/java/com/ljsd/GameApplication.java @@ -113,7 +113,6 @@ public class GameApplication { CoreLogic.getInstance().checkCoreCdk(); ThriftPoolUtils.getInstance().initContext(configurableApplicationContext); GlobalDataManaager.getInstance().whenServerStart(configurableApplicationContext); - HeroLogic.getInstance().afterSet(); URL resource = HeroLogic.class.getClassLoader().getResource("mingan.txt"); if(resource!=null){ LOGGER.info(resource.getFile()); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/SArenaRobotStaticConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/SArenaRobotStaticConfig.java new file mode 100644 index 000000000..2fe90d146 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/SArenaRobotStaticConfig.java @@ -0,0 +1,47 @@ +package com.ljsd.jieling.config.clazzStaticCfg; + +import com.ljsd.jieling.logic.hero.HeroLogic; +import config.SArenaRobotConfig; +import config.SWorkShopTechnology; +import manager.AbstractClassStaticConfig; +import manager.STableManager; +import manager.Table; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class SArenaRobotStaticConfig extends AbstractClassStaticConfig { + @Override + public void registConfigs(Set registConfigs) { + registConfigs.add(SArenaRobotConfig.class.getAnnotation(Table.class).name()); + } + + @Override + public void figureConfigs() { + Map integerSArenaRobotConfigMap = SArenaRobotConfig.getsArenaRobotConfigMap(); + for(SArenaRobotConfig sArenaRobotConfig : integerSArenaRobotConfigMap.values()){ + List heroList = sArenaRobotConfig.getHeroList(); + int heroLevel = sArenaRobotConfig.getRobotLevel(); + Map starHeroMap = new HashMap<>(); + for(Integer heroTid :heroList){ + int heroBreakId = HeroLogic.getInstance().calRobotStarByLevel(heroTid, heroLevel,starHeroMap); + sArenaRobotConfig.setBreakId(heroBreakId); + sArenaRobotConfig.setStarOfHeroMap(starHeroMap); + } + sArenaRobotConfig.setTotalForce(HeroLogic.getInstance().calRobotTotalForce(sArenaRobotConfig)); + } + + int[][] returnMaterials = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getReturnMaterials(); + Map> sWorkTechMapByTechIdAndLevel = STableManager.getFigureConfig(CommonStaticConfig.class).getsWorkTechMapByTechIdAndLevelTmp(); + for(Map item : sWorkTechMapByTechIdAndLevel.values()){ + for(SWorkShopTechnology sWorkShopTechnology:item.values()){ + if(sWorkShopTechnology.getWillReturn() == null){ + continue; + } + HeroLogic.getInstance().calPercent(returnMaterials,sWorkShopTechnology.getWillReturn()); + } + } + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 3ea6dca53..5352fd9c8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -1819,33 +1819,6 @@ public class HeroLogic { return totalForce; } - public void afterSet() { - Map integerSArenaRobotConfigMap = SArenaRobotConfig.getsArenaRobotConfigMap(); - for(SArenaRobotConfig sArenaRobotConfig : integerSArenaRobotConfigMap.values()){ - List heroList = sArenaRobotConfig.getHeroList(); - int heroLevel = sArenaRobotConfig.getRobotLevel(); - Map starHeroMap = new HashMap<>(); - for(Integer heroTid :heroList){ - int heroBreakId = calRobotStarByLevel(heroTid, heroLevel,starHeroMap); - sArenaRobotConfig.setBreakId(heroBreakId); - sArenaRobotConfig.setStarOfHeroMap(starHeroMap); - } - sArenaRobotConfig.setTotalForce(calRobotTotalForce(sArenaRobotConfig)); - } - - int[][] returnMaterials = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getReturnMaterials(); - Map> sWorkTechMapByTechIdAndLevel = STableManager.getFigureConfig(CommonStaticConfig.class).getsWorkTechMapByTechIdAndLevelTmp(); - for(Map item : sWorkTechMapByTechIdAndLevel.values()){ - for(SWorkShopTechnology sWorkShopTechnology:item.values()){ - if(sWorkShopTechnology.getWillReturn() == null){ - continue; - } - calPercent(returnMaterials,sWorkShopTechnology.getWillReturn()); - } - } - - } - public void calPercent(int[][] otherAttriMap,Map heroAttributeMap){ for(int[] item : otherAttriMap){ int propertyId = item[0]; diff --git a/test/src/main/java/ExcelUtils.java b/test/src/main/java/ExcelUtils.java index 511f22f23..73f22268e 100644 --- a/test/src/main/java/ExcelUtils.java +++ b/test/src/main/java/ExcelUtils.java @@ -367,7 +367,7 @@ public class ExcelUtils { //判断cell类型 switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: { - if (cellType != null && cellType.toString().equals("float")){ + if (cellType != null && cellType.toString().contains("float")){ cellValue = cell.getNumericCellValue(); }else{ cellValue = (int) cell.getNumericCellValue(); From b564b7ae7d6604e654e42de06193fc7372fe60a8 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Tue, 29 Oct 2019 14:56:37 +0800 Subject: [PATCH 3/4] componts add --- .../java/config/SDifferDemonsComonpentsConfig.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tablemanager/src/main/java/config/SDifferDemonsComonpentsConfig.java b/tablemanager/src/main/java/config/SDifferDemonsComonpentsConfig.java index 4b238a828..2a8bfe6e7 100644 --- a/tablemanager/src/main/java/config/SDifferDemonsComonpentsConfig.java +++ b/tablemanager/src/main/java/config/SDifferDemonsComonpentsConfig.java @@ -34,14 +34,14 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig { for(SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig : config.values()){ int comonpentsId = sDifferDemonsComonpentsConfig.getComonpentsId(); int stage = sDifferDemonsComonpentsConfig.getStage(); - if(!sDifferDemonsComonpentsConfigTmp.containsKey(comonpentsId)){ sDifferDemonsComonpentsConfigTmp.put(comonpentsId,new HashMap<>()); extraAddMapTmp.put(comonpentsId,new HashMap<>()); } int[][] extraAdd = sDifferDemonsComonpentsConfig.getExtraAdd(); + Map> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId); + HashMap> extraCopyMapHashMap = new HashMap<>(extraMapTmpInfo); if(extraAdd!=null&&extraAdd.length>0){ - Map> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId); for(int [] extraItem : extraAdd){ int profession = extraItem[0]; int propertyId = extraItem[1]; @@ -49,10 +49,18 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig { if(!extraMapTmpInfo.containsKey(profession)){ extraMapTmpInfo.put(profession,new HashMap<>()); } + if(extraMapTmpInfo.get(profession).containsKey(propertyId)){ + propertyValue+=extraMapTmpInfo.get(profession).get(propertyId); + } + + extraCopyMapHashMap.put(profession,new HashMap<>()); + extraMapTmpInfo.put(profession,new HashMap<>()); + extraCopyMapHashMap.get(profession).put(propertyId,propertyValue); extraMapTmpInfo.get(profession).put(propertyId,propertyValue); + } - sDifferDemonsComonpentsConfig.setExtraAddMap(new HashMap<>(extraMapTmpInfo)); } + sDifferDemonsComonpentsConfig.setExtraAddMap(extraCopyMapHashMap); sDifferDemonsComonpentsConfigTmp.get(comonpentsId).put(stage,sDifferDemonsComonpentsConfig); } From af304a8d85d8cdef7f946d1ddb64d177d1cb612b Mon Sep 17 00:00:00 2001 From: wangyuan Date: Tue, 29 Oct 2019 17:17:40 +0800 Subject: [PATCH 4/4] fix usermission & guild --- .../com/ljsd/jieling/logic/dao/UserMissionManager.java | 7 +++++-- .../java/com/ljsd/jieling/logic/family/GuildLogic.java | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java index c366b5c06..c319211c0 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java @@ -170,8 +170,11 @@ public class UserMissionManager extends MongoBase { break; case DAILY_MISSION_REWARD:{ dailyMissionIdsType.rewardMission((int)parm[0], missionTypeEnumListMap.get(GameMisionType.DAILYMISSION)); - calCumulationDataResult(user,MissionType.FINSIH_DAYILY_TIMES,missionTypeEnumListMap,(int)parm[0]); - updateString("dailyMissionIdsType",dailyMissionIdsType); + if(!missionTypeEnumListMap.get(GameMisionType.DAILYMISSION).isEmpty()){ + calCumulationDataResult(user,MissionType.FINSIH_DAYILY_TIMES,missionTypeEnumListMap,(int)parm[0]); + updateString("dailyMissionIdsType",dailyMissionIdsType); + } + } break; case TREASURE_MISSION_REWARD:{ 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 25ceb6d4e..fb4f32899 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 @@ -153,12 +153,15 @@ public class GuildLogic { Map applyGuildInfos = GuilidManager.getApplyGuildInfos(uid, 1); int now =(int)(System.currentTimeMillis()/1000); if(applyGuildInfos.size()>0){ - for(Map.Entry applyEntry:applyGuildInfos.entrySet()){ - GuildApply guildApply = applyEntry.getValue(); + Iterator> iterator = applyGuildInfos.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry next = iterator.next(); + GuildApply guildApply = next.getValue(); if(now - guildApply.getCreateTime() > SGuildSetting.sGuildSetting.getApplyReserve()){ GuilidManager.removeOneApplyGuildInfos(guildApply.getGuildId(),guildApply.getId()); - continue; + iterator.remove(); } + } } for(GuildInfo guildInfo : guildInfos){