Merge branch 'master_dev' into master_otnew
commit
89a82513e0
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ljsd.jieling.handler.monsterAttack;
|
package com.ljsd.jieling.handler.monsterAttack;
|
||||||
|
|
||||||
import com.ljsd.fight.FightType;
|
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
|
@ -13,7 +12,10 @@ import com.ljsd.jieling.logic.activity.ActivityType;
|
||||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.fight.*;
|
import com.ljsd.jieling.logic.fight.FightDispatcher;
|
||||||
|
import com.ljsd.jieling.logic.fight.FightRecordLogic;
|
||||||
|
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||||
|
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.mission.MissionType;
|
import com.ljsd.jieling.logic.mission.MissionType;
|
||||||
|
|
@ -22,9 +24,6 @@ import com.ljsd.jieling.logic.rank.RankEnum;
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import rpc.protocols.CommonProto;
|
|
||||||
import rpc.protocols.FightInfoProto;
|
|
||||||
import rpc.protocols.MessageTypeProto;
|
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SFloodConfig;
|
import config.SFloodConfig;
|
||||||
|
|
@ -32,6 +31,9 @@ import manager.STableManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.FightInfoProto;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -74,7 +76,7 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.JOIN_MONSTER_ATTACK_TIMES);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.JOIN_MONSTER_ATTACK_TIMES);
|
||||||
int groupId = sFloodConfig.getMonster();
|
int groupId = sFloodConfig.getMonster();
|
||||||
int mostTime = sFloodConfig.getBattleTime();
|
int mostTime = sFloodConfig.getBattleTime();
|
||||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid,teamId, mostTime, "", GameFightType.MonterFight, groupId, 3);
|
PVEFightEvent pveFightEvent = new PVEFightEvent(uid,teamId, mostTime, "", GameFightType.MonterQuickFight, groupId, 3);
|
||||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||||
|
|
||||||
//校验结果码 1:胜利
|
//校验结果码 1:胜利
|
||||||
|
|
@ -83,15 +85,7 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
|
||||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
CommonProto.FightData fightDataBuild = CommonProto.FightData.newBuilder()
|
CommonProto.FightData fightDataBuild = fightResult.getFightData();
|
||||||
.setFightMaxTime(mostTime)
|
|
||||||
.setFightSeed(fightResult.getSeed())
|
|
||||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
|
||||||
.addAllMonsterList(fightResult.getMonsterTeamList())
|
|
||||||
.setFightType(FightType.MonterFight.getType())
|
|
||||||
.setFightId(FightUtil.getFightId(uid,FightType.MonterFight.getType()))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 记录战报
|
// 记录战报
|
||||||
FightRecordLogic.getInstance().addRecordMap(user,fightDataBuild);
|
FightRecordLogic.getInstance().addRecordMap(user,fightDataBuild);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ import com.ljsd.jieling.logic.fight.eventhandler.*;
|
||||||
*/
|
*/
|
||||||
public enum GameFightType {
|
public enum GameFightType {
|
||||||
StoryFight(FightType.StoryFight,new MainLineOrInnerDemonFightHandler(), RedisKey.LEVE_DIFFICULTY_FIGHT),
|
StoryFight(FightType.StoryFight,new MainLineOrInnerDemonFightHandler(), RedisKey.LEVE_DIFFICULTY_FIGHT),
|
||||||
|
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
||||||
|
MonterQuickFight(FightType.MonterFight,new MainLineOrInnerQuickFightHandler(),null),//心魔快速战斗
|
||||||
MapFastFight(FightType.MapExploreFight,new DefaultWithoutHandFightHandler(),null),
|
MapFastFight(FightType.MapExploreFight,new DefaultWithoutHandFightHandler(),null),
|
||||||
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
|
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
|
||||||
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
|
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
|
||||||
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
|
||||||
MonterFight(FightType.MonterFight,new MainLineOrInnerQuickFightHandler(),null),//心魔快速战斗
|
|
||||||
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||||
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||||
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
|
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,10 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
||||||
|
|
||||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
||||||
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));
|
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));
|
||||||
|
|
||||||
FightResult.Builder fightResult = FightResult.newBuilder();
|
|
||||||
long[] fightResultInfo = CheckFight.getInstance().checkFight(seed, fightTime, getFightData, getOptionData, fightType.getFightType());
|
long[] fightResultInfo = CheckFight.getInstance().checkFight(seed, fightTime, getFightData, getOptionData, fightType.getFightType());
|
||||||
fightResult.setCheckResult(fightResultInfo);
|
|
||||||
|
FightResult.Builder builder = FightResult.newBuilder();
|
||||||
|
builder.setCheckResult(fightResultInfo);
|
||||||
String fightId = FightUtil.getFightId(playerId, fightType);
|
String fightId = FightUtil.getFightId(playerId, fightType);
|
||||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||||
.setFightType(fightType.getFightType().getType())
|
.setFightType(fightType.getFightType().getType())
|
||||||
|
|
@ -83,8 +83,8 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
||||||
.setFightMaxTime(fightTime)
|
.setFightMaxTime(fightTime)
|
||||||
.setFightId(fightId)
|
.setFightId(fightId)
|
||||||
.build();
|
.build();
|
||||||
fightResult.setFightData(fightData);
|
builder.setFightData(fightData);
|
||||||
FightResult result = fightResult.build();
|
FightResult result = builder.build();
|
||||||
|
|
||||||
if (result.getResult() == 1){
|
if (result.getResult() == 1){
|
||||||
// 成功清除时间
|
// 成功清除时间
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue