Merge branch 'master_test_gn_zf' into master_test_gn

# Conflicts:
#	serverlogic/src/main/java/com/ljsd/jieling/logic/explorerMap/ExplorerMapLogic.java
back_recharge
jiahuiwen 2022-01-15 18:44:15 +08:00
commit c3075fadb4
2 changed files with 22 additions and 15 deletions

View File

@ -56,7 +56,6 @@ public class ExplorerMapLogic {
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
indication.setExploreInfo(mapInfo); indication.setExploreInfo(mapInfo);
LOGGER.info("sendIndication::::::::::::::::::::"+dropKeyValList.size());
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true); MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
} }
@ -66,6 +65,7 @@ public class ExplorerMapLogic {
if (explorerInfo == null) { if (explorerInfo == null) {
return; return;
} }
LOGGER.info("开始战斗");
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false); int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(explorerInfo.getMapId()); SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(explorerInfo.getMapId());
if (exploreConfig == null) { if (exploreConfig == null) {
@ -79,7 +79,7 @@ public class ExplorerMapLogic {
if (exploreFightData == null) { if (exploreFightData == null) {
return; return;
} }
LOGGER.info("玩家开始战斗=>{},探索表id:={}",user.getId(),exploreFightData.getId()); LOGGER.info("探索表id:={}", exploreFightData.getId());
//掉血比例 //掉血比例
float reduceRatio = exploreFightData.getLoseFight(); float reduceRatio = exploreFightData.getLoseFight();
//玩家掉血 //玩家掉血
@ -98,6 +98,7 @@ public class ExplorerMapLogic {
//输赢判断 //输赢判断
if (reduceRatio > reduceRatioMonster) { if (reduceRatio > reduceRatioMonster) {
//怪物赢了 保留血量 下次打 //怪物赢了 保留血量 下次打
LOGGER.info("怪物赢了:");
explorerInfo.setEnemyHp(explorerInfo.getEnemyHp() - (reduceMonster)); explorerInfo.setEnemyHp(explorerInfo.getEnemyHp() - (reduceMonster));
explorerInfo.setPlayerHp(0); explorerInfo.setPlayerHp(0);
LOGGER.info("怪物掉血:=》{},剩余血量-》{}", reduceMonster, explorerInfo.getEnemyHp()); LOGGER.info("怪物掉血:=》{},剩余血量-》{}", reduceMonster, explorerInfo.getEnemyHp());
@ -111,7 +112,7 @@ public class ExplorerMapLogic {
explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer); explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer);
explorerInfo.setEnemyHp(0); explorerInfo.setEnemyHp(0);
LOGGER.info("玩家掉血:=》{},剩余血量-》{}", reducePlayer, explorerInfo.getPlayerHp()); LOGGER.info("玩家掉血:=》{},剩余血量-》{}", reducePlayer, explorerInfo.getPlayerHp());
LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑 掉落组=>{}", exploreConfig.getReward()); LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑 掉落组=>{}", explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) { for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) {
if (dropMap.containsKey(keyVal.getKey())) { if (dropMap.containsKey(keyVal.getKey())) {
dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue()); dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue());
@ -141,13 +142,14 @@ public class ExplorerMapLogic {
} }
LOGGER.info("怪物死亡=》重生时间{}", explorerInfo.getEnemyReliveTime()); LOGGER.info("怪物死亡=》重生时间{}", explorerInfo.getEnemyReliveTime());
} }
if (time == 0) { if (time == 0) {
explorerInfo.setBatteTime(TimeUtils.nowInt() + exploreConfig.getBattleInterval());//设置下次战斗时间 explorerInfo.setBatteTime(TimeUtils.nowInt() + exploreConfig.getBattleInterval());//设置下次战斗时间
} else { } else {
explorerInfo.setBatteTime(time + exploreConfig.getBattleInterval());//设置下次战斗时间 explorerInfo.setBatteTime(time + exploreConfig.getBattleInterval());//设置下次战斗时间
} }
//user.getPlayerInfoManager().addExplorer(explorerInfo, teamId); //user.getPlayerInfoManager().addExplorer(explorerInfo, teamId);
LOGGER.info("战斗结束=>{}",user.getId()); LOGGER.info("战斗结束");
} }
@ -192,16 +194,21 @@ public class ExplorerMapLogic {
} else { } else {
offlineEndTime = keyVal.getValue().getSendEndTime(); offlineEndTime = keyVal.getValue().getSendEndTime();
} }
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId()); if(keyVal.getValue() == null){
int battleInterval = exploreConfig.getBattleInterval(); LOGGER.info("ExplorerInfo 数据为空 =>{}",user.getId());
if (exploreConfig == null) {
continue; continue;
} }
if (keyVal.getValue().getBatteTime() >= offlineEndTime) { SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId());
if (exploreConfig == null) {
LOGGER.info("{} SExplore 不存在的id =>{}",user.getId(),keyVal.getValue().getMapId());
continue;
}
int battleInterval = exploreConfig.getBattleInterval();
if (keyVal.getValue().getBatteTime() +battleInterval >= offlineEndTime) {
continue; continue;
} }
LOGGER.info("离线玩家队伍id",keyVal.getKey()); LOGGER.info("离线玩家队伍id",keyVal.getKey());
for (int i = keyVal.getValue().getBatteTime(); i <= offlineEndTime; i = i + battleInterval) { for (int i = keyVal.getValue().getBatteTime() + battleInterval; i < offlineEndTime; i = i + battleInterval) {
//复活玩家 //复活玩家
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) { if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) {
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false); int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
@ -247,7 +254,7 @@ public class ExplorerMapLogic {
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= TimeUtils.nowInt()) { if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= TimeUtils.nowInt()) {
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false); int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
keyVal.getValue().setPlayerHp(teamForce); keyVal.getValue().setPlayerHp(teamForce);
LOGGER.info("玩家=>{}复活,复活队伍是=>{}",uid,keyVal.getKey()); LOGGER.info("复活玩家:" + uid);
sendIndication(user.getId(),keyVal.getValue(),keyVal.getKey()); sendIndication(user.getId(),keyVal.getValue(),keyVal.getKey());
} }
//复活怪物 //复活怪物
@ -256,7 +263,7 @@ public class ExplorerMapLogic {
if (exploreConfig == null) { if (exploreConfig == null) {
continue; continue;
} }
LOGGER.info("玩家=>{}复活,复活队伍是=>{}",uid,exploreConfig.getId()); LOGGER.info("复活怪物" + uid);
//怪物的初始血量 //怪物的初始血量
int mapMonsterForce = exploreConfig.getMonsterForce(); int mapMonsterForce = exploreConfig.getMonsterForce();
keyVal.getValue().setEnemyHp(mapMonsterForce); keyVal.getValue().setEnemyHp(mapMonsterForce);
@ -280,7 +287,7 @@ public class ExplorerMapLogic {
Set<String> set = redisUtil.sGet(key); Set<String> set = redisUtil.sGet(key);
if (set.contains(String.valueOf(user.getId()))) { if (set.contains(String.valueOf(user.getId()))) {
long remove = RedisUtil.getInstence().setRemove(key, String.valueOf(uid)); long remove = RedisUtil.getInstence().setRemove(key, String.valueOf(uid));
LOGGER.info("uid=>{},remove:=>{}",uid,remove); LOGGER.info("remove:" + remove);
} }
} else { } else {
//跨服分组 //跨服分组
@ -288,7 +295,7 @@ public class ExplorerMapLogic {
Set<String> set = redisUtil.sGet(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key); Set<String> set = redisUtil.sGet(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key);
if (set.contains(String.valueOf(user.getId()))) { if (set.contains(String.valueOf(user.getId()))) {
long remove = RedisUtil.getInstence().setRemove(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key, String.valueOf(uid)); long remove = RedisUtil.getInstence().setRemove(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key, String.valueOf(uid));
LOGGER.info("uid=>{},remove cross:=>{}",uid,remove); LOGGER.info("remove cross:" + remove);
} }
} }

View File

@ -17,9 +17,9 @@ public class GotSoulMarkManager extends AbstractDataManager {
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) { public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
CumulationData.Result result = null; CumulationData.Result result = null;
int itemId = (int)parm[0]; int itemId = (int)parm[0];
long num = (long)parm[1]; Long num = Long.parseLong(parm[1].toString());
if(missionType == MissionType.GOT_SOUL_MARK){ if(missionType == MissionType.GOT_SOUL_MARK){
data.addQualitySoulMarkNum(STableManager.getConfig(SItem.class).get(itemId).getQuantity(),(int)num); data.addQualitySoulMarkNum(STableManager.getConfig(SItem.class).get(itemId).getQuantity(),num.intValue());
result = new CumulationData.Result(missionType); result = new CumulationData.Result(missionType);
} }
return result; return result;