Merge branch 'master_dev' into master_otnew

master_otnew
grimm 2023-12-22 14:47:04 +08:00
commit b282cd18ec
3 changed files with 55 additions and 3 deletions

View File

@ -23,7 +23,7 @@ public enum GameFightType {
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
MonterFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),null),
MonterFight(FightType.MonterFight,new MainLineOrInnerQuickFightHandler(),null),//心魔快速战斗
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
@ -34,7 +34,6 @@ public enum GameFightType {
GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT),
DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null),
DeathPathChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
CarBossChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
CarPersonChallenge(FightType.CarPersonFight,new PVPFightHandler(),null),
GuildChallenge(FightType.GuildChallenge,new DefaultWithoutHandFightHandler(),null),

View File

@ -40,7 +40,6 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
public FightResult process(FightEvent fightEvent) throws Exception {
GameFightType fightType = fightEvent.getFightType();
int playerId = fightEvent.getAttackUid();
int fightTime = fightEvent.getMostTime();
String key = RedisKey.getKey(fightType.getFightTypeOfRedis(), Integer.toString(playerId));
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
if (valueMap == null || valueMap.isEmpty()) {
@ -52,6 +51,23 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
return returnFightResult(fightEvent, seed, fightTeamInfo, monsterTeamList);
}
/**
*
* @param fightEvent
* @param seed
* @param fightTeamInfo
* @param monsterTeamList
* @return FightResult
*/
public FightResult returnFightResult(FightEvent fightEvent, int seed, CommonProto.FightTeamInfo fightTeamInfo, List<CommonProto.FightTeamInfo> monsterTeamList){
int playerId = fightEvent.getAttackUid();
int fightTime = fightEvent.getMostTime();
GameFightType fightType = fightEvent.getFightType();
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));

View File

@ -0,0 +1,37 @@
package com.ljsd.jieling.logic.fight.eventhandler;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.fight.FightEvent;
import com.ljsd.jieling.logic.fight.FightUtil;
import com.ljsd.jieling.logic.fight.GameFightType;
import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult;
import rpc.protocols.CommonProto;
import util.TimeUtils;
import java.util.List;
import java.util.Map;
/**
* 线
*/
public class MainLineOrInnerQuickFightHandler extends MainLineOrInnerDemonFightHandler {
@Override
public FightResult process(FightEvent fightEvent) throws Exception {
GameFightType fightType = fightEvent.getFightType();
int playerId = fightEvent.getAttackUid();
int fightSeed = TimeUtils.nowInt();
PVEFightEvent pveFightEvent = (PVEFightEvent) fightEvent;
int groupId = pveFightEvent.getMonsterGroupId();
// 玩家队伍信息
User user = UserManager.getUserNotCache(playerId);
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, pveFightEvent.getTeamId(), pveFightEvent.getAttackBloodMap(), pveFightEvent.getBuffIds());
//怪物队伍信息
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = getMonsterByGroup(playerId, groupId, fightType.getFightType().getType());
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.getFightTeamInfos(groupId, pveFightEvent.getNums(), monsterByGroup);
return returnFightResult(fightEvent, fightSeed, fightTeamInfo, monsterfightTeamInfos);
}
}