From 1c56fa04872432cd14491ac9125327d535d50dd6 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Wed, 4 Nov 2020 17:51:50 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BD=91=E9=A1=B5=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=A4=BC=E5=8C=85=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java index 517a65dc2..103583ccc 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java @@ -965,6 +965,14 @@ public class BuyGoodsLogic { } } + if (sRechargeCommodityConfig.getTime() == 6) { + if (rechargeInfo.getDyGoodsCanBuyTimes().containsKey(sRechargeCommodityConfig.getId())&&rechargeInfo.getRefreshBagMap().containsKey(sRechargeCommodityConfig.getId())) { + long endTime = rechargeInfo.getRefreshBagMap().get(sRechargeCommodityConfig.getId()); + if (now > endTime || rechargeInfo.getDyGoodsCanBuyTimes().get(sRechargeCommodityConfig.getId()) <= 0) { + continue; + } + } + } } From 9e9fc2e3c665ab17a90fa3ad0c4e9c36ceee648f Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Wed, 4 Nov 2020 18:10:18 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=BD=91=E9=A1=B5=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=A4=BC=E5=8C=85=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java index 103583ccc..4fc5798a2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java @@ -966,14 +966,11 @@ public class BuyGoodsLogic { } } if (sRechargeCommodityConfig.getTime() == 6) { - if (rechargeInfo.getDyGoodsCanBuyTimes().containsKey(sRechargeCommodityConfig.getId())&&rechargeInfo.getRefreshBagMap().containsKey(sRechargeCommodityConfig.getId())) { - long endTime = rechargeInfo.getRefreshBagMap().get(sRechargeCommodityConfig.getId()); - if (now > endTime || rechargeInfo.getDyGoodsCanBuyTimes().get(sRechargeCommodityConfig.getId()) <= 0) { - continue; - } + int dytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0)-1; + if(dytime <0){ + continue; } } - } long startTime=0; From 76d2fea45933777d163dc3e824c854646570274c Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 12 Nov 2020 14:47:15 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=89=93=E7=82=B9=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E8=BD=A6=E8=BF=9F=E6=96=97=E6=B3=95=E6=97=A0=E6=8A=A2?= =?UTF-8?q?=E5=A4=BA=E7=9B=AE=E6=A0=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../family/GetCarChallengeListHandler.java | 19 +++++++++++++------ .../com/ljsd/jieling/ktbeans/ReportUtil.java | 1 + .../ljsd/jieling/logic/hero/HeroLogic.java | 17 +++++++++++------ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/family/GetCarChallengeListHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/family/GetCarChallengeListHandler.java index 5630089fe..92b597446 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/family/GetCarChallengeListHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/family/GetCarChallengeListHandler.java @@ -50,18 +50,25 @@ public class GetCarChallengeListHandler extends BaseHandler { int zsetSize = RedisUtil.getInstence().getZsetSize(key); List beforeList = new ArrayList<>(5); List afterList = new ArrayList<>(5); + int maxWhile = 30;//最大匹配循环次数 if(myRank == -1){ - int start = zsetSize - matchNums; - if(start<0){ - start=0; + int end = 0; + while(end> beforeScore = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", zsetSize-end , zsetSize-end ); + if(!beforeScore.isEmpty()){ + ZSetOperations.TypedTuple beforeNext = beforeScore.iterator().next(); + if(!members.contains(Integer.parseInt(beforeNext.getValue()))){ + beforeList.add(new ZsetTypedTupleWithRank(beforeNext,zsetSize-end+1)); + } + } + end++; } - int end=-1; - process(start,end,members,matchNums,infos); +// process(start,end,members,matchNums,infos); }else{ int i = myRank-1; int j = myRank+1; - int maxWhile = 30;//最大匹配循环次数 while(i>0||j<=zsetSize){ if(i>0){ 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 3bb56d991..1578b3212 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/ktbeans/ReportUtil.java @@ -120,6 +120,7 @@ public class ReportUtil { } catch (Exception e) { //异常处理 e.printStackTrace(); + System.out.println(reportUserEvent.getBaseInfo().toString()); System.out.println("except:"+e); } } 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 0b1a4af72..a82bd63c0 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 @@ -365,6 +365,7 @@ public class HeroLogic{ case 3: SGlobalActivity activity = SGlobalActivity.getsGlobalActivityMap().get(sLotterySetting.getActivityId()); if(activity.getType()== ActivityType.LIMIT_RANDOM_CARD){ +// TIME_SUMMON(56,"Time_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}), eventEnum = ReportEventEnum.TIME_SUMMON; }else if (activity.getType()==ActivityType.BEAUTY_BAG){ eventEnum = ReportEventEnum.FATALITY_SUMMON; @@ -390,11 +391,14 @@ public class HeroLogic{ if (random == null) { continue; } - SCHero scHero = SCHero.getsCHero().get(random[0]); - if (scHero == null) { - result.add(String.valueOf(random[0])); - } else { - result.add(random[0] + "-" + scHero.getStar()); + SItem item = SItem.getsItemMap().get(random[0]); +// SCHero scHero = SCHero.getsCHero().get(random[0]); + if (item == null) { + result.add(random[0] +"-id错误"+random[1]); + } else if(item.getItemType()==GlobalItemType.CARD) { + result.add(random[0] + "-" + item.getQuantity()); + }else{ + result.add(random[0] + "#" + random[1]); } } if (costItem.length == 1) { @@ -951,7 +955,7 @@ public class HeroLogic{ if(reportConsumeHero.length()>0){ reportConsumeHero.append("|"); } - reportConsumeHero.append(hero.getTemplateId()).append("#lv.").append(hero.getLevel()).append("#star.").append(hero.getStar()); + reportConsumeHero.append(hero.getTemplateId()).append("-").append(hero.getStar()).append("-").append(hero.getLevel()); if( 1 == isSame) { @@ -1031,6 +1035,7 @@ public class HeroLogic{ ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,targetHero.getTemplateId(),0,0,0,0,0); } String consume = StringUtil.parseArrayToString(consumeMaterial); +// HERO_STRENGTHEN(13,"hero_strengthen", new CommonEventHandler(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}), ReportUtil.onReportEvent(user, ReportEventEnum.HERO_STRENGTHEN.getType(),String.valueOf(targetHero.getTemplateId()),String.valueOf(oldStar),String.valueOf(targetHero.getStar()),consume,reportConsumeHero.toString()); } private void rankUpHeroExecute(Hero hero)throws Exception { From 7a42112a9cca7ecd2021d87942dcc286fafd2df6 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Fri, 6 Nov 2020 14:38:34 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/kefu/Cmd_review_gm.java | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_review_gm.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_review_gm.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_review_gm.java new file mode 100644 index 000000000..8683d4d26 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_review_gm.java @@ -0,0 +1,150 @@ +package com.ljsd.jieling.kefu; + + +import com.ljsd.fight.CheckFight; +import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig; +import com.ljsd.jieling.core.GlobalsDef; +import com.ljsd.jieling.db.redis.RedisKey; +import com.ljsd.jieling.db.redis.RedisUtil; +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.logic.championship.ChampionshipLogic; +import com.ljsd.jieling.logic.dao.ArenaRecord; +import com.ljsd.jieling.logic.dao.FamilyFightInfo; +import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.fight.*; +import com.ljsd.jieling.protocols.CommonProto; +import com.ljsd.jieling.util.FightDataUtil; +import config.SArenaRobotConfig; +import manager.STableManager; +import org.luaj.vm2.LuaValue; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Description: 查看巅峰赛 战斗 + * Author: zsx + * CreateDate: 2019/9/26 11:48 + */ +public class Cmd_review_gm 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); +// } + if (args.length != 1) { + return false; + } + String fightID = args[0]; + ArenaRecord arenaRecord = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_ARENA_RECORD,"", fightID, ArenaRecord.class); + + if(arenaRecord == null){ + throw new ErrorCodeException(ErrorCode.newDefineCode("arena_rrecord null")); + } + byte[] fightData = arenaRecord.getFightData(); + CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(fightData); + LuaValue getFightData; + int snapTeamId = GlobalsDef.CHAMPION_ATTACK_TEAM; + RedisUtil.getInstence().del(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FIGHT, "")); + int warTime = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getWarTime(); + Map memberInfoMap = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, ChampionshipLogic.MemberInfo.class); + int attackId = arenaRecord.getAttackId(); + int defUid = arenaRecord.getDefUid(); + ChampionshipLogic.snapOneFightInfo(attackId, memberInfoMap); + ChampionshipLogic.snapOneFightInfo(defUid, memberInfoMap); + + long id = FightDispatcher.getFIghtId(); + EndFightProcessor endFightProcessor = new AreFightPro(); + ((AreFightPro) endFightProcessor).setArenaRecord(arenaRecord); + FightDispatcher.getMap().put(id, endFightProcessor); + Map gameFightTypeMap = new HashMap<>(); + + gameFightTypeMap.put(0, GameFightType.TOPArenaPersonFight); + gameFightTypeMap.put(1, GameFightType.TOPArenaRobotFight); + gameFightTypeMap.put(2, GameFightType.TOPArena2RobotFight); + PVPFightEvent pvpFightEvent = new PVPFightEvent(attackId, snapTeamId, warTime, "", gameFightTypeMap.get(arenaRecord.getType()), defUid, snapTeamId); + + ChampionshipLogic.MemberInfo attackMemberInfo = memberInfoMap.get(attackId); + ChampionshipLogic.MemberInfo defMemberInfo = memberInfoMap.get(defUid); + int minForce = 0; + int defForce = 0; + + if (defMemberInfo.getType() == 0) { + FamilyFightInfo fightInfo = defMemberInfo.getFightInfo(); + pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(), defUid)); + defForce = fightInfo.getForce(); + } else { + SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(defUid); + if (sArenaRobotConfig != null) { + defForce = sArenaRobotConfig.getTotalForce(); + } + } + if (attackMemberInfo.getType() == 0) { + FamilyFightInfo fightInfo = attackMemberInfo.getFightInfo(); + pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(), attackId)); + minForce = fightInfo.getForce(); + } else { + SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(attackId); + if (sArenaRobotConfig != null) { + minForce = sArenaRobotConfig.getTotalForce(); + } + } + if (minForce > defForce) { + if (arenaRecord.getTurn() == 2) { + pvpFightEvent.setRever(true); + } + } else { + if (arenaRecord.getTurn() == 1 || arenaRecord.getTurn() == 3) { + pvpFightEvent.setRever(true); + } + } + + CommonProto.FightTeamInfo fightTeamInfo = null; + CommonProto.FightTeamInfo deffightTeamInfo = null; + if(pvpFightEvent.getAttackFightSnapData()!=null){ + fightTeamInfo = FightUtil.makeFightWithSnapData(pvpFightEvent.getAttackFightSnapData()); + } + if(pvpFightEvent.getDefFightSnapData()!=null){ + deffightTeamInfo = FightUtil.makeFightWithSnapData(pvpFightEvent.getDefFightSnapData()); + } else{ + if(pvpFightEvent.getFightType() == GameFightType.ArenaPersonFight ||pvpFightEvent.getFightType() == GameFightType.CarPersonChallenge ){ + User defInMem = UserManager.getUserInMem(pvpFightEvent.getDefUid()); + deffightTeamInfo = FightUtil.makePersonFightData(defInMem, pvpFightEvent.getDefTeamId(),null,null); + }else{ + deffightTeamInfo =FightUtil. makeRobotFightData(pvpFightEvent.getDefUid()); + } + + } + if(fightTeamInfo==null){ + if( pvpFightEvent.getFightType()!=GameFightType.TOPArena2RobotFight){ + if( SArenaRobotConfig.getsArenaRobotConfigById(pvpFightEvent.getAttackUid()) !=null){ + fightTeamInfo =FightUtil. makeRobotFightData(pvpFightEvent.getAttackUid()); + }else{ + User userInMem = UserManager.getUserInMem(pvpFightEvent.getAttackUid()); + fightTeamInfo = FightUtil.makePersonFightData(userInMem, pvpFightEvent.getTeamId(),pvpFightEvent.getAttackBloodMap(),null); + } + }else{ + fightTeamInfo = FightUtil.makeRobotFightData(pvpFightEvent.getAttackUid()); + } + } + + if (pvpFightEvent.isRever()) { + deffightTeamInfo = CommonProto.FightTeamInfo.newBuilder().mergeFrom(deffightTeamInfo).setFirstCamp(1).build(); + getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo, true);//对方先手 + } else { + getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo); + } + LuaValue getOptionData = FightDataUtil.getOptionData(pvpFightEvent.getAttackUid() + ""); + int[] fightResult = CheckFight.getInstance().checkFight(fightDataProto.getFightSeed(), pvpFightEvent.getMostTime(), getFightData, getOptionData, pvpFightEvent.getFightType().getFightType()); + String string = Arrays.toString(fightResult); + LOGGER.error("__________________________"+fightResult[0]+":::"+string); + System.out.println("string = " + string); + + return true; + } +} From 7e59e809298847f391bad620ca3467bb6e1e48eb Mon Sep 17 00:00:00 2001 From: lvxinran Date: Tue, 15 Dec 2020 15:40:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=89=B9=E6=9D=83=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/logic/player/PlayerLogic.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 cc5b3bf61..a5269e51d 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 @@ -309,8 +309,11 @@ public class PlayerLogic { Set fixVipId = new HashSet<>(); for(Map.Entry vipInfoItem : vipInfo.entrySet()){ //如果这个权限是活动 且永久了 那么需要修复 - if(vipInfoItem.getValue().getEffectTime()==0&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType()==5){ - fixVipId.add(vipInfoItem.getKey()); + if(vipInfoItem.getValue().getEffectTime()==0){ + int unlockType = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType(); + if(unlockType==5||(unlockType==4&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getContinueTime().length>0)){ + fixVipId.add(vipInfoItem.getKey()); + } } if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=(TimeUtils.now()/1000)){ if(SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==VipPrivilegeType.ADVENTURE_BASE_REWARD){