法宝、公会战无尽副本修改

lvxinran 2019-09-11 22:21:02 +08:00
parent a533fd4c1a
commit 9eb7a469ff
7 changed files with 45 additions and 16 deletions

View File

@ -11,6 +11,7 @@ import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.logic.GlobalDataManaager; import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.STableManager; import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.activity.ActivityLogic; import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.MailingSystemManager; import com.ljsd.jieling.logic.dao.MailingSystemManager;
import com.ljsd.jieling.logic.fight.CheckFight; import com.ljsd.jieling.logic.fight.CheckFight;
import com.ljsd.jieling.logic.hero.HeroLogic; import com.ljsd.jieling.logic.hero.HeroLogic;
@ -84,7 +85,7 @@ public class GameApplication {
//http线程池初始化 //http线程池初始化
// HttpPool.init(); // HttpPool.init();
GuilidManager.init();
STableManager.initialize("com.ljsd.jieling.config"); STableManager.initialize("com.ljsd.jieling.config");
//mongo异步数据处理线程 //mongo异步数据处理线程
MongoDataHandlerTask.init(configurableApplicationContext); MongoDataHandlerTask.init(configurableApplicationContext);

View File

@ -1282,11 +1282,14 @@ public class MapLogic {
} }
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId); List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (TeamPosHeroInfo teamPosHeroInfo : team) { for (TeamPosHeroInfo teamPosHeroInfo : team) {
if(mapManager.getHeroAllAttributeMap().get(teamPosHeroInfo.getHeroId()).get(HeroAttributeEnum.Hp.getPropertyId())<checkResult[teamPosHeroInfo.getPosition()+1]){ Map<Integer, Integer> heroAttr = mapManager.getHeroAllAttributeMap().get(teamPosHeroInfo.getHeroId());
if(heroAttr!=null){
if(heroAttr.get(HeroAttributeEnum.Hp.getPropertyId())<checkResult[teamPosHeroInfo.getPosition()+1]){
continue; continue;
} }
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]); mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]);
} }
}
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4&&teamId==401){ if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4&&teamId==401){
for (int i = 0 ; i <team.size();i++) { for (int i = 0 ; i <team.size();i++) {
Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId()); Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId());

View File

@ -209,7 +209,6 @@ public class GlobalDataManaager {
DataManagerDistributor.init(); DataManagerDistributor.init();
initServerIsLanEnviornment(configurableApplicationContext); initServerIsLanEnviornment(configurableApplicationContext);
StoreLogic.checkGlobalStore(true); StoreLogic.checkGlobalStore(true);
GuilidManager.init();
new RPCServerTask(configurableApplicationContext).start(); new RPCServerTask(configurableApplicationContext).start();
new RPCGmServerTask(configurableApplicationContext).start(); new RPCGmServerTask(configurableApplicationContext).start();
} catch (Exception e) { } catch (Exception e) {

View File

@ -58,8 +58,9 @@ public class BloodLogic {
HeroManager heroManager = user.getHeroManager(); HeroManager heroManager = user.getHeroManager();
TeamPosManager teamPosManager = user.getTeamPosManager(); TeamPosManager teamPosManager = user.getTeamPosManager();
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(teamId); List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(teamId);
if(teamPosHeroInfos==null){ if(teamPosHeroInfos==null||teamPosHeroInfos.size()<1){
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1); teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
teamId = 1;
} }
Iterator<TeamPosHeroInfo> it = teamPosHeroInfos.iterator(); Iterator<TeamPosHeroInfo> it = teamPosHeroInfos.iterator();
Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>(); Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>();

View File

@ -122,8 +122,8 @@ public class EquipManager extends MongoBase {
if(especialEquip ==null){ if(especialEquip ==null){
return; return;
} }
updateString("especialEquipMap."+equipId+".star",especialEquip.getStar()+1);
especialEquip.setStar(especialEquip.getStar()+1); especialEquip.setStar(especialEquip.getStar()+1);
especialEquipMap.put(equipId,especialEquip); especialEquipMap.put(equipId,especialEquip);
updateString("especialEquipMap."+equipId+".star",especialEquip.getStar()+1);
} }
} }

View File

@ -483,7 +483,7 @@ public class GuildFightLogic {
public static void getFamilyFightRoundInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception { public static void getFamilyFightRoundInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
RedisUtil redisUtil = RedisUtil.getInstence(); RedisUtil redisUtil = RedisUtil.getInstence();
int enemyFamily = getEnemyFamily(UserManager.getUser(session.getUid()).getPlayerInfoManager().getGuildId()); int enemyFamily = getEnemyFamily(UserManager.getUser(session.getUid()).getPlayerInfoManager().getGuildId());
Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",session.getId(),Integer.class); Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",String.valueOf(session.getUid()),Integer.class);
if(attackCount==null){ if(attackCount==null){
attackCount = 0; attackCount = 0;
} }
@ -663,7 +663,7 @@ public class GuildFightLogic {
//战绩结算 //战绩结算
int getExp = 0; int getExp = 0;
Double rank = redisUtil.getZSetScore(RedisKey.FAMILY_FIGHT_RANK, "", str); Double rank = redisUtil.getZSetScore(RedisKey.FAMILY_FIGHT_RANK, "", str);
// rank+=7000; rank+=7000;
for(Map.Entry<Integer, SGuildScoreConfig> entry:sGuildScoreConfigMap.entrySet()){ for(Map.Entry<Integer, SGuildScoreConfig> entry:sGuildScoreConfigMap.entrySet()){
if(rank<entry.getValue().getScoreMin()||rank>entry.getValue().getScoreMax()){ if(rank<entry.getValue().getScoreMin()||rank>entry.getValue().getScoreMax()){
continue; continue;
@ -848,24 +848,37 @@ public class GuildFightLogic {
timeRound = sGuildSetting.getPrepareTime(); timeRound = sGuildSetting.getPrepareTime();
if(status==0){ if(status==0){
LOGGER.info("阶段变为布防"); LOGGER.info("阶段变为布防");
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
if(guildInfoMap!=null&&guildInfoMap.size()>0){
for(Map.Entry<Integer, GuildInfo> entry:guildInfoMap.entrySet()){
int build = 0;
Map<Integer, Set<Integer>> members = entry.getValue().getMembers();
for(Map.Entry<Integer, Set<Integer>> member:members.entrySet()){
for(Integer uid:member.getValue()){
entry.getValue().updateDefendInfo(uid,build%3+1);
build=build%3+1;
}
}
}
}
status = 1; status = 1;
} }
}else if(flagTimeRound(sGuildSetting.getMatchTime(),hour,minute)){ }else if(flagTimeRound(sGuildSetting.getMatchTime(),hour,minute)){
timeRound = sGuildSetting.getMatchTime(); timeRound = sGuildSetting.getMatchTime();
if(status==1){ if(status!=2){
status = 2; status = 2;
LOGGER.info("阶段变为匹配"); LOGGER.info("阶段变为匹配");
}
startMatching = true; startMatching = true;
}
}else if(flagTimeRound(sGuildSetting.getBattleTime(),hour,minute)){ }else if(flagTimeRound(sGuildSetting.getBattleTime(),hour,minute)){
timeRound = sGuildSetting.getBattleTime(); timeRound = sGuildSetting.getBattleTime();
if(status == 2){ if(status != 3){
status = 3; status = 3;
LOGGER.info("阶段变为进攻"); LOGGER.info("阶段变为进攻");
} }
}else if(flagTimeRound(sGuildSetting.getSettleTime(),hour,minute)){ }else if(flagTimeRound(sGuildSetting.getSettleTime(),hour,minute)){
timeRound = sGuildSetting.getSettleTime(); timeRound = sGuildSetting.getSettleTime();
if(status==3){ if(status!=4){
accountFamilyFightResult(); accountFamilyFightResult();
MongoUtil.getLjsdMongoTemplate().lastUpdate(); MongoUtil.getLjsdMongoTemplate().lastUpdate();
status = 4; status = 4;

View File

@ -374,6 +374,11 @@ public class HeroLogic {
for(Map.Entry<Integer, List<TeamPosHeroInfo>> item :teamPosForHero.entrySet()){ for(Map.Entry<Integer, List<TeamPosHeroInfo>> item :teamPosForHero.entrySet()){
int teamId = item.getKey(); int teamId = item.getKey();
List<TeamPosHeroInfo> teamPosHeroInfoList = item.getValue(); List<TeamPosHeroInfo> teamPosHeroInfoList = item.getValue();
if(teamId==501){
if(teamPosHeroInfoList==null|teamPosHeroInfoList.size()<1){
teamPosHeroInfoList = teamPosForHero.get(1);
}
}
List<TeamPosForPokenInfo> teamPosForPokenInfos = teamPosForPoken.get(teamId); List<TeamPosForPokenInfo> teamPosForPokenInfos = teamPosForPoken.get(teamId);
if(null == teamPosForPokenInfos){ if(null == teamPosForPokenInfos){
teamPosForPokenInfos = new ArrayList<>(1); teamPosForPokenInfos = new ArrayList<>(1);
@ -1368,10 +1373,17 @@ public class HeroLogic {
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"法宝智能穿戴一个"); MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"法宝智能穿戴一个");
}else{ }else{
int[] equipTalismanaUnlock = SGameSetting.getGameSetting().getEquipTalismanaUnlock(); int[] equipTalismanaUnlock = SGameSetting.getGameSetting().getEquipTalismanaUnlock();
if(user.getPlayerInfoManager().getLevel()<equipTalismanaUnlock[0]||hero.getLevel()<equipTalismanaUnlock[1]){ if(equipTalismanaUnlock[0]==1){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"玩家等级或妖灵师等级不够,无法装备!"); if(user.getPlayerInfoManager().getLevel()<equipTalismanaUnlock[0]){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"玩家等级不够,无法装备!");
return; return;
} }
}else{
if(hero.getStar()<equipTalismanaUnlock[1]){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"妖灵师等级不够,无法装备!");
return;
}
}
hero.updateEspecial(equipIds.get(0)); hero.updateEspecial(equipIds.get(0));
} }
} }