Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
a4c59660d0
|
@ -93,17 +93,17 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
// 需要存储的英雄列表
|
||||
HashSet<TeamPosHeroInfo> set = new HashSet<>();
|
||||
//主线编队
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> main = user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.FORMATION_NORMAL,new ArrayList<>());
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> main = user.getTeamPosManager().getTeamPosForHero().getOrDefault(TeamEnum.FORMATION_NORMAL.getTeamId(),new ArrayList<>());
|
||||
List<TeamPosHeroInfo> nomal = new ArrayList<TeamPosHeroInfo>();
|
||||
main.forEach(n->nomal.add(new TeamPosHeroInfo().setHeroId(n.getHeroId()).setPosition(n.getPosition())));
|
||||
teams.put(GlobalsDef.FORMATION_NORMAL,nomal);
|
||||
teams.put(TeamEnum.FORMATION_NORMAL.getTeamId(),nomal);
|
||||
set.addAll(nomal);
|
||||
|
||||
//罗浮争锋
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> luofu = user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,new ArrayList<>());
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> luofu = user.getTeamPosManager().getTeamPosForHero().getOrDefault(TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId(),new ArrayList<>());
|
||||
List<TeamPosHeroInfo> luofurpc = new ArrayList<TeamPosHeroInfo>();
|
||||
luofu.forEach(n->luofurpc.add(new TeamPosHeroInfo().setHeroId(n.getHeroId()).setPosition(n.getPosition())));
|
||||
teams.put(GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,luofurpc);
|
||||
teams.put(TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId(),luofurpc);
|
||||
set.addAll(luofurpc);
|
||||
|
||||
//七界试炼
|
||||
|
@ -114,22 +114,22 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
set.addAll(qijierpc);
|
||||
|
||||
//玉虚论道编队
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldOne = user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE,new ArrayList<>());
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldOne = user.getTeamPosManager().getTeamPosForHero().getOrDefault(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(),new ArrayList<>());
|
||||
List<TeamPosHeroInfo> rpcYxldOne = new ArrayList<TeamPosHeroInfo>();
|
||||
yxldOne.forEach(n->rpcYxldOne.add(new TeamPosHeroInfo().setHeroId(n.getHeroId()).setPosition(n.getPosition())));
|
||||
teams.put(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE,rpcYxldOne);
|
||||
teams.put(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(),rpcYxldOne);
|
||||
set.addAll(rpcYxldOne);
|
||||
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldTwo = user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO,new ArrayList<>());
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldTwo = user.getTeamPosManager().getTeamPosForHero().getOrDefault(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId(),new ArrayList<>());
|
||||
List<TeamPosHeroInfo> rpcYxldTwo = new ArrayList<TeamPosHeroInfo>();
|
||||
yxldTwo.forEach(n->rpcYxldTwo.add(new TeamPosHeroInfo().setHeroId(n.getHeroId()).setPosition(n.getPosition())));
|
||||
teams.put(GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO,rpcYxldTwo);
|
||||
teams.put(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId(),rpcYxldTwo);
|
||||
set.addAll(rpcYxldTwo);
|
||||
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldTree = user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE,new ArrayList<>());
|
||||
List<com.ljsd.jieling.logic.dao.TeamPosHeroInfo> yxldTree = user.getTeamPosManager().getTeamPosForHero().getOrDefault(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId(),new ArrayList<>());
|
||||
List<TeamPosHeroInfo> rpcYxldTree = new ArrayList<TeamPosHeroInfo>();
|
||||
yxldTree.forEach(n->rpcYxldTree.add(new TeamPosHeroInfo().setHeroId(n.getHeroId()).setPosition(n.getPosition())));
|
||||
teams.put(GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE,rpcYxldTree);
|
||||
teams.put(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId(),rpcYxldTree);
|
||||
set.addAll(rpcYxldTree);
|
||||
// 英雄
|
||||
Map<String,ArenaOfHero> heroes = new HashMap<>();
|
||||
|
@ -150,9 +150,9 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user,k,false);
|
||||
map.put(k,totalForce);
|
||||
});
|
||||
int force1 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false);
|
||||
int force2 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false);
|
||||
int force3 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false);
|
||||
int force1 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(), false);
|
||||
int force2 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId(), false);
|
||||
int force3 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId(), false);
|
||||
CrossArenaManager rpcArenaManager = new CrossArenaManager();
|
||||
rpcArenaManager.setTeams(teams);
|
||||
rpcArenaManager.setHeros(heroes);
|
||||
|
|
|
@ -83,30 +83,30 @@ public interface GlobalsDef {
|
|||
int ARENA_ROBOT_TYPE=0;
|
||||
int ARENA_PLAYER_TYPE=1;
|
||||
|
||||
//队伍
|
||||
int FORMATION_NORMAL = 1;//主线编队
|
||||
int TEAM_ARENA_DEFENSE =101;//竞技场防御编队
|
||||
int TEAM_ARENA_ATTACH =201;//竞技场进攻编队
|
||||
int TRIAL_TEAM = 301;//森罗环境编队
|
||||
int ENDLESS_TEAM = 401;//无尽编队
|
||||
int BLOODY_TEAM =701; //血战队伍
|
||||
int CHAMPION_ATTACK_TEAM =801; //
|
||||
int EXPEDITION_TEAM =1001; //
|
||||
int CAR_DELAY_TEAM =1101; //车迟斗法
|
||||
int DEATH_PATH_TEAM = 1201;//十绝阵
|
||||
int CHAMPION_TEAM = 1301; //巅峰赛
|
||||
int WORLD_TEAM_ARENA_DEFENSE =1601;//跨服竞技场防御编队
|
||||
int HARD_STAGE_TEAM = 1701;//山河社稷图队伍
|
||||
int VICE_HARD_STAGE_TEAM =1801;//山河社稷图副关卡
|
||||
int TASUILINGXIAO_CHALLENGE = 1901;//踏碎凌霄挑战记录
|
||||
int CROSS_YU_XU_LUN_DAO_ONE =2001;//玉虚论道第一编队
|
||||
int CROSS_YU_XU_LUN_DAO_TWO =2002;//玉虚论道第二编队
|
||||
int CROSS_YU_XU_LUN_DAO_THREE =2003;//玉虚论道第三编队
|
||||
// 四灵试炼
|
||||
int FOURCHALLENGE_PEOPLE_TEAM = 3001;
|
||||
int FOURCHALLENGE_BUDDHA_TEAM = 3002;
|
||||
int FOURCHALLENGE_MONSTER_TEAM = 3003;
|
||||
int FOURCHALLENGE_MORALITY_TEAM = 3004;
|
||||
//队伍 以后队伍id全部道【TeamEnum】类去配置
|
||||
// int FORMATION_NORMAL = 1;//主线编队
|
||||
// int TEAM_ARENA_DEFENSE =101;//竞技场防御编队
|
||||
// int TEAM_ARENA_ATTACH =201;//竞技场进攻编队
|
||||
// int TRIAL_TEAM = 301;//森罗环境编队
|
||||
// int ENDLESS_TEAM = 401;//无尽编队
|
||||
// int BLOODY_TEAM =701; //血战队伍
|
||||
// int CHAMPION_ATTACK_TEAM =801; //
|
||||
// int EXPEDITION_TEAM =1001; //
|
||||
// int CAR_DELAY_TEAM =1101; //车迟斗法
|
||||
// int DEATH_PATH_TEAM = 1201;//十绝阵
|
||||
// int CHAMPION_TEAM = 1301; //巅峰赛
|
||||
// int WORLD_TEAM_ARENA_DEFENSE =1601;//跨服竞技场防御编队
|
||||
// int HARD_STAGE_TEAM = 1701;//山河社稷图队伍
|
||||
// int VICE_HARD_STAGE_TEAM =1801;//山河社稷图副关卡
|
||||
// int TASUILINGXIAO_CHALLENGE = 1901;//踏碎凌霄挑战记录
|
||||
// int CROSS_YU_XU_LUN_DAO_ONE =2001;//玉虚论道第一编队
|
||||
// int CROSS_YU_XU_LUN_DAO_TWO =2002;//玉虚论道第二编队
|
||||
// int CROSS_YU_XU_LUN_DAO_THREE =2003;//玉虚论道第三编队
|
||||
// // 四灵试炼
|
||||
// int FOURCHALLENGE_PEOPLE_TEAM = 3001;
|
||||
// int FOURCHALLENGE_BUDDHA_TEAM = 3002;
|
||||
// int FOURCHALLENGE_MONSTER_TEAM = 3003;
|
||||
// int FOURCHALLENGE_MORALITY_TEAM = 3004;
|
||||
|
||||
//特权解锁类型
|
||||
int LEVEL_UNLOCK_PRIVILEGE = 1;
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
|
||||
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.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||
|
@ -62,7 +58,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
|||
if(user.getPlayerInfoManager().getGuildId() == 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.CAR_DELAY_TEAM);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.CAR_DELAY_TEAM.getTeamId());
|
||||
|
||||
if(teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
|
@ -86,7 +82,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
|||
switch (type){
|
||||
case 1:{
|
||||
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
|
||||
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
|
||||
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,TeamEnum.CAR_DELAY_TEAM.getTeamId(), battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
|
||||
if(fightResult.getResult()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
|
@ -105,7 +101,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.CAR_PLAY,1);
|
||||
}break;
|
||||
case 2:{
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarPersonChallenge,challengeId,GlobalsDef.CAR_DELAY_TEAM);
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(uid,TeamEnum.CAR_DELAY_TEAM.getTeamId(), battleRound,"", GameFightType.CarPersonChallenge,challengeId,TeamEnum.CAR_DELAY_TEAM.getTeamId());
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
|
||||
fightData = fightResult.getFightData();
|
||||
int fight = fightResult.getResult();
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
|
@ -86,7 +87,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
|||
}
|
||||
|
||||
// 战斗逻辑
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.FORMATION_NORMAL, 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
|
|
@ -57,7 +57,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
SNewHeroConfig newHeroConfig = STableManager.getConfig(SNewHeroConfig.class).get(proto.getActivityId());
|
||||
int monsterGroupId = newHeroConfig.getMonsterGroup(); //怪物id
|
||||
// 战斗逻辑
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.FORMATION_NORMAL, 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
|
|
@ -85,7 +85,7 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
if( enemyType == GlobalsDef.ARENA_PLAYER_TYPE){
|
||||
ArenaRecord arenaRecord = new ArenaRecord();
|
||||
defUser = UserManager.getUser(challengeUid);
|
||||
fightResult = ArenaLogic.getFightResultByPersonToPerson(user, teamId, defUser, GlobalsDef.TEAM_ARENA_DEFENSE,arenaRecord,builder);
|
||||
fightResult = ArenaLogic.getFightResultByPersonToPerson(user, teamId, defUser, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(),arenaRecord,builder);
|
||||
if(fightResult == -1){
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ public class ChampinGetHandler extends BaseHandler {
|
|||
ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getAttackId()), ChampionshipLogic.MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
builder1.setMyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getAttackId(), GlobalsDef.CHAMPION_TEAM));
|
||||
builder1.setMyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getAttackId(), TeamEnum.CHAMPION_TEAM.getTeamId()));
|
||||
}else {
|
||||
//fix 整个过程都不能调整编队
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class ChampinGetHandler extends BaseHandler {
|
|||
ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getDefUid()), ChampionshipLogic.MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), GlobalsDef.CHAMPION_TEAM));
|
||||
builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), TeamEnum.CHAMPION_TEAM.getTeamId()));
|
||||
}else {
|
||||
//fix 整个过程都不能调整编队
|
||||
|
||||
|
|
|
@ -11,10 +11,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.logic.dao.FamilyFightInfo;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -176,7 +173,7 @@ public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionG
|
|||
ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getAttackId()), ChampionshipLogic.MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
builder1.setMyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getAttackId(), GlobalsDef.CHAMPION_TEAM));
|
||||
builder1.setMyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getAttackId(), TeamEnum.CHAMPION_TEAM.getTeamId()));
|
||||
}else {
|
||||
//fix 整个过程都不能调整编队
|
||||
|
||||
|
@ -214,7 +211,7 @@ public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionG
|
|||
ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getDefUid()), ChampionshipLogic.MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), GlobalsDef.CHAMPION_TEAM));
|
||||
builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), TeamEnum.CHAMPION_TEAM.getTeamId()));
|
||||
}else {
|
||||
//fix 整个过程都不能调整编队
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.ljsd.jieling.handler.crossServer;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.arena.CrossYuxulundaoLogic;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
@ -32,9 +32,9 @@ public class CrossYuxululndaoChallengeBeforeTeamHandler extends BaseHandler<Aren
|
|||
int defId = request.getDefId();
|
||||
//玉虚论道
|
||||
List<Integer> yuxuTeamId = Lists.newArrayList();
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE);
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
ArenaInfoProto.CrossYuXuLunDaoChallengeBeforeResponse.Builder res = ArenaInfoProto.CrossYuXuLunDaoChallengeBeforeResponse.newBuilder();
|
||||
|
||||
if (!CrossYuxulundaoLogic.limitOpen(user)) {
|
||||
|
|
|
@ -15,10 +15,7 @@ import com.ljsd.jieling.handler.gtw.GetWorldArenaChallengeRequestHandler;
|
|||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.arena.CrossYuxulundaoLogic;
|
||||
import com.ljsd.jieling.logic.dao.ArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.ArenaManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
|
@ -88,9 +85,9 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
List<Integer> yuxuTeamId = Lists.newArrayList();
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE);
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
//找出被挑战者信息
|
||||
ArenaInfoProto.CrossYuXuLunDaoChallengeResponse.Builder res = ArenaInfoProto.CrossYuXuLunDaoChallengeResponse.newBuilder();
|
||||
if (!CrossYuxulundaoLogic.limitOpen(user)) {
|
||||
|
@ -303,8 +300,11 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
newResult[i] = result[i] ^ 1;
|
||||
}
|
||||
arenaRecord.setYxldResult(newResult);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false);
|
||||
arenaRecord.setAttackForce(myforce); //总战斗力
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(), false)
|
||||
+ HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId(), false)
|
||||
+ HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId(), false);
|
||||
//总战斗力
|
||||
arenaRecord.setAttackForce(myforce);
|
||||
String key = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(defUid), false);
|
||||
long def = redisUtil.lGetListSize(key);
|
||||
if (def > 20) {
|
||||
|
@ -327,10 +327,10 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
}
|
||||
res.setMyNewScore(myQuery.getCrossYuxulundaoNewScore());
|
||||
if (myQuery != null) {
|
||||
CrossServiceLogic.getInstance().update(myQuery);
|
||||
CrossServiceLogic.update(myQuery);
|
||||
}
|
||||
if (defQuery != null) {
|
||||
CrossServiceLogic.getInstance().update(defQuery);
|
||||
CrossServiceLogic.update(defQuery);
|
||||
}
|
||||
int myRank = RedisUtil.getInstence().getZSetreverseRank(RedisKey.CROSS_YUXULUNDAO_RANK_PERSON, Integer.toString(crossGroup), Integer.toString(user.getId())).intValue();
|
||||
res.setMyRank(myRank);
|
||||
|
@ -482,11 +482,11 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
//HeroLogic.getInstance().calTeamTotalForce(user, team, false)
|
||||
int myforce = 0;int defforce =0;
|
||||
myforce = HeroLogic.getInstance().calTeamTotalForce(myUser, myteamId[i], false);
|
||||
if(defTeamId[i] == GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE){
|
||||
if(defTeamId[i] == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()){
|
||||
defforce =sArenaRobotConfig.getYxldTotalForce1();
|
||||
}else if(defTeamId[i] == GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO){
|
||||
}else if(defTeamId[i] == TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()){
|
||||
defforce =sArenaRobotConfig.getYxldTotalForce2();
|
||||
}else if(defTeamId[i] == GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){
|
||||
}else if(defTeamId[i] == TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
defforce =sArenaRobotConfig.getYxldTotalForce3();
|
||||
}
|
||||
|
||||
|
|
|
@ -103,8 +103,8 @@ public class CrossYuxulundaoGetInfoHandler extends BaseHandler<ArenaInfoProto.Cr
|
|||
//主线编队复制到第一队伍
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = teamPosManager.getTeamPosForHero();
|
||||
if(teamPosForHero.containsKey(GlobalsDef.FORMATION_NORMAL)&&!teamPosForHero.containsKey(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE)){
|
||||
teamPosManager.updateTeamPosByTeamId(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, teamPosManager.getTeamPosForHero().get(GlobalsDef.FORMATION_NORMAL));
|
||||
if(teamPosForHero.containsKey(TeamEnum.FORMATION_NORMAL.getTeamId())&&!teamPosForHero.containsKey(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId())){
|
||||
teamPosManager.updateTeamPosByTeamId(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(), teamPosManager.getTeamPosForHero().get(TeamEnum.FORMATION_NORMAL.getTeamId()));
|
||||
}
|
||||
builder.setIsFirst(true);
|
||||
isNeedUpdate = true;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.handler.crossServer;
|
|||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.arena.CrossYuxulundaoLogic;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
@ -40,9 +41,9 @@ public class CrossYuxulundaoTeamInfoHandler extends BaseHandler<PlayerInfoProto.
|
|||
return;
|
||||
}
|
||||
List<Integer> yuxuTeamId = Lists.newArrayList();
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO);
|
||||
yuxuTeamId.add(GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE);
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId());
|
||||
yuxuTeamId.add(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
if (playerId <= 1000) {
|
||||
//机器人
|
||||
//res = PlayerLogic.getInstance().getCrossOneTeamInfo(playerId,null,yuxuTeamId);
|
||||
|
|
|
@ -1,27 +1,23 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
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.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.Family;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SWorldBossSetting;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.Family;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -149,10 +145,10 @@ public class GetCarChallengeListHandler extends BaseHandler {
|
|||
.setUid(challenegUid)
|
||||
.setUserName(challenegeUser.getPlayerInfoManager().getNickName())
|
||||
.setScore(item.getScore().intValue())
|
||||
.setForce(HeroLogic.getInstance().calTeamTotalForce(challenegeUser,GlobalsDef.CAR_DELAY_TEAM,false))
|
||||
.setForce(HeroLogic.getInstance().calTeamTotalForce(challenegeUser, TeamEnum.CAR_DELAY_TEAM.getTeamId(),false))
|
||||
.setRank(rank)
|
||||
.setPracticeLevel(challenegeUser.getHeroManager().getPracticeLevel());
|
||||
for (TeamPosHeroInfo heroInfo:challenegeUser.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.CAR_DELAY_TEAM)) {
|
||||
for (TeamPosHeroInfo heroInfo:challenegeUser.getTeamPosManager().getTeamPosForHero().get(TeamEnum.CAR_DELAY_TEAM.getTeamId())) {
|
||||
Hero hero = challenegeUser.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
builder1.addTeamInfo(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.ljsd.jieling.handler.gtw;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.GameLogicService;
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
|
@ -19,11 +17,9 @@ import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
|||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.arenaworld.ArenaWorldLogic;
|
||||
import com.ljsd.jieling.logic.dao.CrossArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
|
@ -32,14 +28,10 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
|||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.GlobalidHelper;
|
||||
import com.ljsd.jieling.network.server.WorldHelper;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.SArenaRobotConfig;
|
||||
import config.SArenaSetting;
|
||||
import config.SGlobalSystemConfig;
|
||||
import config.SMServerArenaSetting;
|
||||
import manager.STableManager;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
|
@ -47,7 +39,6 @@ import org.springframework.data.redis.core.ZSetOperations;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.world.WorldProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -161,7 +152,7 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
|
|||
}
|
||||
teamInfo = FightUtil.makeCrossPersonData(csPlayer, proto.getTeamId(), null, crossArenaManager);
|
||||
arenaEnemys = ArenaLogic.getInstance().getUserCrossArenaEnemy(csPlayer,proto.getChallengeRank(),false).build();
|
||||
defendForce = (int) CrossServiceLogic.getCrossTeamForce(csPlayer.getUserId(),proto.getTeamId());
|
||||
defendForce = csPlayer.getLuoFuForce();
|
||||
} else {
|
||||
//机器人
|
||||
CrossArenaEnemy info = RedisUtil.getInstence().getMapEntry(RedisKey.CROSS_ARENA_ROBOT_INFO, String.valueOf(crossGroup), String.valueOf(proto.getChallengeUid()), CrossArenaEnemy.class);
|
||||
|
|
|
@ -17,6 +17,7 @@ import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
|||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.ShanHeSheJiTuStarEvent;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
|
@ -111,11 +112,11 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误!!"));
|
||||
}
|
||||
if(nodeConfig.getStageType() == 1){
|
||||
if(teamId != GlobalsDef.HARD_STAGE_TEAM){
|
||||
if(teamId != TeamEnum.HARD_STAGE_TEAM.getTeamId()){
|
||||
return;
|
||||
}
|
||||
}else if(nodeConfig.getStageType() == 3){
|
||||
if(teamId != GlobalsDef.VICE_HARD_STAGE_TEAM){
|
||||
if(teamId != TeamEnum.VICE_HARD_STAGE_TEAM.getTeamId()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightDispatcher;
|
||||
|
@ -525,7 +526,7 @@ public class JourneyMap {
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(session.getUid(), GlobalsDef.FORMATION_NORMAL, 20, "", GameFightType.MapFastFight, monster.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(session.getUid(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.MapFastFight, monster.getMonsterId(), 3);
|
||||
|
||||
Map<Integer, Long> remainHp = monster.getRemainHp();
|
||||
List<Long> hps = new ArrayList<>(remainHp.values());
|
||||
|
|
|
@ -384,7 +384,7 @@ public class MapLogic {
|
|||
}
|
||||
Map<Integer, Long> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
|
||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Endless);
|
||||
if(teamId==GlobalsDef.ENDLESS_TEAM&&user.getMapManager().getEndlessMapInfo().getSeason()==timeControllerOfFunction.getTimes()){
|
||||
if(teamId==TeamEnum.ENDLESS_TEAM.getTeamId()&&user.getMapManager().getEndlessMapInfo().getSeason()==timeControllerOfFunction.getTimes()){
|
||||
Map<String, Integer> endlessHeroInfo = user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo();
|
||||
if(endlessHeroInfo!=null&&endlessHeroInfo.size()>0){
|
||||
if(initType!=2){
|
||||
|
@ -406,7 +406,7 @@ public class MapLogic {
|
|||
LOGGER.info("enterMap() uid=>{} team pos is wrong ", uid, teamId);
|
||||
return "阵容有误";
|
||||
}
|
||||
if(2 == initType && teamId!=GlobalsDef.ENDLESS_TEAM){
|
||||
if(2 == initType && teamId!=TeamEnum.ENDLESS_TEAM.getTeamId()){
|
||||
Map<Integer, Integer> foodBufferMap = mapManager.getFoodBufferMap();
|
||||
for(Map.Entry<Integer,Integer> item : foodBufferMap.entrySet()){
|
||||
Integer value = item.getValue();
|
||||
|
@ -3085,7 +3085,7 @@ public class MapLogic {
|
|||
|
||||
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.FORMATION_NORMAL, 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.googlecode.protobuf.format.JsonFormat;
|
|||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.fight.FightRecordLogic;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.help.HelpHero;
|
||||
|
@ -170,7 +171,7 @@ public class BehaviorUtil {
|
|||
|
||||
CommonProto.FightData.Builder fightData = CommonProto.FightData.newBuilder();
|
||||
CommonProto.FightTeamInfo fightTeamInfo;
|
||||
if(teamId==GlobalsDef.ENDLESS_TEAM){
|
||||
if(teamId== TeamEnum.ENDLESS_TEAM.getTeamId()){
|
||||
fightTeamInfo = FightUtil.makePersonFightData(user,teamId,bloodMap,null);
|
||||
}else{
|
||||
fightTeamInfo = getFightTeamInfo(user, teamId,isMyself);
|
||||
|
@ -236,7 +237,7 @@ public class BehaviorUtil {
|
|||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId,boolean isMySelf) {
|
||||
if(teamId==GlobalsDef.TRIAL_TEAM){
|
||||
if(teamId==TeamEnum.TRIAL_TEAM.getTeamId()){
|
||||
return FightUtil.getFightTeamInfo(user,teamId);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
|
|
|
@ -4,8 +4,6 @@ import com.googlecode.protobuf.format.JsonFormat;
|
|||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
|
@ -24,19 +22,18 @@ 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.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MapInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import util.CellUtil;
|
||||
import util.MathUtils;
|
||||
import util.TimeUtils;
|
||||
|
@ -86,7 +83,7 @@ public class EndlessMap extends AbstractMap{
|
|||
MapLogic.getInstance().getMap(2).initMap(user.getMapManager(), user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ENDLESS_MISSION_REFRESH);
|
||||
}
|
||||
List<TeamPosHeroInfo> teamPosForHero = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
List<TeamPosHeroInfo> teamPosForHero = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
if(teamPosForHero!=null){
|
||||
for (TeamPosHeroInfo aTeamPosForHero : teamPosForHero) {
|
||||
String endlessHeroId = aTeamPosForHero.getHeroId();
|
||||
|
@ -241,8 +238,8 @@ public class EndlessMap extends AbstractMap{
|
|||
}
|
||||
int groupId = monsterGroupChange(option[0],user.getPlayerInfoManager().getLevel(),mapManager.getCurMapId());
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, GlobalsDef.ENDLESS_TEAM, 10, "", GameFightType.MapFastFight, groupId, 3);
|
||||
List<TeamPosHeroInfo> endteam = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, TeamEnum.ENDLESS_TEAM.getTeamId(), 10, "", GameFightType.MapFastFight, groupId, 3);
|
||||
List<TeamPosHeroInfo> endteam = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
Map<String,Integer> bloodMap = new HashMap<>();
|
||||
Map<String, Integer> endlessHeroInfo = mapManager.getEndlessMapInfo().getEndlessHeroInfo();
|
||||
for (int i = 0 ; i <endteam.size();i++) {
|
||||
|
@ -262,7 +259,7 @@ public class EndlessMap extends AbstractMap{
|
|||
//校验结果码 1:胜利
|
||||
int resultCode = fightResult.getResult();
|
||||
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
if (resultCode == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}else if(resultCode==0) {
|
||||
|
@ -576,7 +573,7 @@ public class EndlessMap extends AbstractMap{
|
|||
}
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
|
||||
Map<String, Integer> endlessHeroInfo = mapManager.getEndlessMapInfo().getEndlessHeroInfo();
|
||||
List<TeamPosHeroInfo> endteam = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
List<TeamPosHeroInfo> endteam = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
Map<String,Integer> bloodMap = new HashMap<>();
|
||||
for (int i = 0 ; i <endteam.size();i++) {
|
||||
|
||||
|
@ -662,7 +659,7 @@ public class EndlessMap extends AbstractMap{
|
|||
}
|
||||
}
|
||||
if(mapManager.getCurMapType()==MapEnum.ENDLESS_MAP.getType()){
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
for (int i = 0 ; i <team.size();i++) {
|
||||
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),0);
|
||||
}
|
||||
|
@ -673,7 +670,7 @@ public class EndlessMap extends AbstractMap{
|
|||
}
|
||||
|
||||
//无尽本更新血量
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
|
||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.ENDLESS_TEAM.getTeamId());
|
||||
for (int i = 0 ; i <team.size();i++) {
|
||||
Hero hero = user.getHeroManager().getEndlessHeroInfo().get(team.get(i).getHeroId());
|
||||
Map<Integer, Long> heroAttributeMap = SEndlessHeroProp.propsMap.get(hero.getTemplateId());
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.ljsd.jieling.handler.map.behavior.BaseBehavior;
|
|||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -117,7 +118,7 @@ public class TowerMap extends AbstractMap {
|
|||
mapEnterResponse.addAllMapList(cells);
|
||||
//当前使用英雄
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(GlobalsDef.TRIAL_TEAM);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(TeamEnum.TRIAL_TEAM.getTeamId());
|
||||
if(teamPosHeroInfos!=null&&teamPosHeroInfos.size()==1){
|
||||
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
|
||||
}
|
||||
|
@ -421,7 +422,7 @@ public class TowerMap extends AbstractMap {
|
|||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||
Map<Integer, List<Long>> monsterHp = trialInfo.getMonsterHp();
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, GlobalsDef.TRIAL_TEAM, 10, "", GameFightType.TowerMap, groupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, TeamEnum.TRIAL_TEAM.getTeamId(), 10, "", GameFightType.TowerMap, groupId, 3);
|
||||
//怪物剩余血量
|
||||
if(monsterHp!=null&&!monsterHp.isEmpty()&&monsterHp.containsKey(cell.getCellId())){
|
||||
pveFightEvent.setMonsterRemainHp(monsterHp.get(cell.getCellId()));
|
||||
|
@ -435,7 +436,7 @@ public class TowerMap extends AbstractMap {
|
|||
}
|
||||
mapManager.setLastFightResult(resultCode);
|
||||
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TRIAL_TEAM);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.TRIAL_TEAM.getTeamId());
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.size()<=0){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.dao.CrossArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
@ -50,7 +51,9 @@ public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInf
|
|||
//throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
SArenaRobotConfig sArenaRobotConfig ;
|
||||
if(proto.getTeamId()==GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE|| proto.getTeamId()==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO|| proto.getTeamId()==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){
|
||||
if(proto.getTeamId()== TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()||
|
||||
proto.getTeamId()==TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()||
|
||||
proto.getTeamId()==TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(proto.getTargetUid());
|
||||
}else{
|
||||
sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(info.getEnemyId());
|
||||
|
@ -58,7 +61,9 @@ public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInf
|
|||
PlayerLogic.getInstance().viewRobotHeroInfo(iSession,sArenaRobotConfig,proto.getHeroId(),proto.getTeamId());
|
||||
}else{
|
||||
//真人
|
||||
if(proto.getTeamId()== GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE||proto.getTeamId()== GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO||proto.getTeamId()== GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){
|
||||
if(proto.getTeamId()== TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()||
|
||||
proto.getTeamId()== TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()||
|
||||
proto.getTeamId()== TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse = PlayerLogic.getInstance().viewCrossHeroInfo(proto.getTargetUid(), proto.getHeroId(), proto.getTeamId());
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
}else {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RoomMatchRequestHandler extends BaseHandler{
|
|||
throw new ErrorCodeException(ErrorCode.newDefineCode(err));
|
||||
}
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
if( !user.getTeamPosManager().getTeamPosForHero().containsKey(GlobalsDef.BLOODY_TEAM)){
|
||||
if( !user.getTeamPosManager().getTeamPosForHero().containsKey(TeamEnum.BLOODY_TEAM.getTeamId())){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("未设置编队"));
|
||||
}
|
||||
snapUserFightInfo(user);
|
||||
|
@ -103,7 +103,7 @@ public class RoomMatchRequestHandler extends BaseHandler{
|
|||
|
||||
public static void snapUserFightInfo(User mine){
|
||||
//血量处理
|
||||
int myteamId = GlobalsDef.BLOODY_TEAM;
|
||||
int myteamId = TeamEnum.BLOODY_TEAM.getTeamId();
|
||||
|
||||
mine.getTeamPosManager().setCurTeamPosId(myteamId);
|
||||
PlayerManager playerInfoManager = mine.getPlayerInfoManager();
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.fight.DefFightSnapData;
|
||||
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.fight.ArenaRecord;
|
||||
import com.ljsd.jieling.logic.dao.FamilyFightInfo;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import rpc.protocols.CommonProto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
import manager.STableManager;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import rpc.protocols.CommonProto;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
@ -50,7 +50,7 @@ public class Cmd_review_gm extends GmAbstract {
|
|||
byte[] fightData = arenaRecord.getFightData();
|
||||
CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(fightData);
|
||||
LuaValue getFightData;
|
||||
int snapTeamId = GlobalsDef.CHAMPION_ATTACK_TEAM;
|
||||
int snapTeamId = TeamEnum.CHAMPION_ATTACK_TEAM.getTeamId();
|
||||
RedisUtil.getInstence().del(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FIGHT, ""));
|
||||
int warTime = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getWarTime();
|
||||
Map<Integer, ChampionshipLogic.MemberInfo> memberInfoMap = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, ChampionshipLogic.MemberInfo.class);
|
||||
|
|
|
@ -192,7 +192,7 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
}
|
||||
|
||||
private void snapOneFightInfo(User self, ExpeditionNodeInfo nodeInfo, int defid) throws Exception {
|
||||
int snapTeamId = GlobalsDef.TEAM_ARENA_DEFENSE;
|
||||
int snapTeamId = TeamEnum.TEAM_ARENA_DEFENSE.getTeamId();
|
||||
|
||||
if (!isBattleNode(nodeInfo.getType())) {
|
||||
return;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.ljsd.jieling.logic.activity.crossService;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.db.mongo.core.CServerInfo;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -40,8 +40,9 @@ public class CrossServiceLogic {
|
|||
private CrossServiceLogic(){}
|
||||
/**
|
||||
* key有效时间,秒
|
||||
* 七天
|
||||
*/
|
||||
public static final int EXPIRE = 604800;//七天
|
||||
public static final int EXPIRE = 604800;
|
||||
|
||||
public static class Instance {
|
||||
public final static CrossServiceLogic instance = new CrossServiceLogic();
|
||||
|
@ -105,38 +106,11 @@ public class CrossServiceLogic {
|
|||
}
|
||||
|
||||
public void saveBasicPlayerToRedis(User user){
|
||||
CSPlayer player = formattUserToPlayer(user);
|
||||
CSPlayer player = formatUserToPlayer(user);
|
||||
RedisUtil.getInstence().setObject(getKey(player.getUserId()),player,EXPIRE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跨服队伍战力
|
||||
* @param userId
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public static long getCrossTeamForce(int userId, int teamId){
|
||||
CSPlayer csPlayer = getPlayerByRedis(userId);
|
||||
int force = 0;
|
||||
if (csPlayer == null){
|
||||
return force;
|
||||
}
|
||||
// 本服玩家直接计算,跨服玩家走rpc
|
||||
if(GameApplication.serverId == csPlayer.getServerId()){
|
||||
User user = UserManager.getUserNotCache(userId);
|
||||
if (user != null){
|
||||
force = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||
}
|
||||
}else {
|
||||
CrossArenaManager data = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
|
||||
if (data != null){
|
||||
force = data.getTotalForceByTeam().getOrDefault(teamId,0);
|
||||
}
|
||||
}
|
||||
return force;
|
||||
}
|
||||
|
||||
private static CSPlayer formattUserToPlayer(User user){
|
||||
private static CSPlayer formatUserToPlayer(User user){
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(user.getId());
|
||||
int newScore=0,oldScore =0,crossYxldMaxLevel=0 ;
|
||||
if(csPlayer!=null){
|
||||
|
@ -162,63 +136,54 @@ public class CrossServiceLogic {
|
|||
player.setCrossYuxulundaoOldScore(oldScore);
|
||||
player.setGuildId(p.getGuildId());
|
||||
player.setCrossYxldMaxLevel(crossYxldMaxLevel);
|
||||
//三个队伍总战力
|
||||
int force1 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false);
|
||||
int force2 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false);
|
||||
int force3 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false);
|
||||
//玉虚三个队伍总战力
|
||||
int force1 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId(), false);
|
||||
int force2 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId(), false);
|
||||
int force3 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId(), false);
|
||||
player.setMaxFore(force1+force2+force3);
|
||||
// 主线编队战力
|
||||
int mainLine = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
player.setMainLineForce(mainLine);
|
||||
// 罗浮编队战力
|
||||
int luoFu = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
player.setLuoFuForce(luoFu);
|
||||
return player;
|
||||
}
|
||||
|
||||
|
||||
public static CSPlayer getPlayerByRedis(int uid){
|
||||
return getPlayerByRedis(uid,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨服获取玩家信息
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
public static CSPlayer getPlayerByRedis(int uid){
|
||||
public static CSPlayer getPlayerByRedis(int uid, boolean bol){
|
||||
CSPlayer player = RedisUtil.getInstence().getObject(getKey(uid), CSPlayer.class);
|
||||
if(player != null){
|
||||
return player;
|
||||
}else{
|
||||
try {
|
||||
// 连接mongo库,获取服务器id
|
||||
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||
Query query = new Query(Criteria.where("_id").is(uid));
|
||||
UserInfo userInfo = core.findOne(query, UserInfo.class);
|
||||
if (userInfo == null){
|
||||
return null;
|
||||
}
|
||||
// 连接跨服游戏库,获取玩家信息
|
||||
MongoTemplate game = MongoUtil.getInstence().getMonogTemplate2(Integer.parseInt(userInfo.getServerId()));
|
||||
User user = game.findOne(query, User.class);
|
||||
if (user == null){
|
||||
return null;
|
||||
}
|
||||
player = new CSPlayer();
|
||||
PlayerManager p = user.getPlayerInfoManager();
|
||||
player.setUserId(user.getId());
|
||||
player.setLevel(p.getLevel());
|
||||
player.setName(p.getNickName());
|
||||
player.setHead(p.getHead());
|
||||
player.setHeadFrame(p.getHeadFrame());
|
||||
player.setSkin(p.getUserSkin());
|
||||
player.setUserTitle(p.getUserTitle());
|
||||
player.setPracticeLevel(user.getHeroManager().getPracticeLevel());
|
||||
player.setServerId(Integer.parseInt(userInfo.getServerId()));
|
||||
player.setSex(p.getSex());
|
||||
player.setUserMount(p.getUserMount());
|
||||
player.setCrossYuxulundaoNewScore(0);
|
||||
player.setCrossYuxulundaoOldScore(0);
|
||||
player.setGuildId(p.getGuildId());
|
||||
//三个队伍总战力
|
||||
int force1 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false);
|
||||
int force2 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false);
|
||||
int force3 = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false);
|
||||
player.setMaxFore(force1+force2+force3);
|
||||
RedisUtil.getInstence().setObject(getKey(player.getUserId()),player,EXPIRE);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(bol && player != null){
|
||||
return player;
|
||||
}
|
||||
try {
|
||||
// 连接mongo库,获取服务器id
|
||||
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||
Query query = new Query(Criteria.where("_id").is(uid));
|
||||
UserInfo userInfo = core.findOne(query, UserInfo.class);
|
||||
if (userInfo == null) {
|
||||
return null;
|
||||
}
|
||||
// 连接跨服游戏库,获取玩家信息
|
||||
MongoTemplate game = MongoUtil.getInstence().getMonogTemplate2(Integer.parseInt(userInfo.getServerId()));
|
||||
User user = game.findOne(query, User.class);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
player = formatUserToPlayer(user);
|
||||
RedisUtil.getInstence().setObject(getKey(player.getUserId()), player, EXPIRE);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -332,16 +333,16 @@ public class FourChallengeLogic {
|
|||
*/
|
||||
public static boolean isFourChallengeTeam(int teamId){
|
||||
boolean result = false;
|
||||
if (GlobalsDef.FOURCHALLENGE_PEOPLE_TEAM == teamId){
|
||||
if (TeamEnum.FOURCHALLENGE_PEOPLE_TEAM.getTeamId() == teamId){
|
||||
result = true;
|
||||
}
|
||||
if (GlobalsDef.FOURCHALLENGE_BUDDHA_TEAM == teamId){
|
||||
if (TeamEnum.FOURCHALLENGE_BUDDHA_TEAM.getTeamId() == teamId){
|
||||
result = true;
|
||||
}
|
||||
if (GlobalsDef.FOURCHALLENGE_MONSTER_TEAM == teamId){
|
||||
if (TeamEnum.FOURCHALLENGE_MONSTER_TEAM.getTeamId() == teamId){
|
||||
result = true;
|
||||
}
|
||||
if (GlobalsDef.FOURCHALLENGE_MORALITY_TEAM == teamId){
|
||||
if (TeamEnum.FOURCHALLENGE_MORALITY_TEAM.getTeamId() == teamId){
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -116,8 +116,8 @@ public class ArenaLogic {
|
|||
.build();
|
||||
}else{
|
||||
User user = UserManager.getUser(enemyId);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(),false);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.TEAM_ARENA_DEFENSE.getTeamId());
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||
for(TeamPosHeroInfo teamPosHeroInfo:teamPosHeroInfoList){
|
||||
|
@ -147,8 +147,8 @@ public class ArenaLogic {
|
|||
|
||||
public CommonProto.ArenaEnemy getWorldArenaEnemy( int uid) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,false);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.WORLD_TEAM_ARENA_DEFENSE);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId(),false);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId());
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||
for(TeamPosHeroInfo teamPosHeroInfo:teamPosHeroInfoList){
|
||||
|
@ -239,8 +239,8 @@ public class ArenaLogic {
|
|||
|
||||
public static int getFightResultByPersonToPerson(User mine, int myteamId, User defUser, int defTeamId, ArenaRecord arenaRecord, ArenaInfoProto.ArenaChallengeResponse.Builder builder) throws Exception {
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(mine.getId(),myteamId,SArenaSetting.getSArenaSetting().getMostTime(),"", GameFightType.ArenaPersonFight,defUser.getId(),defTeamId);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, GlobalsDef.TEAM_ARENA_DEFENSE, false);
|
||||
int defForce = HeroLogic.getInstance().calTeamTotalForce(defUser, GlobalsDef.TEAM_ARENA_DEFENSE, false);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(), false);
|
||||
int defForce = HeroLogic.getInstance().calTeamTotalForce(defUser, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(), false);
|
||||
arenaRecord.setAttackForce(myforce);
|
||||
if(myforce<defForce){
|
||||
pvpFightEvent.setRever(true);
|
||||
|
@ -273,7 +273,7 @@ public class ArenaLogic {
|
|||
|
||||
public int getFightResultByPersonToRobot(User mine, int myteamId, int challengeUid,ArenaInfoProto.ArenaChallengeResponse.Builder builder) throws Exception {
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(mine.getId(),myteamId,SArenaSetting.getSArenaSetting().getMostTime(),"", GameFightType.ArenaRobotFight,challengeUid,-1);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, GlobalsDef.TEAM_ARENA_DEFENSE, false);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(), false);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(myteamId);
|
||||
if(sArenaRobotConfig!=null&&myforce<sArenaRobotConfig.getTotalForce()){
|
||||
pvpFightEvent.setRever(true);
|
||||
|
@ -302,7 +302,7 @@ public class ArenaLogic {
|
|||
return "not allowed";
|
||||
}
|
||||
}
|
||||
if(!user.getTeamPosManager().getTeamPosForHero().containsKey(GlobalsDef.TEAM_ARENA_DEFENSE)){
|
||||
if(!user.getTeamPosManager().getTeamPosForHero().containsKey(TeamEnum.TEAM_ARENA_DEFENSE.getTeamId())){
|
||||
return "未设置防守阵容";
|
||||
}
|
||||
SArenaSetting sArenaSetting = SArenaSetting.getSArenaSetting();
|
||||
|
@ -436,9 +436,9 @@ public class ArenaLogic {
|
|||
if (null == user) {
|
||||
continue;
|
||||
}
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE, false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId(), false);
|
||||
LOGGER.info("获取世界排行榜信息===========玩家id:{}",uid);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.TEAM_ARENA_DEFENSE.getTeamId());
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
||||
|
@ -1001,15 +1001,12 @@ public class ArenaLogic {
|
|||
Object get = RedisUtil.getInstence().hget(RedisKey.ARENA_PROUD_COUNT, String.valueOf(csPlayer.getUserId()));
|
||||
int proudTime = get==null?1:Integer.parseInt((String)get);
|
||||
String serverName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
|
||||
int force = (int)CrossServiceLogic.getCrossTeamForce(csPlayer.getUserId(), TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId());
|
||||
|
||||
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
||||
.setUid(csPlayer.getUserId())
|
||||
.setLevel(csPlayer.getLevel())
|
||||
.setName(csPlayer.getName())
|
||||
.setServername(serverName)
|
||||
.setTotalForce(force)
|
||||
.setTotalForce(csPlayer.getLuoFuForce())
|
||||
.setUserTitle(csPlayer.getUserTitle())
|
||||
.setUserMount(csPlayer.getUserMount())
|
||||
.setGender(csPlayer.getSex())
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.ljsd.fight.DefFightSnapData;
|
|||
import com.ljsd.fight.FamilyHeroInfo;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
|
@ -33,9 +32,6 @@ import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
|||
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.ArenaInfoProto;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.thread.ThreadManager;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
|
@ -44,6 +40,9 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.DefaultTypedTuple;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.ArenaInfoProto;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import util.MathUtils;
|
||||
import util.TimeUtils;
|
||||
|
||||
|
@ -537,7 +536,7 @@ public class ChampionshipLogic {
|
|||
MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(uid), MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
return PlayerLogic.getInstance().getUserTeamOneInfo(uid,GlobalsDef.CHAMPION_TEAM);
|
||||
return PlayerLogic.getInstance().getUserTeamOneInfo(uid,TeamEnum.CHAMPION_TEAM.getTeamId());
|
||||
}
|
||||
//fix 整个过程都不能调整编队
|
||||
|
||||
|
@ -632,7 +631,7 @@ public class ChampionshipLogic {
|
|||
|
||||
|
||||
public static void snapPlayFightInfo( boolean fight) throws Exception {
|
||||
int snapTeamId = GlobalsDef.CHAMPION_ATTACK_TEAM;
|
||||
int snapTeamId = TeamEnum.CHAMPION_ATTACK_TEAM.getTeamId();
|
||||
RedisUtil.getInstence().del(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FIGHT, ""));
|
||||
int warTime = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getWarTime();
|
||||
Map<Integer, MemberInfo> memberInfoMap = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, MemberInfo.class);
|
||||
|
@ -694,7 +693,7 @@ public class ChampionshipLogic {
|
|||
|
||||
|
||||
public static void snapOneFightInfo(int uid, Map<Integer, MemberInfo> joinMembers) throws Exception {
|
||||
int snapTeamId = GlobalsDef.CHAMPION_TEAM;
|
||||
int snapTeamId = TeamEnum.CHAMPION_TEAM.getTeamId();
|
||||
|
||||
Map<Integer, SArenaRobotConfig> config = STableManager.getConfig(SArenaRobotConfig.class);
|
||||
if (config.containsKey(uid)) {
|
||||
|
@ -1200,9 +1199,9 @@ public class ChampionshipLogic {
|
|||
if (null == user) {
|
||||
return null;
|
||||
}
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CHAMPION_TEAM, false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CHAMPION_TEAM.getTeamId(), false);
|
||||
if (type == 0) {
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.CHAMPION_TEAM);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.CHAMPION_TEAM.getTeamId());
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.TreeMap;
|
|||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
|
||||
public enum TeamEnum {
|
||||
FORMATION_NORMAL(1,"主线编队",1,1),
|
||||
TEAM_ARENA_DEFENSE(101,"竞技场防御编队",0,1),
|
||||
|
@ -32,6 +33,7 @@ public enum TeamEnum {
|
|||
FOURCHALLENGE_PEOPLE_TEAM(3001,"四灵试炼-人"),
|
||||
FOURCHALLENGE_BUDDHA_TEAM(3002,"四灵试炼-佛"),
|
||||
FOURCHALLENGE_MONSTER_TEAM(3003,"四灵试炼-妖"),
|
||||
FOURCHALLENGE_MORALITY_TEAM(3004,"四灵试炼-道"),
|
||||
SEVEN_WORLD_TEAM(2101,"七届试炼编队",1,0),
|
||||
;
|
||||
|
||||
|
|
|
@ -131,10 +131,10 @@ public class TeamPosManager extends MongoBase {
|
|||
String subKey = HelpHeroLogic.subKey(user.getId(),HelpHeroLogic.CHOOSE);
|
||||
Map<String, HelpHero> helpHero = HelpHeroLogic.getHelpHeroMap(subKey);
|
||||
helpHero.values().forEach(v->{
|
||||
removeTeamPosByHeroId(GlobalsDef.FOURCHALLENGE_PEOPLE_TEAM,v.getHero().getId());
|
||||
removeTeamPosByHeroId(GlobalsDef.FOURCHALLENGE_BUDDHA_TEAM,v.getHero().getId());
|
||||
removeTeamPosByHeroId(GlobalsDef.FOURCHALLENGE_MONSTER_TEAM,v.getHero().getId());
|
||||
removeTeamPosByHeroId(GlobalsDef.FOURCHALLENGE_MORALITY_TEAM,v.getHero().getId());
|
||||
removeTeamPosByHeroId(TeamEnum.FOURCHALLENGE_PEOPLE_TEAM.getTeamId(),v.getHero().getId());
|
||||
removeTeamPosByHeroId(TeamEnum.FOURCHALLENGE_BUDDHA_TEAM.getTeamId(),v.getHero().getId());
|
||||
removeTeamPosByHeroId(TeamEnum.FOURCHALLENGE_MONSTER_TEAM.getTeamId(),v.getHero().getId());
|
||||
removeTeamPosByHeroId(TeamEnum.FOURCHALLENGE_MORALITY_TEAM.getTeamId(),v.getHero().getId());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.ljsd.jieling.logic.dao.cross;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
|
@ -78,24 +76,28 @@ public class CSPlayer {
|
|||
/**
|
||||
* 玉虚论道历史达到的最高等级
|
||||
*/
|
||||
private int crossYxldMaxLevel = 0 ; //历史达到的最高等级
|
||||
private int crossYxldMaxLevel = 0 ;
|
||||
|
||||
public CSPlayer(User user) {
|
||||
PlayerManager manager = user.getPlayerInfoManager();
|
||||
this.userId = user.getId();
|
||||
this.level = manager.getLevel();
|
||||
this.name = manager.getNickName();
|
||||
this.sex = manager.getSex();
|
||||
this.head = manager.getHead();
|
||||
this.headFrame = manager.getHeadFrame();
|
||||
this.skin = manager.getUserSkin();
|
||||
this.userTitle = manager.getUserTitle();
|
||||
this.userMount = manager.getUserMount();
|
||||
this.practiceLevel = user.getHeroManager().getPracticeLevel();
|
||||
this.guildId = manager.getGuildId();
|
||||
this.serverId = GameApplication.serverId;
|
||||
this.maxFore = user.getPlayerInfoManager().getMaxForce();
|
||||
}
|
||||
private int mainLineForce = 0;
|
||||
|
||||
private int luoFuForce = 0;
|
||||
|
||||
// public CSPlayer(User user) {
|
||||
// PlayerManager manager = user.getPlayerInfoManager();
|
||||
// this.userId = user.getId();
|
||||
// this.level = manager.getLevel();
|
||||
// this.name = manager.getNickName();
|
||||
// this.sex = manager.getSex();
|
||||
// this.head = manager.getHead();
|
||||
// this.headFrame = manager.getHeadFrame();
|
||||
// this.skin = manager.getUserSkin();
|
||||
// this.userTitle = manager.getUserTitle();
|
||||
// this.userMount = manager.getUserMount();
|
||||
// this.practiceLevel = user.getHeroManager().getPracticeLevel();
|
||||
// this.guildId = manager.getGuildId();
|
||||
// this.serverId = GameApplication.serverId;
|
||||
// this.maxFore = user.getPlayerInfoManager().getMaxForce();
|
||||
// }
|
||||
|
||||
public CSPlayer() {
|
||||
}
|
||||
|
@ -228,4 +230,27 @@ public class CSPlayer {
|
|||
this.crossYxldMaxLevel = crossYxldMaxLevel;
|
||||
}
|
||||
|
||||
public int getMainLineForce() {
|
||||
if (mainLineForce == 0){
|
||||
CSPlayer redis = CrossServiceLogic.getPlayerByRedis(userId, false);
|
||||
mainLineForce = redis==null?0:redis.getMainLineForce();
|
||||
}
|
||||
return mainLineForce;
|
||||
}
|
||||
|
||||
public void setMainLineForce(int mainLineForce) {
|
||||
this.mainLineForce = mainLineForce;
|
||||
}
|
||||
|
||||
public int getLuoFuForce() {
|
||||
if (mainLineForce == 0){
|
||||
CSPlayer redis = CrossServiceLogic.getPlayerByRedis(userId, false);
|
||||
luoFuForce = redis==null?0:redis.getLuoFuForce();
|
||||
}
|
||||
return luoFuForce;
|
||||
}
|
||||
|
||||
public void setLuoFuForce(int luoFuForce) {
|
||||
this.luoFuForce = luoFuForce;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -753,7 +753,7 @@ public class ExpeditionLogic {
|
|||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero;
|
||||
|
||||
if(teamId==GlobalsDef.EXPEDITION_TEAM&&user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
|
||||
if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()&&user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
|
||||
hero =user.getExpeditionManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
}else {
|
||||
hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
|
@ -771,7 +771,7 @@ public class ExpeditionLogic {
|
|||
//处理圣物英雄技能
|
||||
disposeWithHeroHoly(user,hero,skillSb);
|
||||
|
||||
if(teamId==GlobalsDef.EXPEDITION_TEAM){
|
||||
if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()){
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||
for (SExpeditionHolyConfig expeditionHolyConfig:expeditionHolyConfigs) {
|
||||
|
|
|
@ -358,7 +358,7 @@ public class DeathPathLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
SGuildWarConfig config = STableManager.getConfig(SGuildWarConfig.class).get(pathId);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.DEATH_PATH_TEAM, SGuildSetting.sGuildSetting.getWarTime(), "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.DEATH_PATH_TEAM.getTeamId(), SGuildSetting.sGuildSetting.getWarTime(), "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
long damage = fightResult.getDuration();
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
|
|
|
@ -771,7 +771,7 @@ public class CombatLogic {
|
|||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null){
|
||||
//大闹天宫
|
||||
if (teamId==GlobalsDef.EXPEDITION_TEAM){
|
||||
if (teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()){
|
||||
if (user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
|
||||
hero = user.getExpeditionManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
}else {
|
||||
|
@ -836,7 +836,7 @@ public class CombatLogic {
|
|||
List<Integer> heroFind = new ArrayList<>(teamPosHeroInfos.size());
|
||||
for(TeamPosHeroInfo key :teamPosHeroInfos){
|
||||
// 大闹天宫
|
||||
if(teamId==GlobalsDef.EXPEDITION_TEAM&&user.getExpeditionManager().getHeroMap().containsKey(key.getHeroId())){
|
||||
if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()&&user.getExpeditionManager().getHeroMap().containsKey(key.getHeroId())){
|
||||
heroFind.add(user.getExpeditionManager().getHeroMap().get(key.getHeroId()).getTemplateId());
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.ljsd.jieling.handler.map.TrailHero;
|
|||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.blood.BloodLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
|
@ -250,7 +251,7 @@ public class FightUtil {
|
|||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId) {
|
||||
//森罗幻境使用镜像来战斗
|
||||
if (teamId != GlobalsDef.TRIAL_TEAM) {
|
||||
if (teamId != TeamEnum.TRIAL_TEAM.getTeamId()) {
|
||||
return BehaviorUtil.getFightTeamInfo(user, teamId, true);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
|
@ -306,7 +307,7 @@ public class FightUtil {
|
|||
private static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId, Map<String, Integer> attackBloodMap) {
|
||||
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
if (teamId == GlobalsDef.ENDLESS_TEAM) {
|
||||
if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) {
|
||||
return getEndlessTeam(user, teamId, attackBloodMap);
|
||||
}
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.ljsd.jieling.logic.fight.specialparm;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum SpecialForTeamBuildEnum {
|
||||
EXPEDITION_TEAM(GlobalsDef.EXPEDITION_TEAM, new ExpetionSpecialProcessor()),
|
||||
EXPEDITION_TEAM(TeamEnum.EXPEDITION_TEAM.getTeamId(), new ExpetionSpecialProcessor()),
|
||||
;
|
||||
|
||||
private static Map<Integer,SpecialForTeamBuildEnum> cache = new HashMap<>();
|
||||
|
|
|
@ -1121,7 +1121,7 @@ public class HeroLogic {
|
|||
User user = UserManager.getUser(iSession.getUid());
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Set<Integer> set = new HashSet<>();
|
||||
if (teamId == GlobalsDef.EXPEDITION_TEAM) {
|
||||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||
|
||||
heroIds.forEach(heroId -> {
|
||||
if (heroManager.getHeroMap().containsKey(heroId.getHeroId())) {
|
||||
|
@ -1131,12 +1131,12 @@ public class HeroLogic {
|
|||
set.add(user.getExpeditionManager().getHero(heroId.getHeroId()).getTemplateId());
|
||||
}
|
||||
});
|
||||
} else if (teamId == GlobalsDef.TRIAL_TEAM) {
|
||||
} else if (teamId == TeamEnum.TRIAL_TEAM.getTeamId()) {
|
||||
if (heroIds.size() != 1) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
heroIds.forEach(heroId -> set.add(user.getMapManager().getTrialInfo().getHeroInfo().get(heroId.getHeroId()).getTmpId()));
|
||||
} else if (teamId == GlobalsDef.ENDLESS_TEAM) {
|
||||
} else if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) {
|
||||
for (CommonProto.TeamHeroInfo teamHeroInfo : heroIds) {
|
||||
Hero hero = heroManager.getEndlessHeroInfo().get(teamHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
|
@ -1166,12 +1166,12 @@ public class HeroLogic {
|
|||
throw new ErrorCodeException(ErrorCode.NO_USE_SAME_HERO);
|
||||
}
|
||||
String err = checkTeamPos(user, teamId, heroIds);
|
||||
if (teamId != GlobalsDef.ENDLESS_TEAM && !"".equals(err)) {
|
||||
if (teamId != TeamEnum.ENDLESS_TEAM.getTeamId() && !"".equals(err)) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode(err));
|
||||
}
|
||||
user.getTeamPosManager().changeTeamInfo(teamId, heroIds);
|
||||
//401图内可以更改编队
|
||||
if (teamId == GlobalsDef.ENDLESS_TEAM) {
|
||||
if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) {
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
if (teamPosHeroInfos != null) {
|
||||
List<String> heroes = new ArrayList<>(teamPosHeroInfos.size());
|
||||
|
@ -1216,18 +1216,18 @@ public class HeroLogic {
|
|||
} else {
|
||||
user.getTeamPosManager().changeTeamInfo(teamId, heroIds);
|
||||
}
|
||||
} else if (teamId == GlobalsDef.TEAM_ARENA_DEFENSE) {
|
||||
} else if (teamId == TeamEnum.TEAM_ARENA_DEFENSE.getTeamId()) {
|
||||
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||
//更新竞技场防御编队战力
|
||||
String key = RedisKey.getKey(RedisKey.AREDEF_TEAM_FORCE_RANK, "", false);
|
||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), teamForce);
|
||||
|
||||
}
|
||||
if (teamId == GlobalsDef.FORMATION_NORMAL) {
|
||||
if (teamId == TeamEnum.FORMATION_NORMAL.getTeamId()) {
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(iSession.getUid()));
|
||||
}
|
||||
//跨服 玉虚论道
|
||||
if (teamId == GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE || teamId == GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO || teamId == GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE) {
|
||||
if (TeamEnum.isCrossTeam(teamId)) {
|
||||
CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user);
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.HERO_IN_TEAM, heroIds.size());
|
||||
|
@ -1243,12 +1243,12 @@ public class HeroLogic {
|
|||
Set<String> cacheHeroIds = new HashSet<>();
|
||||
for (CommonProto.TeamHeroInfo teamHeroInfo : heroIds) {
|
||||
String heroId = teamHeroInfo.getHeroId();
|
||||
if (teamId == GlobalsDef.EXPEDITION_TEAM) {
|
||||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||
if (user.getHeroManager().getHero(heroId) == null && !user.getExpeditionManager().getHeroMap().containsKey(heroId)) {
|
||||
// 卡牌不存在
|
||||
return "card not exists";
|
||||
}
|
||||
} else if (teamId == GlobalsDef.TRIAL_TEAM) {
|
||||
} else if (teamId == TeamEnum.TRIAL_TEAM.getTeamId()) {
|
||||
if (!user.getMapManager().getTrialInfo().getHeroInfo().containsKey(heroId)) {
|
||||
return "card not exists";
|
||||
}
|
||||
|
@ -2193,7 +2193,7 @@ public class HeroLogic {
|
|||
public StringBuilder getHeroProperty(User user, Hero hero, StringBuilder sb, boolean isMySelf, int teamId) {
|
||||
int curMapId = user.getMapManager().getCurMapId();
|
||||
Map<Integer, Long> heroAttributeMap;
|
||||
if (!isMySelf || curMapId == 0 || (teamId != GlobalsDef.TRIAL_TEAM && teamId != GlobalsDef.ENDLESS_TEAM)) {
|
||||
if (!isMySelf || curMapId == 0 || (teamId != TeamEnum.TRIAL_TEAM.getTeamId() && teamId != TeamEnum.ENDLESS_TEAM.getTeamId())) {
|
||||
heroAttributeMap = calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
} else {
|
||||
heroAttributeMap = calHeroFinalAttributeWhenInMap(user, hero, false, teamId);
|
||||
|
@ -2497,7 +2497,7 @@ public class HeroLogic {
|
|||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (teamId != 0) {
|
||||
int heroNum = user.getTeamPosManager().getTeamPosForHero().get(teamId).size();
|
||||
if (teamId == GlobalsDef.TRIAL_TEAM) {
|
||||
if (teamId == TeamEnum.TRIAL_TEAM.getTeamId()) {
|
||||
//森罗环境固定为5
|
||||
heroNum = 5;
|
||||
}
|
||||
|
@ -2843,7 +2843,7 @@ public class HeroLogic {
|
|||
//被动技能加成
|
||||
Set<Integer> heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero, teamId);
|
||||
|
||||
if (teamId == GlobalsDef.EXPEDITION_TEAM) {
|
||||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||
for (SExpeditionHolyConfig config : expeditionHolyConfigs) {
|
||||
|
@ -2879,7 +2879,7 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
|
||||
if (teamId == GlobalsDef.EXPEDITION_TEAM) {
|
||||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||
if (user.getExpeditionManager().getWorldTreasureReward().getIsBuy() == 1) {
|
||||
int[] onceArrayValue = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SKILL_EFFECT_TGMB);
|
||||
combinedAttribute(new int[][]{onceArrayValue}, heroAllAttribute);
|
||||
|
@ -3568,7 +3568,7 @@ public class HeroLogic {
|
|||
while (it.hasNext()) {
|
||||
TeamPosHeroInfo hero = it.next();
|
||||
if (hero.getHeroId().equals(heroId)) {
|
||||
if (entry.getKey() == GlobalsDef.ENDLESS_TEAM && user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo().get(heroId) != null) {
|
||||
if (entry.getKey() == TeamEnum.ENDLESS_TEAM.getTeamId() && user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo().get(heroId) != null) {
|
||||
user.getMapManager().removeEndlessHero(heroId);
|
||||
}
|
||||
it.remove();
|
||||
|
@ -3752,7 +3752,7 @@ public class HeroLogic {
|
|||
StringBuilder append = new StringBuilder().append("[");
|
||||
append.append(calAllPokenmonForce(user));
|
||||
getTeamForceForUpload(append, user.getTeamPosManager().getTeamPosForHero().get(1), user, 1);
|
||||
getTeamForceForUpload(append, user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE), user, GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||
getTeamForceForUpload(append, user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.TEAM_ARENA_DEFENSE.getTeamId()), user, TeamEnum.TEAM_ARENA_DEFENSE.getTeamId());
|
||||
append.append("]");
|
||||
return append.toString();
|
||||
}
|
||||
|
|
|
@ -349,7 +349,7 @@ public class PlayerLogic {
|
|||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.FORCESTANDARD,teamForce);
|
||||
}
|
||||
|
||||
if(teamId == GlobalsDef.TEAM_ARENA_DEFENSE){
|
||||
if(teamId == TeamEnum.TEAM_ARENA_DEFENSE.getTeamId()){
|
||||
//更新竞技场防御编队战力
|
||||
String key = RedisKey.getKey(RedisKey.AREDEF_TEAM_FORCE_RANK, "", false);
|
||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), teamForce);
|
||||
|
@ -567,7 +567,7 @@ public class PlayerLogic {
|
|||
// 总战力
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
|
||||
if(teamId==GlobalsDef.TASUILINGXIAO_CHALLENGE){
|
||||
if(teamId==TeamEnum.TASUILINGXIAO_CHALLENGE.getTeamId()){
|
||||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
|
@ -733,7 +733,7 @@ public class PlayerLogic {
|
|||
for(int id :crossTeamId){
|
||||
int position = 1;
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
if(id ==GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE){
|
||||
if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
|
@ -741,7 +741,7 @@ public class PlayerLogic {
|
|||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce1());
|
||||
|
||||
}else if(id ==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO){
|
||||
}else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList2().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
|
@ -749,7 +749,7 @@ public class PlayerLogic {
|
|||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce2());
|
||||
|
||||
}else if(id ==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){
|
||||
}else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList3().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
|
@ -763,67 +763,6 @@ public class PlayerLogic {
|
|||
//oneInfo.setTeam(teamInfo);
|
||||
return oneInfo;
|
||||
}
|
||||
//跨服三队伍
|
||||
public CommonProto.TeamOneInfo.Builder getUserTeamOneInfo(int uid,List<Integer> crossTeamId) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CBean2Proto.getTeamOneInfo(user);
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
for(int teamId:crossTeamId){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
// 总战力
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
|
||||
if(teamId==GlobalsDef.TASUILINGXIAO_CHALLENGE){
|
||||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder().setHeroTid(hero.getTempId()).setLevel(hero.getLeve()).setStar(hero.getStar()).setPosition(entry.getKey()).setGodSoulLv(hero.getGodSoulLv()).build();
|
||||
teamInfo.addTeam(info);
|
||||
}
|
||||
teamInfo.setTotalForce(user.getHeroManager().getTaSuiLingXiaoRankForce());
|
||||
|
||||
}else{
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
// 添加队伍信息
|
||||
List<TeamPosHeroInfo> heroInfos = teamPosManager.getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo heroInfo:heroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
}
|
||||
// 紫府神印
|
||||
List<String> collect = heroInfos.stream().map(TeamPosHeroInfo::getHeroId).collect(Collectors.toList());
|
||||
teamInfo.addAllSealShow(CBean2Proto.getPurpleSealShow(user,collect));
|
||||
}
|
||||
|
||||
}
|
||||
//加入灵兽信息
|
||||
PokemonManager pokemonManager = user.getPokemonManager();
|
||||
if(!pokemonManager.getPokemonTeamMap().isEmpty()){
|
||||
for(Map.Entry<Integer,String> entry:pokemonManager.getPokemonTeamMap().entrySet()){
|
||||
Pokemon pokemon = pokemonManager.getPokemonMap().get(entry.getValue());
|
||||
if(pokemon==null){
|
||||
continue;
|
||||
}
|
||||
teamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon,entry.getKey()));
|
||||
}
|
||||
}
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId!=0){
|
||||
if(GuilidManager.guildInfoMap.containsKey(guildId)){
|
||||
String name = GuilidManager.guildInfoMap.get(guildId).getName();
|
||||
oneInfo.setGuildName(name);
|
||||
}
|
||||
|
||||
}
|
||||
if(teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE ||teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO || teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE ){
|
||||
oneInfo.addCrossTeam(teamInfo);
|
||||
}else{
|
||||
oneInfo.setTeam(teamInfo);
|
||||
}
|
||||
}
|
||||
return oneInfo;
|
||||
}
|
||||
|
||||
|
||||
//获取跨服玩家信息
|
||||
public CommonProto.TeamOneInfo getCrossYxldMyTeamInfo(User user,List<Integer> team) throws Exception{
|
||||
|
@ -1184,12 +1123,12 @@ public class PlayerLogic {
|
|||
builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue().intValue()).build());
|
||||
}
|
||||
builder.setForce(HeroLogic.getInstance().calForce(robotHeroAttribute));
|
||||
if(teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE){
|
||||
if(teamId==TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()){
|
||||
builder.setHero(sArenaRobotConfig.getHeroMapList().get(scHero.getId()));
|
||||
}else if(teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO){
|
||||
}else if(teamId==TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()){
|
||||
builder.setHero(sArenaRobotConfig.getHeroMapList2().get(scHero.getId()));
|
||||
}
|
||||
else if(teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){
|
||||
else if(teamId==TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
builder.setHero(sArenaRobotConfig.getHeroMapList3().get(scHero.getId()));
|
||||
}else {
|
||||
builder.setHero(sArenaRobotConfig.getHeroMapList().get(scHero.getId()));
|
||||
|
|
|
@ -1,39 +1,31 @@
|
|||
package com.ljsd.jieling.logic.rank;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.GlobalidHelper;
|
||||
import com.ljsd.jieling.network.server.WorldHelper;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SExpeditionSetting;
|
||||
import config.SSpecialConfig;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SSpecialConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import rpc.world.WorldProto;
|
||||
import util.MathUtils;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -175,7 +167,7 @@ public class RankLogic {
|
|||
if (user == null){
|
||||
return integers;
|
||||
}
|
||||
List<TeamPosHeroInfo> heroInfos = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.FORMATION_NORMAL);
|
||||
List<TeamPosHeroInfo> heroInfos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
heroInfos.forEach(v->{
|
||||
// 获取英雄模板id
|
||||
Hero hero = user.getHeroManager().getHero(v.getHeroId());
|
||||
|
|
|
@ -267,13 +267,12 @@ public abstract class AbstractRank implements IRank {
|
|||
public CommonProto.UserRank.Builder getCrossOneUserRank(CSPlayer csPlayer, CommonProto.RankInfo.Builder everyRankInfo){
|
||||
String serverName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
GuildCache mapEntry = CrossDeathPathLogic.getCrossGuild(csPlayer.getGuildId());
|
||||
long force = CrossServiceLogic.getCrossTeamForce(csPlayer.getUserId(), TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
return CommonProto.UserRank.newBuilder()
|
||||
.setUid(csPlayer.getUserId())
|
||||
.setLevel(csPlayer.getLevel())
|
||||
.setUserName(csPlayer.getName())
|
||||
.setRankInfo(everyRankInfo)
|
||||
.setForce((int) force)
|
||||
.setForce(csPlayer.getMainLineForce())
|
||||
.setSex(csPlayer.getSex())
|
||||
.setHead(csPlayer.getHead())
|
||||
.setGuildName(Optional.ofNullable(mapEntry).map(GuildCache::getName).orElse(""))
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
|
@ -77,10 +76,9 @@ public class CrossArenaRank extends AbstractRank {
|
|||
if (query == null){
|
||||
return;
|
||||
}
|
||||
long teamForce = CrossServiceLogic.getCrossTeamForce(query.getUserId(), TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId());
|
||||
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
|
||||
.setRank(index)
|
||||
.setParam1(teamForce)
|
||||
.setParam1(query.getLuoFuForce())
|
||||
.setParam2(getParam2(data.getScore()))
|
||||
.setParam3(getParam3(data.getScore()));
|
||||
CommonProto.UserRank.Builder everyRank = getCrossOneUserRank(query,everyRankInfo);
|
||||
|
@ -91,8 +89,7 @@ public class CrossArenaRank extends AbstractRank {
|
|||
@Override
|
||||
public CommonProto.UserRank.Builder getCrossOneUserRank(CSPlayer csPlayer, CommonProto.RankInfo.Builder everyRankInfo){
|
||||
CommonProto.UserRank.Builder oneUserRank = super.getCrossOneUserRank(csPlayer, everyRankInfo);
|
||||
long force = CrossServiceLogic.getCrossTeamForce(csPlayer.getUserId(), TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId());
|
||||
oneUserRank.setForce((int) force);
|
||||
oneUserRank.setForce(csPlayer.getLuoFuForce());
|
||||
return oneUserRank;
|
||||
}
|
||||
|
||||
|
@ -101,7 +98,7 @@ public class CrossArenaRank extends AbstractRank {
|
|||
String crossGroup = String.valueOf(GlobleSystemLogic.getInstence().getCrossGroup());
|
||||
int myRank= RedisUtil.getInstence().getZSetreverseRank(redisKey, crossGroup,Integer.toString(user.getId()),false).intValue();
|
||||
Double zSetScore = RedisUtil.getInstence().getZSetScore(redisKey, crossGroup, Integer.toString(user.getId()),false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId(),false);
|
||||
CommonProto.RankInfo towerRankInfo = CommonProto.RankInfo.newBuilder()
|
||||
.setRank(myRank)
|
||||
.setParam1(totalForce)
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.logic.GlobleSystemLogic;
|
|||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.dao.CrossArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -115,7 +116,7 @@ public class CrossYuXuLunDaoRank extends AbstractRank{
|
|||
String crossGroup = String.valueOf(GlobleSystemLogic.getInstence().getCrossGroup());
|
||||
int myRank= RedisUtil.getInstence().getZSetreverseRank(redisKey, crossGroup,Integer.toString(user.getId()),false).intValue();
|
||||
Double zSetScore = RedisUtil.getInstence().getZSetScore(redisKey, crossGroup, Integer.toString(user.getId()),false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,false);
|
||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.WORLD_TEAM_ARENA_DEFENSE.getTeamId(),false);
|
||||
CommonProto.RankInfo towerRankInfo = CommonProto.RankInfo.newBuilder()
|
||||
.setRank(myRank)
|
||||
.setParam1(totalForce)
|
||||
|
|
Loading…
Reference in New Issue