From 77a87f7ccd967c2bc734413187eba1567e50c996 Mon Sep 17 00:00:00 2001 From: xuexinpeng Date: Thu, 7 Apr 2022 10:51:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8E=A2=E7=B4=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/explorerMap/ExplorerMapLogic.java | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java index 2405b029c..b75bee935 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java @@ -179,7 +179,7 @@ public class ExplorerMapLogic { } LOGGER.info("{}怪物死亡=》重生时间{}", user.getId(), explorerInfo.getEnemyReliveTime()); RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).incrementRankScore(user.getId(), "", 1); - user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMY_NUM,1); + user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMY_NUM, 1); } if (time == 0) { @@ -230,12 +230,12 @@ public class ExplorerMapLogic { SExplore rankExplore = limitConfig.get(randomMapId); int randomEventId = random.nextInt(rankExplore.getEventList().length); int eventId = rankExplore.getEventList()[randomEventId]; - LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId+1); + LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId + 1); user.getPlayerInfoManager().addExploreEvent(new KeyVal(eventId, TimeUtils.nowInt() + exploreEventConfig.get(eventId).getTime(), randomMapId + 1)); PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); List event = user.getPlayerInfoManager().getExploreEvent(); //删除过期的 - if(event.removeIf(n->n.getVal() < TimeUtils.nowInt())){ + if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) { user.getPlayerInfoManager().setExploreEvent(event); } for (KeyVal keyVal : event) { @@ -245,10 +245,14 @@ public class ExplorerMapLogic { MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true); } - public static void sendDisappearEvent(User user){ + + public static void sendDisappearEvent(User user) { ISession sess = OnlineUserManager.sessionMap.get(user.getId()); List event = user.getPlayerInfoManager().getExploreEvent(); - if(event.removeIf(n->n.getVal() < TimeUtils.nowInt())){ + if(event.size() == 0 ||event == null){ + return; + } + if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) { user.getPlayerInfoManager().setExploreEvent(event); PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); for (KeyVal keyVal : event) { @@ -287,9 +291,9 @@ public class ExplorerMapLogic { } LOGGER.info("离线玩家队伍id", keyVal.getKey()); //探索事件 - long gapDay = TimeUtils.getGapDaysByTwoTime(TimeUtils.getTimeStamp2(keyVal.getValue().getBatteTime()*1000L), TimeUtils.getTimeStamp2(offlineEndTime*1000L)); - for(int i = 0;i< gapDay;i++){ - LOGGER.info("gapDay------------------------>{}",i); + long gapDay = TimeUtils.getGapDaysByTwoTime(TimeUtils.getTimeStamp2(keyVal.getValue().getBatteTime() * 1000L), TimeUtils.getTimeStamp2(offlineEndTime * 1000L)); + for (int i = 0; i < gapDay; i++) { + LOGGER.info("gapDay------------------------>{}", i); sendRandomEvent(user); } for (int i = keyVal.getValue().getBatteTime(); i <= offlineEndTime; i = i + battleInterval) { @@ -438,17 +442,16 @@ public class ExplorerMapLogic { if (delayId.size() > 0) { user.getPlayerInfoManager().setExplorer(explorer); } - //探索有消耗 整点刷出随机事件 - if (explorer.size() > 0) { - Calendar calendar = Calendar.getInstance(); - int minute = calendar.get(Calendar.MINUTE); - if (minute == 0) { - //sendRandomEvent(user); + Calendar calendar = Calendar.getInstance(); + int minute = calendar.get(Calendar.MINUTE); + if (minute == 0) { + if (explorer.size() > 0) { + sendRandomEvent(user); } - sendRandomEvent(user); + }else{ + sendDisappearEvent(user); } - sendDisappearEvent(user); MongoUtil.getLjsdMongoTemplate().lastUpdate(); } } catch (Exception e) { From 77679ba892b0f64053a2dfe255cc86052554f081 Mon Sep 17 00:00:00 2001 From: duhui Date: Thu, 7 Apr 2022 11:09:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=B6=E5=9B=AD=E5=BC=BA=E5=8C=96?= =?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/logic/hero/HeroLogic.java | 2 +- 1 file changed, 1 insertion(+), 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 8746c1c38..882e3fe5c 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 @@ -2879,7 +2879,7 @@ public class HeroLogic { buff += Optional.ofNullable(strengthenMap.get(strongId)).map(SEquipStrengthen::getRate).orElse(0); // 突破 buff += Optional.ofNullable(rankUpMap.get(homeRankUp)).map(v -> v.getRate()[sEquipConfig.getPosition() - 1]).orElse(0); - value = value + (long) Math.ceil(buff/100*value); + value = value + (long) Math.ceil(buff/10000*value); } propertyValueByIdMap.put(prop[0], value); } From 814d5d6cd952be4df402e701a9c32ec2c54ef226 Mon Sep 17 00:00:00 2001 From: xuexinpeng Date: Thu, 7 Apr 2022 11:32:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8E=A2=E7=B4=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java index b75bee935..a47316622 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java @@ -232,7 +232,7 @@ public class ExplorerMapLogic { int eventId = rankExplore.getEventList()[randomEventId]; LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId + 1); user.getPlayerInfoManager().addExploreEvent(new KeyVal(eventId, TimeUtils.nowInt() + exploreEventConfig.get(eventId).getTime(), randomMapId + 1)); - PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); + PlayerInfoProto.ExplorerMapIndicationEventResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationEventResponse.newBuilder(); List event = user.getPlayerInfoManager().getExploreEvent(); //删除过期的 if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) { @@ -242,8 +242,7 @@ public class ExplorerMapLogic { indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()). setVal2(keyVal.getVa2()).build()); } - - MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true); + MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationEventResponse_VALUE, indication.build(), true); } public static void sendDisappearEvent(User user) { @@ -254,12 +253,12 @@ public class ExplorerMapLogic { } if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) { user.getPlayerInfoManager().setExploreEvent(event); - PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); + PlayerInfoProto.ExplorerMapIndicationEventResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationEventResponse.newBuilder(); for (KeyVal keyVal : event) { indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()). setVal2(keyVal.getVa2()).build()); } - MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true); + MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationEventResponse_VALUE, indication.build(), true); } }