From a88c856888e0eb961824240c211fe97254e3d402 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 31 Jul 2021 01:01:11 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E6=8A=A5=E7=A9=BA=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/mission/MissionLoigc.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java index 428946cd5..accdca1a2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java @@ -213,6 +213,9 @@ public class MissionLoigc { int jadeMissionType = GameMisionType.JADE_DYNASTY_MISSION.getType(); for(Integer id:jadeDynastyMissionType.getDoingMissionIds()){ SThemeActivityTaskConfig config = SThemeActivityTaskConfig.idTaskConfig.get(id); + if(config==null){ + continue; + } int progress = config.getTaskValue()[1][0]; switch (config.getType()){ case 1: From 8acc62e19b0fd1f590f93cb68e0b4b4b1389617c Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 31 Jul 2021 01:15:26 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=88=A4=E7=A9=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java index accdca1a2..93b2c979a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionLoigc.java @@ -231,6 +231,9 @@ public class MissionLoigc { } for(Integer id:jadeDynastyMissionType.getFinishMissionIds()){ SThemeActivityTaskConfig config = SThemeActivityTaskConfig.idTaskConfig.get(id); + if(config==null){ + continue; + } int progress = config.getTaskValue()[1][0]; missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(id).setState(1).setType(jadeMissionType).setProgress(progress).setTakeTimes(0).build()); } From 56f9773f7b30c80ad95bc58cae05f8630b36237c Mon Sep 17 00:00:00 2001 From: lvxinran Date: Wed, 4 Aug 2021 10:51:42 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=9B=BE=E9=89=B4=E6=BF=80=E6=B4=BB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/pokemon/AllBookEnableHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java index 47de7395d..15abceab6 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java @@ -1,5 +1,7 @@ package com.ljsd.jieling.handler.pokemon; +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; import com.ljsd.jieling.handler.BaseHandler; import com.ljsd.jieling.logic.hero.HeroLogic; import com.ljsd.jieling.network.session.ISession; @@ -21,6 +23,7 @@ public class AllBookEnableHandler extends BaseHandler Date: Wed, 4 Aug 2021 16:56:21 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E8=B7=A8=E6=9C=8Dbug=E7=83=AD=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/activity/crossService/CrossServiceLogic.java | 2 +- .../java/com/ljsd/jieling/logic/player/PlayerLogic.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/crossService/CrossServiceLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/crossService/CrossServiceLogic.java index 4771cc7ed..1ae2e81b2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/crossService/CrossServiceLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/crossService/CrossServiceLogic.java @@ -214,7 +214,7 @@ public class CrossServiceLogic { if (collect.isEmpty()){ continue; } - Map attribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, true, teamId); + Map attribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId); arenaOfHero.putAttributeMapByTeam(teamId,attribute); } return arenaOfHero; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java index 7a60d3328..bab98690f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java @@ -774,10 +774,16 @@ public class PlayerLogic { Map heroNotBufferAttribute = hero.getAttributeMapByTeam().getOrDefault(teamId,new HashMap<>()); for(Map.Entry item : heroNotBufferAttribute.entrySet()){ - builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue().intValue()).build()); + int id = item.getKey(); + int values = item.getValue().intValue(); + if (id == 53 || id == 57 || id == 58){ + values = item.getValue().intValue()-10000; + } + builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(id).setPropertyValue(values).build()); } Map jewels = query.getHeroManager().getJewels(); for(String equipId : hero.getJewelInfo()){ + heroBuilder.addJewels(equipId); builder.addEquip(CBean2Proto.getEquipProto(jewels.get(equipId))); } for(int equipId : hero.getEquipByPositionMap().values()){ From 0de9a4ee309ec519027e0a742cdec429885d125e Mon Sep 17 00:00:00 2001 From: lvxinran Date: Wed, 4 Aug 2021 17:50:20 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=9B=BE=E9=89=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java index 15abceab6..309c46f62 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/pokemon/AllBookEnableHandler.java @@ -23,7 +23,6 @@ public class AllBookEnableHandler extends BaseHandler Date: Wed, 4 Aug 2021 15:16:16 +0800 Subject: [PATCH 06/22] =?UTF-8?q?mongo=E6=85=A2=E6=9F=A5=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/db/mongo/AreaManager.java | 5 +--- .../com/ljsd/jieling/db/mongo/MongoUtil.java | 25 +++++++++---------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/AreaManager.java b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/AreaManager.java index caec41724..d880ba10a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/AreaManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/AreaManager.java @@ -435,10 +435,7 @@ public class AreaManager { int serverId = defaultServerId; Integer serverIdByUid = RedisUtil.getInstence().getMapEntry(RedisKey.CUser_ServerId_Key, "", Integer.toString(uid), Integer.class); - if (serverIdByUid != null) { - return serverIdByUid; - } - serverIdByUid = MongoUtil.getInstence().findCUserServerId(uid); +// serverIdByUid = MongoUtil.getInstence().findCUserServerId(uid); if (serverIdByUid != null) { serverId = serverIdByUid; RedisUtil.getInstence().putMapEntry(RedisKey.CUser_ServerId_Key, "", Integer.toString(uid), diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java index eb7379ac7..42b5202dd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java @@ -271,19 +271,18 @@ public class MongoUtil { } - - - public Integer findCUserServerId(int uid){ - BasicQuery basicQuery = new BasicQuery(new BasicDBObject("uid", uid),new BasicDBObject("serverId", 1)); - DBObject c_user_info = coreMongoTemplate.findOne(basicQuery, DBObject.class, "user_info"); - if(c_user_info == null){ - LOGGER.error("the user={} not exists",uid); - return null; - } - String serverid = (String) c_user_info.get("serverId"); - - return Integer.valueOf(serverid); - } + //慢查询 弃用 lxr +// public Integer findCUserServerId(int uid){ +// BasicQuery basicQuery = new BasicQuery(new BasicDBObject("uid", uid),new BasicDBObject("serverId", 1)); +// DBObject c_user_info = coreMongoTemplate.findOne(basicQuery, DBObject.class, "user_info"); +// if(c_user_info == null){ +// LOGGER.error("the user={} not exists",uid); +// return null; +// } +// String serverid = (String) c_user_info.get("serverId"); +// +// return Integer.valueOf(serverid); +// } public Integer findGuilderverId(int guildId){ From c7a897e3b985c552bb684b2e8647ec44b5875793 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Wed, 4 Aug 2021 21:41:47 +0800 Subject: [PATCH 07/22] =?UTF-8?q?packid=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/handler/LoginRequestHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/LoginRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/LoginRequestHandler.java index 88adc85e5..d9c2ec72f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/LoginRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/LoginRequestHandler.java @@ -109,7 +109,7 @@ public class LoginRequestHandler extends BaseHandler Date: Thu, 5 Aug 2021 11:46:39 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E3=80=90=E6=97=A5=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=81=9A=E7=9A=84=E6=97=A5=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E8=AE=B0=E7=82=B9=E5=B0=86=E5=8F=B0=E6=8A=BD?= =?UTF-8?q?=E5=8D=A1=E6=AC=A1=E6=95=B0=EF=BC=88=E6=9C=89=E6=96=B0=E5=B0=86?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=8F=AA=E8=AE=B0=E6=96=B0=E5=B0=86=E6=8A=BD?= =?UTF-8?q?=E5=8D=A1=E6=AC=A1=E6=95=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 45ce89811..81d62b0e3 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 @@ -361,7 +361,10 @@ public class HeroLogic{ } } user.getUserMissionManager().onGameEvent(user,GameEvent.RANDOM_HERO,sLotterySetting.getLotteryType(),perCount); - user.getUserMissionManager().onGameEvent(user, GameEvent.NEW_HERO_ZHAOMU,sLotterySetting.getPerCount()); + if(sLotterySetting.getLotteryType()==11){ + //只记录新将招募次数 + user.getUserMissionManager().onGameEvent(user, GameEvent.NEW_HERO_ZHAOMU,sLotterySetting.getPerCount()); + } heroManager.updateRandCount(type,perCount); CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, resultRandom,BIReason.HERO_RANDOM); fiveStarPushByRandom(user,resultRandom); From 87911d51f62ca4d6f8bf342c6a473f9a55283349 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 5 Aug 2021 16:02:57 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E6=95=B0=E6=95=B0=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java | 1 + .../src/main/java/com/ljsd/jieling/ktbeans/ReportUserEvent.java | 2 +- .../jieling/ktbeans/reportEvent/CreateRoleEventHandler.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java index 42b5202dd..92c340519 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoUtil.java @@ -93,6 +93,7 @@ public class MongoUtil { return MongoUtil.getInstence().getMyMongoTemplate(); } + //todo 慢查 需要修改 public List getRandomUsers(int size, int uid, int level) throws Exception { if (size <= 0) { return null; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUserEvent.java b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUserEvent.java index 8809e9938..b03d02561 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUserEvent.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUserEvent.java @@ -86,7 +86,7 @@ public class ReportUserEvent { } public ReportUserEvent setPackId(String packId){ - baseInfo.put("pack_id",packId); + baseInfo.put("packId",packId); return this; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/reportEvent/CreateRoleEventHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/reportEvent/CreateRoleEventHandler.java index 1751dead9..f3c16a076 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/reportEvent/CreateRoleEventHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/reportEvent/CreateRoleEventHandler.java @@ -25,6 +25,7 @@ public class CreateRoleEventHandler extends CommonEventHandler{ setOnceProperties.put("channel_id",user.getPlayerInfoManager().getChannel_id()); setOnceProperties.put("platform_id",user.getPlayerInfoManager().getPlatform()); setOnceProperties.put("reg_ip",user.getPlayerInfoManager().getIp()); + setOnceProperties.put("packId",user.getPlayerInfoManager().getPack_id()); userProperties.put(1,setProperties); userProperties.put(2,setOnceProperties); From 141da042810c44db9f16d8214c6598db5f5b34a8 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 5 Aug 2021 20:51:31 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/kefu/Cmd_recharge.java | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_recharge.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_recharge.java index d153f5108..3f138a06f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_recharge.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_recharge.java @@ -25,55 +25,55 @@ import java.util.Set; public class Cmd_recharge extends GmAbstract { @Override public boolean exec(String[] args) throws Exception { - int serverId = GameApplication.serverId; - MongoTemplate monogTemplate = MongoUtil.getInstence().getMonogTemplate(serverId); - MongoTemplate coreMongoTemplate = MongoUtil.getCoreMongoTemplate(); - - Query query = new Query(Criteria.where("_id").ne("100000")); - query.fields().include("playerManager"); - long count = monogTemplate.count(query, User.class, "user"); - - int pageSize = 10; - - //分页 - for(int i = 0 ; i allByCondition = monogTemplate.find(query.with(pageable), User.class,"user"); - - for(User user:allByCondition){ - PlayerManager playerInfoManager = user.getPlayerInfoManager(); - System.out.println(user.getId()); - NewRechargeInfo newRechargeInfo = playerInfoManager.getNewRechargeInfo(); - RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo(); - double rr = (rechargeInfo==null?0:rechargeInfo.getSaveAmt())+(newRechargeInfo==null?0:newRechargeInfo.getRr()); - if(rr==0){ - continue; - } - //判断是否有其他服已经加入过充值信息 - Query rechargeQuery = new Query(Criteria.where("_id").is(playerInfoManager.getOpenId())); - Recharge recharge = coreMongoTemplate.findOne(rechargeQuery, Recharge.class, "recharge"); - if(recharge==null){ - recharge = new Recharge(); - recharge.setId(playerInfoManager.getOpenId()); - recharge.setRr(rr); - Set serverIds = new HashSet<>(); - serverIds.add(serverId); - recharge.setServerId(serverIds); - }else{ - Set serverIds = recharge.getServerId(); - if(serverIds!=null&&serverIds.contains(serverId)){ - continue; - } - recharge.setRr(recharge.getRr()+rr); - recharge.getServerId().add(serverId); - } - coreMongoTemplate.save(recharge,"recharge"); - } - - } - - - System.out.println(); +// int serverId = GameApplication.serverId; +// MongoTemplate monogTemplate = MongoUtil.getInstence().getMonogTemplate(serverId); +// MongoTemplate coreMongoTemplate = MongoUtil.getCoreMongoTemplate(); +// +// Query query = new Query(Criteria.where("_id").ne("100000")); +// query.fields().include("playerManager"); +// long count = monogTemplate.count(query, User.class, "user"); +// +// int pageSize = 10; +// +// //分页 +// for(int i = 0 ; i allByCondition = monogTemplate.find(query.with(pageable), User.class,"user"); +// +// for(User user:allByCondition){ +// PlayerManager playerInfoManager = user.getPlayerInfoManager(); +// System.out.println(user.getId()); +// NewRechargeInfo newRechargeInfo = playerInfoManager.getNewRechargeInfo(); +// RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo(); +// double rr = (rechargeInfo==null?0:rechargeInfo.getSaveAmt())+(newRechargeInfo==null?0:newRechargeInfo.getRr()); +// if(rr==0){ +// continue; +// } +// //判断是否有其他服已经加入过充值信息 +// Query rechargeQuery = new Query(Criteria.where("_id").is(playerInfoManager.getOpenId())); +// Recharge recharge = coreMongoTemplate.findOne(rechargeQuery, Recharge.class, "recharge"); +// if(recharge==null){ +// recharge = new Recharge(); +// recharge.setId(playerInfoManager.getOpenId()); +// recharge.setRr(rr); +// Set serverIds = new HashSet<>(); +// serverIds.add(serverId); +// recharge.setServerId(serverIds); +// }else{ +// Set serverIds = recharge.getServerId(); +// if(serverIds!=null&&serverIds.contains(serverId)){ +// continue; +// } +// recharge.setRr(recharge.getRr()+rr); +// recharge.getServerId().add(serverId); +// } +// coreMongoTemplate.save(recharge,"recharge"); +// } +// +// } +// +// +// System.out.println(); return true; } } From 3018ad87893be8faee4b28e1b14e405cfeda19be Mon Sep 17 00:00:00 2001 From: lvxinran Date: Mon, 9 Aug 2021 11:30:39 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=89=E8=90=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/logic/activity/TreasureActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/TreasureActivity.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/TreasureActivity.java index 9d1c20525..a8d5d9252 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/TreasureActivity.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/TreasureActivity.java @@ -226,10 +226,9 @@ public class TreasureActivity extends AbstractActivity { private void dropByState(List dropList,int curState,int targetState,int missionId){ STreasureSunlongConfig rewardConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(id).get(missionId); if(curState==ActivityType.WILL_TAKE){ - if(rewardConfig.getReward()==null||rewardConfig.getReward().length<1){ - return; + if(rewardConfig.getReward()!=null&&rewardConfig.getReward().length>0){ + dropList.add(rewardConfig.getReward()); } - dropList.add(rewardConfig.getReward()); if(targetState == ActivityType.FINISH_TAKED){ dropList.add(rewardConfig.getTreasureReward()); } From d7638c382977a9d92adb584b3275e179def428ee Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 12 Aug 2021 13:36:05 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/jieling/logic/GlobalDataManaager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java index 285c8fb12..74e3be013 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java @@ -546,6 +546,9 @@ public class GlobalDataManaager implements IManager { long serverOpenTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime()); // 根据格式获取时间戳 例子 :20210720 int value = SSpecialConfig.getIntegerValue(SSpecialConfig.DATA_OF_UNLOCK_THE_EVEREST); + if(value==-1){ + value = 20210731;//防止报错 + } long time = TimeUtils.stringToTimeLong(String.valueOf(value), "yyyyMMdd"); // 规定时间之前开服的返回0 if (serverOpenTime < time){ From 9af6ed272175d370c6627e3a1364a38579194210 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 12 Aug 2021 15:11:11 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E8=BD=A6=E8=BF=9F=E6=96=97=E6=B3=95?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/handler/FastChallengeHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/FastChallengeHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/FastChallengeHandler.java index 056f2dda3..43645cc9d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/FastChallengeHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/FastChallengeHandler.java @@ -145,8 +145,9 @@ public class FastChallengeHandler extends BaseHandler Date: Thu, 12 Aug 2021 18:35:17 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java index 2ffdc3f25..a86064b1a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java @@ -61,7 +61,7 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler Date: Thu, 12 Aug 2021 18:45:48 +0800 Subject: [PATCH 15/22] =?UTF-8?q?=E6=B7=BB=E5=8A=A0return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java index a86064b1a..5eee6ca24 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/gtw/GetWorldArenaInfoRequestHandler.java @@ -62,6 +62,7 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler Date: Mon, 16 Aug 2021 18:58:49 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E6=B8=B8=E5=BF=83gm=2020019=E6=9C=8D?= =?UTF-8?q?=E9=94=99=E5=8F=91=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/jieling/logic/mail/MailLogic.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mail/MailLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mail/MailLogic.java index 058804cc2..d8eb841ff 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mail/MailLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mail/MailLogic.java @@ -96,6 +96,14 @@ public class MailLogic { removeIds.add(cMail.getId()); continue; } + //运营 游心gm 20019服错发邮件 + if("45u6xr9ch5dr0epw".equals(GameApplication.serverProperties.getAppId())){ + if(GameApplication.serverProperties.getId() == 20019){ + if("登录问题修复公告||".equals(cMail.getHead()) && "19#300|60#5".equals(cMail.getMailItem())){ + cMail.setMailItem("19#3|60#5"); + } + } + } cMailList.add(cMail); } for(String removeId : removeIds){ From 99f6f425b80b8a8c4da00349b249ad45847ac4b9 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 14:20:12 +0800 Subject: [PATCH 17/22] =?UTF-8?q?=E7=A9=BA=E5=88=A4=E6=96=ADpackid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java index 69169b678..daa3e21dc 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java @@ -105,8 +105,8 @@ public class ReportUtil { .setDiamond_amount(diamond==null?0:(int)diamond.getItemNum()) .setFighting_capacity(user.getPlayerInfoManager().getMaxForce()) .setLevel(user.getPlayerInfoManager().getLevel()) - .setChannelId(user.getPlayerInfoManager().getChannel_id()) - .setPackId(user.getPlayerInfoManager().getPack_id()); + .setChannelId(user.getPlayerInfoManager().getChannel_id()==null?"":user.getPlayerInfoManager().getChannel_id()) + .setPackId(user.getPlayerInfoManager().getPack_id()==null?"":user.getPlayerInfoManager().getPack_id()); } public static void doReport(ReportUserEvent reportUserEvent){ From f24f6954f873c781674b00450455feee1a65c2ca Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 16:01:12 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/kefu/Cmd_fixsj.java | 172 ++++++++---------- 1 file changed, 72 insertions(+), 100 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java index 16b9bd0b2..fd8fa15d0 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java @@ -1,34 +1,19 @@ package com.ljsd.jieling.kefu; -import com.ljsd.jieling.core.Lockeys; -import com.ljsd.jieling.core.SimpleTransaction; -import com.ljsd.jieling.db.mongo.AreaManager; import com.ljsd.jieling.db.mongo.MongoUtil; -import com.ljsd.jieling.db.redis.RedisKey; -import com.ljsd.jieling.db.redis.RedisUtil; -import com.ljsd.jieling.logic.activity.AbstractActivity; -import com.ljsd.jieling.logic.activity.ActivityLogic; -import com.ljsd.jieling.logic.activity.ActivityTypeEnum; -import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent; -import com.ljsd.jieling.logic.dao.GuilidManager; +import com.ljsd.jieling.logic.dao.Hero; +import com.ljsd.jieling.logic.dao.HeroManager; +import com.ljsd.jieling.logic.dao.TeamPosHeroInfo; import com.ljsd.jieling.logic.dao.UserManager; -import com.ljsd.jieling.logic.dao.root.GuildInfo; import com.ljsd.jieling.logic.dao.root.User; -import com.ljsd.jieling.logic.rank.RankContext; -import com.ljsd.jieling.logic.rank.RankEnum; -import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank; -import config.SGodSacrificeSetting; -import manager.STableManager; -import org.springframework.data.redis.core.ZSetOperations; +import com.ljsd.jieling.util.SysUtil; +import config.SCHero; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * Description: 热修复全局信息 gm线程执行 @@ -40,89 +25,76 @@ import java.util.Set; public class Cmd_fixsj extends GmAbstract { @Override public boolean exec(String[] args) throws Exception { - -// for (int i = 0; i <150 ; i++) { -// String key = RedisKey.getKey(RedisKey.FORCE_RANK, "", false); -// RedisUtil.getInstence().zsetAddOne(key, String.valueOf(10000+i), 10000+i); -// } - try { - - - Map guildInfoMap = GuilidManager.guildInfoMap; - AbstractRank guildRank = RankContext.getRankEnum(RankEnum.GUILD_SHEJI_SCORE_RANK.getType()); - - for(Map.Entry guildInfoEntry:guildInfoMap.entrySet()){ - try { - - GuildInfo guildInfo = guildInfoEntry.getValue(); - Double zSetScore = RedisUtil.getInstence().getZSetScore(RankEnum.GUILD_SHEJI_SCORE_RANK.getRedisKey(), "50002", Integer.toString(guildInfo.getId())); - -// if(zSetScore<0){ -// continue; -// } - Double sumValue =0d; - - Set sendUids = new HashSet<>(); - for (Set items : guildInfo.getMembers().values()) { - sendUids.addAll(items); - } - - for (Integer uid : sendUids) { - - Double zSetScore1 = RedisUtil.getInstence().getZSetScore(RankEnum.EXPERT_RANK.getRedisKey(), "50002", Integer.toString(uid)); - if(zSetScore1<0){ - zSetScore1=0d; - } - sumValue+=zSetScore1; - } - if(sumValue<0){ - sumValue=0d; - } - - System.out.println(guildInfo.getName()+"guildInfo.get = " + guildInfo.getGuildSheJiScore()); - System.out.println(guildInfo.getName()+"zSetScore = " + zSetScore); - System.out.println(guildInfo.getName()+"sumValue = " + sumValue); - - SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1); - if(sumValue>=sGodSacrificeSetting.getL1Score()){ - guildRank.addRank(guildInfo.getId(),"50002",sumValue); - }else { - String key= RedisUtil.getInstence().getKey(RankEnum.GUILD_SHEJI_SCORE_RANK.getRedisKey(), "50002"); - RedisUtil.getInstence().zsetRemoveOne(key,Integer.toString(guildInfo.getId())); - } - - guildInfo.setGuildSheJiScore(sumValue.intValue()); - - - for (Integer uid : sendUids) { - - User user = UserManager.getUser(uid); - if (null == user) { - LOGGER.error("Exception::user==null,uid=>{}", uid); - continue; - } - - AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(50002); - if (abstractActivity == null) { - continue; - } - abstractActivity.update(user, sumValue.intValue()); -// Double zSetScore1 = RedisUtil.getInstence().getZSetScore(RankEnum.EXPERT_RANK.getRedisKey(), "50002", Integer.toString(uid)); -// sumValue+=zSetScore1; - } - - }catch (Exception e){ - LOGGER.error("Exception resetGuildInfo err"); - }finally { - } -// + String path= SysUtil.getPath("conf/fix_hero.txt"); + File file = new File(path); + FileReader fileReader = null; + fileReader = new FileReader(file); + BufferedReader in = new BufferedReader(fileReader); + String line = null; + Map> heroMap = new HashMap<>(); + System.out.println("开始处理"); + while ((line = in.readLine()) != null) { + Map oneHeroMap = new HashMap<>(); + String[] s = line.split("\t"); + String[] split = s[1].split(","); + for(String sp:split){ + String[] split1 = sp.split("-"); + int heroId = Integer.parseInt(split1[0]); + oneHeroMap.put(heroId,oneHeroMap.getOrDefault(heroId,0)+1); } - - } catch (Exception e) { - LOGGER.info("修复排行榜异常" + e.toString()); + heroMap.put(Integer.parseInt(s[0]),oneHeroMap); + System.out.println("this line:" + line); + line = null; } + Map> deleteMap = new HashMap<>(); + for(Map.Entry> entry:heroMap.entrySet()){ + deleteMap.put(entry.getKey(),new HashMap<>()); + User user = UserManager.getUser(entry.getKey()); + HeroManager heroManager = user.getHeroManager(); + Map heroManagerHeroMap = heroManager.getHeroMap(); + Set allDelId = new HashSet<>(); + next:for(Map.Entry entryHero:heroManagerHeroMap.entrySet()){ + Hero hero= entryHero.getValue(); + if(!entry.getValue().containsKey(hero.getTemplateId())){ + continue; + } + if(entry.getValue().get(hero.getTemplateId())<1){ + continue; + } + if(hero.getLevel(heroManager)!=1){ + continue; + } + if(hero.getStar()!= SCHero.getsCHero().get(hero.getTemplateId()).getStar()){ + continue; + } + Map map = deleteMap.get(entry.getKey()); + allDelId.add(hero.getId()); + for(Map.Entry> teamPosHeroInfo:user.getTeamPosManager().getTeamPosForHero().entrySet()){ + List value = teamPosHeroInfo.getValue(); + for(TeamPosHeroInfo info:value){ + if(info.getHeroId().equals(hero.getId())){ + continue next; + } + } + } + map.put(hero.getTemplateId(),map.getOrDefault(hero.getTemplateId(),0)+1); + } +// for(String str:allDelId){ +// user.getHeroManager().removeHero(entry.getKey(),str); +// } + } + + deleteMap.forEach((k,v)-> System.out.println(k+"要删除的"+v.toString())); + +// user.getHeroManager().removeHero(;); + in.close(); + fileReader.close(); + MongoUtil.getLjsdMongoTemplate().lastUpdate(); return true; } + public static void main(String[] args ) throws Exception{ + + } } From f40115836e9986ca0ffd5303020a0789eb8a03b6 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 16:54:04 +0800 Subject: [PATCH 19/22] =?UTF-8?q?=E6=9A=82=E6=97=B6=E4=B8=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java index fd8fa15d0..9f90d15b4 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java @@ -84,10 +84,10 @@ public class Cmd_fixsj extends GmAbstract { // for(String str:allDelId){ // user.getHeroManager().removeHero(entry.getKey(),str); // } +// System.out.println("删除英雄动态id==>"+allDelId.toString()); } deleteMap.forEach((k,v)-> System.out.println(k+"要删除的"+v.toString())); - // user.getHeroManager().removeHero(;); in.close(); fileReader.close(); From da50d8f7cfb0f62488e7a80dc07d90efe51300f5 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 16:57:26 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java index 9f90d15b4..7b92ea4bd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java @@ -94,7 +94,4 @@ public class Cmd_fixsj extends GmAbstract { MongoUtil.getLjsdMongoTemplate().lastUpdate(); return true; } - public static void main(String[] args ) throws Exception{ - - } } From f7cfb10a8e05f5f93ab4f1cdcf9b9bdb44391ae4 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 17:13:08 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java index 7b92ea4bd..4589d102f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java @@ -81,14 +81,13 @@ public class Cmd_fixsj extends GmAbstract { } map.put(hero.getTemplateId(),map.getOrDefault(hero.getTemplateId(),0)+1); } -// for(String str:allDelId){ -// user.getHeroManager().removeHero(entry.getKey(),str); -// } -// System.out.println("删除英雄动态id==>"+allDelId.toString()); + for(String str:allDelId){ + user.getHeroManager().removeHero(entry.getKey(),str); + } + System.out.println("删除英雄动态id==>"+allDelId.toString()); } deleteMap.forEach((k,v)-> System.out.println(k+"要删除的"+v.toString())); -// user.getHeroManager().removeHero(;); in.close(); fileReader.close(); MongoUtil.getLjsdMongoTemplate().lastUpdate(); From c1a1219ff284bac60feea36d225cb6038182436f Mon Sep 17 00:00:00 2001 From: lvxinran Date: Sat, 14 Aug 2021 18:01:34 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java index 4589d102f..63023c136 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_fixsj.java @@ -70,7 +70,6 @@ public class Cmd_fixsj extends GmAbstract { continue; } Map map = deleteMap.get(entry.getKey()); - allDelId.add(hero.getId()); for(Map.Entry> teamPosHeroInfo:user.getTeamPosManager().getTeamPosForHero().entrySet()){ List value = teamPosHeroInfo.getValue(); for(TeamPosHeroInfo info:value){ @@ -79,6 +78,7 @@ public class Cmd_fixsj extends GmAbstract { } } } + allDelId.add(hero.getId()); map.put(hero.getTemplateId(),map.getOrDefault(hero.getTemplateId(),0)+1); } for(String str:allDelId){