编队战力修改
parent
cda5c9121b
commit
ddf2daacc7
|
@ -197,10 +197,7 @@ public class StringUtil {
|
|||
}
|
||||
|
||||
public static boolean isEmpty(String source){
|
||||
if( source == null || source.isEmpty()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return source == null || source.isEmpty();
|
||||
}
|
||||
|
||||
public static String parseArrayToString(int[][] source) {
|
||||
|
|
|
@ -30,6 +30,6 @@ public class MongoPropertyConverter implements Converter<BasicDBObject, Property
|
|||
break;
|
||||
}
|
||||
String realJson = source.toJson(jsonWriterSettings);
|
||||
return JSON.parseObject(realJson,target);
|
||||
return JSON.parseObject(realJson, target);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class MongoUtil {
|
|||
Set<Integer> set = OnlineUserManager.sessionMap.keySet();
|
||||
Integer[] integers = set.toArray(new Integer[0]);
|
||||
Set<Integer> ids = new HashSet<>();
|
||||
if (set.size() == 0) {
|
||||
if (set.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Random random = new Random();
|
||||
|
|
|
@ -85,7 +85,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
|||
}
|
||||
|
||||
// 战斗逻辑
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.MIAN_LINE_TEAM.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.ljsd.jieling.logic.dao.*;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
|
@ -51,7 +52,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(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.MIAN_LINE_TEAM.getTeamId(), 20, "", GameFightType.NewGeneral, monsterGroupId, 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
@ -126,7 +127,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
double score = rank.getScoreById(uid, String.valueOf(proto.getActivityId()));
|
||||
if(score==-1||score<lessBlood){
|
||||
List<TeamPosHeroInfo> teamPosForHero = user.getTeamPosManager().getTeamPosForHero().get(1);
|
||||
if(teamPosForHero!=null&&teamPosForHero.size()>0){
|
||||
if(teamPosForHero!=null&& !teamPosForHero.isEmpty()){
|
||||
Map<Integer, TaSuiHero> heroMap = new HashMap<>();
|
||||
for(TeamPosHeroInfo hero:teamPosForHero){
|
||||
Hero myHero = user.getHeroManager().getHero(hero.getHeroId());
|
||||
|
@ -134,7 +135,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
heroMap.put(hero.getPosition(),taSuiHero);
|
||||
}
|
||||
user.getHeroManager().setTaSuiHeroMap(heroMap);
|
||||
long teamForce = user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
long teamForce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
user.getHeroManager().setTaSuiLingXiaoRankForce(teamForce);
|
||||
}
|
||||
rank.addRank(uid,String.valueOf(proto.getActivityId()),lessBlood);
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
|
@ -106,7 +107,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
arenaRecord.setDefUid(defUid);
|
||||
//自己每个队伍的战力
|
||||
for(int team : teamId){
|
||||
long teamForce = user.getTeamPosManager().getTeamForce(team);
|
||||
long teamForce = HeroLogic.getInstance().calTeamTotalForce(user, team);
|
||||
arenaRecord.getYxldMyForce().add(teamForce);
|
||||
}
|
||||
result = getFightResultByPersonToPerson(user, defUid, yuxuTeamId.stream().mapToInt(Integer::intValue).toArray(), teamId.stream().mapToInt(Integer::intValue).toArray(), arenaRecord, res);
|
||||
|
@ -297,9 +298,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
newResult[i] = result[i] ^ 1;
|
||||
}
|
||||
arenaRecord.setYxldResult(newResult);
|
||||
long myforce = user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId())
|
||||
+ user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId())
|
||||
+ user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
long myforce = myQuery.getYuxuForce();
|
||||
//总战斗力
|
||||
arenaRecord.setAttackForce(myforce);
|
||||
String key = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(defUid));
|
||||
|
@ -406,7 +405,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
return result;
|
||||
}
|
||||
|
||||
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result,CSPlayer csPlayer, ArenaRecord arenaRecord) {
|
||||
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result, CSPlayer csPlayer, ArenaRecord arenaRecord) {
|
||||
//没有队伍时候 直接断定对方赢
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).isEmpty()){
|
||||
|
@ -425,7 +424,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
arenaRecord.setYxldFightData3(snapRecord);
|
||||
}
|
||||
User defuser = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
|
||||
long addforce = defuser.getTeamPosManager().getTeamForce(myteamId[i]);
|
||||
long addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i]);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
return false;
|
||||
}
|
||||
|
@ -453,8 +452,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
continue;
|
||||
}
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.getYxldRobotFightTeamInfo(sArenaRobotConfig, i + 1);
|
||||
//HeroLogic.getInstance().calTeamTotalForce(user, team, false)
|
||||
long myforce = myUser.getTeamPosManager().getTeamForce(myteamId[i]);
|
||||
long myforce = HeroLogic.getInstance().calTeamTotalForce(myUser, myteamId[i]);
|
||||
long defforce = 0;
|
||||
if(defTeamId[i] == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()){
|
||||
defforce =sArenaRobotConfig.getYxldTotalForce1();
|
||||
|
|
|
@ -100,8 +100,8 @@ public class CrossYuxulundaoGetInfoHandler extends BaseHandler<ArenaInfoProto.Cr
|
|||
//主线编队复制到第一队伍
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = teamPosManager.getTeamPosForHero();
|
||||
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()));
|
||||
if(teamPosForHero.containsKey(TeamEnum.MIAN_LINE_TEAM.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.MIAN_LINE_TEAM.getTeamId()));
|
||||
}
|
||||
builder.setIsFirst(true);
|
||||
isNeedUpdate = true;
|
||||
|
|
|
@ -104,7 +104,7 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explore
|
|||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), null, null);
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makePersonFightData(user, TeamEnum.FORMATION_NORMAL.getTeamId(), null, null);
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makePersonFightData(user, TeamEnum.MIAN_LINE_TEAM.getTeamId(), null, null);
|
||||
long myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId());
|
||||
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid,
|
||||
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce < csPlayer.getMainLineForce(), FightType.ExploreXinMo);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerIn
|
|||
user.getPlayerInfoManager().setExploreEventMatchDefUid(matchUid);
|
||||
List<Integer> team = new ArrayList<>();
|
||||
//new ArrayList<Integer>(TeamEnum.FORMATION_NORMAL.getTeamId())
|
||||
team.add(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
team.add(TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
builder.setDefTeamInfo( PlayerLogic.getInstance().getCrossYxldOneTeamInfo(matchUid,team));
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerXMEventChallengeBeforeResponse.getNumber(), builder.build(), true);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,6 @@ import rpc.protocols.MessageTypeProto;
|
|||
/**
|
||||
* @Author hj
|
||||
* @Description 修行玩法,升级
|
||||
* @Date $ $
|
||||
* @Param $
|
||||
* @return $
|
||||
**/
|
||||
@Component
|
||||
public class UpPracticeLevelHandler extends BaseHandler<HeroInfoProto.UpPracticeLevelRequest> {
|
||||
|
|
|
@ -530,7 +530,7 @@ public class JourneyMap {
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(session.getUid(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "", GameFightType.MapFastFight, monster.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(session.getUid(), TeamEnum.MIAN_LINE_TEAM.getTeamId(), 20, "", GameFightType.MapFastFight, monster.getMonsterId(), 3);
|
||||
|
||||
Map<Integer, Long> remainHp = monster.getRemainHp();
|
||||
List<Long> hps = new ArrayList<>(remainHp.values());
|
||||
|
|
|
@ -2740,7 +2740,7 @@ public class MapLogic {
|
|||
}
|
||||
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.MIAN_LINE_TEAM.getTeamId(), 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
|
|
|
@ -28,7 +28,7 @@ class HeroUpExpectRankActivity extends ExpectRankActivity {
|
|||
|
||||
User user = UserManager.getUser(((HeroUpStarEvent) event).getUid());
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if( null == activityMission){
|
||||
if(null == activityMission){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
|
@ -44,7 +44,6 @@ class HeroUpExpectRankActivity extends ExpectRankActivity {
|
|||
//更新进度
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(sessionByUid, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
* 计算主线编队装备评分
|
||||
*/
|
||||
private static int equipScoreCompute(User user){
|
||||
List<TeamPosHeroInfo> infos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
List<TeamPosHeroInfo> infos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
if (infos == null){
|
||||
return 0;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
* 计算主线编队魂印评分
|
||||
*/
|
||||
private static int soulSealScoreCompute(User user){
|
||||
List<TeamPosHeroInfo> infos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
List<TeamPosHeroInfo> infos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
if (infos == null){
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.logic.dao.PlayerManager;
|
|||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.tools.Utils;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -113,15 +114,15 @@ public class CrossServiceLogic {
|
|||
csPlayer.setOffLineTime(p.getOffLineTime());
|
||||
csPlayer.setMaxFore(p.getMaxForce());
|
||||
//玉虚三个队伍总战力
|
||||
long force1 = user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId());
|
||||
long force2 = user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId());
|
||||
long force3 = user.getTeamPosManager().getTeamForce(TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
long force1 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId());
|
||||
long force2 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId());
|
||||
long force3 = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId());
|
||||
csPlayer.setYuxuForce(force1+force2+force3);
|
||||
// 主线编队战力
|
||||
long mainLine = user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
long mainLine = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
csPlayer.setMainLineForce(mainLine);
|
||||
// 罗浮编队战力
|
||||
long luoFu = user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
long luoFu = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
csPlayer.setLuoFuForce(luoFu);
|
||||
return csPlayer;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@ public class SaveHeroForceEvent implements IEvent {
|
|||
}
|
||||
|
||||
public String getHeroId() {
|
||||
if (heroId == null){
|
||||
return "";
|
||||
}
|
||||
return heroId;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,12 @@ import com.ljsd.jieling.logic.activity.IEventHandler;
|
|||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
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;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:英雄战力存储
|
||||
|
@ -19,7 +18,6 @@ import java.util.List;
|
|||
* 2022/4/26 10:29:18
|
||||
*/
|
||||
public class SaveHeroForceEventHandler implements IEventHandler {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SaveHeroForceEventHandler.class);
|
||||
public SaveHeroForceEventHandler() {
|
||||
Poster.getPoster().listenEvent(this, SaveHeroForceEvent.class);
|
||||
}
|
||||
|
@ -30,35 +28,34 @@ public class SaveHeroForceEventHandler implements IEventHandler {
|
|||
return;
|
||||
}
|
||||
// 参数获取
|
||||
int uid = ((SaveHeroForceEvent) event).getUid();
|
||||
String heroId = ((SaveHeroForceEvent) event).getHeroId();
|
||||
// null兼容
|
||||
if (heroId == null){
|
||||
heroId = "";
|
||||
}
|
||||
SaveHeroForceEvent event1 = (SaveHeroForceEvent) event;
|
||||
int uid = event1.getUid();
|
||||
String heroId = event1.getHeroId();
|
||||
|
||||
// user
|
||||
User user = UserManager.getUser(uid);
|
||||
boolean isNeed = false;
|
||||
// 需要存储战力的编队
|
||||
List<Integer> saveForceTeamList = TeamEnum.getSaveForceTeamList();
|
||||
for (Integer teamId : saveForceTeamList) {
|
||||
// 英雄是否存在该编队中
|
||||
if ("".equals(heroId) || HeroLogic.getInstance().isInTeam(user,heroId,teamId)){
|
||||
// 跨服编队
|
||||
if (TeamEnum.isCrossTeam(teamId)) {
|
||||
isNeed = true;
|
||||
boolean isNeedUpdate = true;
|
||||
|
||||
if (!heroId.isEmpty()){
|
||||
isNeedUpdate = false;
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
for (Map.Entry<Integer, List<TeamPosHeroInfo>> entry : teamPosForHero.entrySet()) {
|
||||
// 跨服编队判断,包含主线编队
|
||||
if (!TeamEnum.isCrossTeam(entry.getKey())){
|
||||
continue;
|
||||
}
|
||||
if (teamId == TeamEnum.FORMATION_NORMAL.getTeamId()){
|
||||
// 主线战力
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||
for (TeamPosHeroInfo info : entry.getValue()) {
|
||||
if (info.getHeroId().equals(heroId)){
|
||||
isNeedUpdate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 重新计算战力,并更新
|
||||
long force = HeroLogic.getInstance().calTeamTotalForce(user, teamId);
|
||||
user.getTeamPosManager().putTeamForceMap(teamId,force);
|
||||
}
|
||||
}
|
||||
// 跨服战力更新
|
||||
if (isNeed){
|
||||
if (isNeedUpdate){
|
||||
// 主线战力更新
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||
// 跨服战力更新
|
||||
CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user);
|
||||
}
|
||||
// 开服冲榜
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Set;
|
|||
*/
|
||||
public class Baubles extends PropertyItem{
|
||||
|
||||
private String masterId;//主法宝id,用于庇佑
|
||||
private String masterId = "";//主法宝id,用于庇佑
|
||||
|
||||
private Set<String> blessList = new HashSet<>();//庇佑
|
||||
|
||||
|
|
|
@ -95,13 +95,10 @@ public class EquipManager extends MongoBase {
|
|||
|
||||
public List<Baubles> getBaublesList(){
|
||||
ArrayList<Baubles> list = new ArrayList<>();
|
||||
Map<Integer, SItem> itemMap = SItem.getsItemMap();
|
||||
for (PropertyItem item : equipMap.values()) {
|
||||
SItem sItem = itemMap.get(item.getEquipId());
|
||||
if (sItem == null || sItem.getItemType() != GlobalItemType.ESPECIAL_EQUIP){
|
||||
continue;
|
||||
if (item instanceof Baubles){
|
||||
list.add((Baubles) item);
|
||||
}
|
||||
list.add((Baubles) item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
|||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
import config.*;
|
||||
import config.SCHero;
|
||||
import config.SCHeroRankUpConfig;
|
||||
import config.SEndlessHeroProp;
|
||||
import config.SRobotProperty;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -20,12 +23,11 @@ import java.util.*;
|
|||
public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Hero.class);
|
||||
@Id
|
||||
private String id;
|
||||
private int templateId; //模板ID
|
||||
private int level;//等级
|
||||
private int star;
|
||||
private String bauBlesId;//法宝id
|
||||
private String bauBlesId = "";//法宝id
|
||||
private Map<Integer,Integer> equipByPositionMap = new HashMap<>();
|
||||
private Map<Integer,HeroEquipStrong> equipStrongMap = new HashMap<>(4);// 装备位置强化信息
|
||||
private int equipAdvanceLv;// 英雄装备突破等级
|
||||
|
|
|
@ -4,11 +4,9 @@ import com.ljsd.common.mogodb.MongoBase;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
public class PropertyItem extends MongoBase {
|
||||
|
||||
@Id
|
||||
private String id;// 唯一id
|
||||
private int equipId;// 道具id
|
||||
private int level;// 强化/等级
|
||||
|
@ -49,6 +47,9 @@ public class PropertyItem extends MongoBase {
|
|||
}
|
||||
|
||||
public String getHeroId() {
|
||||
if (heroId == null){
|
||||
return "";
|
||||
}
|
||||
return heroId;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
|
||||
public enum TeamEnum {
|
||||
FORMATION_NORMAL(1,"主线编队",1,1,1),
|
||||
MIAN_LINE_TEAM(1,"主线编队",1,1,1),
|
||||
TEAM_ARENA_DEFENSE(101,"竞技场防御编队",0,1),
|
||||
TEAM_ARENA_ATTACH(201,"竞技场进攻编队(暂时不用)"),
|
||||
TRIAL_TEAM(301,"森罗环境编队"),
|
||||
|
|
|
@ -12,12 +12,6 @@ public class TeamPosManager extends MongoBase {
|
|||
|
||||
private Map<Integer, List<TeamPosHeroInfo>> teamPosForHero;
|
||||
private Map<Integer,String> teamNames;
|
||||
/**
|
||||
* 队伍战力存储
|
||||
*/
|
||||
private Map<Integer,Long> teamForceMap = new HashMap<>();
|
||||
@Transient
|
||||
private int curTeamPosId;
|
||||
@Transient
|
||||
private Map<Integer,int[][]> cacheTeamPro = new HashMap<>(6);
|
||||
@Transient
|
||||
|
@ -25,16 +19,10 @@ public class TeamPosManager extends MongoBase {
|
|||
|
||||
public TeamPosManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
||||
teamNames = new HashMap<>(3);
|
||||
teamPosForHero = new HashMap<>(3);
|
||||
}
|
||||
|
||||
public void changeName(int teamId,String teamName) {
|
||||
teamNames.put(teamId,teamName);
|
||||
updateString("teamNames",teamNames);
|
||||
}
|
||||
|
||||
public void changeTeamInfo(int teamId, List<CommonProto.TeamHeroInfo> heroIds) {
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = new ArrayList<>(5);
|
||||
for(CommonProto.TeamHeroInfo teamHeroInfo : heroIds){
|
||||
|
@ -67,32 +55,27 @@ public class TeamPosManager extends MongoBase {
|
|||
return teamNames;
|
||||
}
|
||||
|
||||
public void putTeamName(int teamId, String name) {
|
||||
this.teamNames.put(teamId, name);
|
||||
updateString("teamNames",teamNames);
|
||||
}
|
||||
|
||||
public void setTeamNames(Map<Integer, String> teamNames) {
|
||||
this.teamNames = teamNames;
|
||||
updateString("teamNames",teamNames);
|
||||
}
|
||||
|
||||
public Map<Integer, List<TeamPosHeroInfo>> getTeamPosForHero() {
|
||||
return teamPosForHero;
|
||||
}
|
||||
|
||||
public int getCurTeamPosId() {
|
||||
return curTeamPosId;
|
||||
}
|
||||
|
||||
public void setCurTeamPosId(int curTeamPosId) {
|
||||
this.curTeamPosId = curTeamPosId;
|
||||
//缓存失效
|
||||
cachePassskill.remove(curTeamPosId);
|
||||
cacheTeamPro.put(curTeamPosId,null);
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getTeamForceMap() {
|
||||
return teamForceMap;
|
||||
}
|
||||
|
||||
public long getTeamForce(int teamId) {
|
||||
return teamForceMap.getOrDefault(teamId, 0L);
|
||||
}
|
||||
|
||||
public void putTeamForceMap(int teamId,long force) {
|
||||
teamForceMap.put(teamId,force);
|
||||
updateString("teamForceMap", teamForceMap);
|
||||
}
|
||||
|
||||
public Map<Integer, int[][]> getCacheTeamPro() {
|
||||
|
@ -157,4 +140,17 @@ public class TeamPosManager extends MongoBase {
|
|||
updateString("teamPosForHero."+teamId,teamPosHeroInfos);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTeamPosForHero(Map<Integer, List<TeamPosHeroInfo>> teamPosForHero) {
|
||||
this.teamPosForHero = teamPosForHero;
|
||||
updateString("teamPosForHero",teamPosForHero);
|
||||
}
|
||||
|
||||
public void setCacheTeamPro(Map<Integer, int[][]> cacheTeamPro) {
|
||||
this.cacheTeamPro = cacheTeamPro;
|
||||
}
|
||||
|
||||
public void setCachePassskill(Map<Integer, List<Integer>> cachePassskill) {
|
||||
this.cachePassskill = cachePassskill;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -734,16 +734,16 @@ public class EquipLogic {
|
|||
else {
|
||||
// 穿戴-替换
|
||||
Baubles baubles = equipManager.getBaubles(baublesId);
|
||||
if (baubles == null || !baubles.getMasterId().isEmpty()){
|
||||
if (baubles == null || !StringUtil.isEmpty(baubles.getMasterId())){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝不存在或者处于庇佑状态");
|
||||
}
|
||||
String baublesHeroId = baubles.getHeroId();
|
||||
if (!baublesHeroId.isEmpty()){
|
||||
if (!StringUtil.isEmpty(baublesHeroId)){
|
||||
Hero hero1 = heroManager.getHero(baublesHeroId);
|
||||
hero1.setBauBlesId("");
|
||||
}
|
||||
String heroBauBlesId = hero.getBauBlesId();
|
||||
if (!heroBauBlesId.isEmpty()){
|
||||
if (!StringUtil.isEmpty(heroBauBlesId)){
|
||||
Baubles baubles1 = equipManager.getBaubles(heroBauBlesId);
|
||||
baubles1.setHeroId("");
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ public class EquipLogic {
|
|||
if (baubles == null || blessBaubles == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝不存在");
|
||||
}
|
||||
if (!baubles.getMasterId().isEmpty() || !blessBaubles.getMasterId().isEmpty()){
|
||||
if (!StringUtil.isEmpty(baubles.getMasterId()) || !StringUtil.isEmpty(blessBaubles.getMasterId())){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝存在已庇佑情况");
|
||||
}
|
||||
int number = SSpecialConfig.getIntegerValue("Huyou_Number");
|
||||
|
|
|
@ -48,10 +48,6 @@ public class BattleNode extends AbstractExpedition {
|
|||
|
||||
/**
|
||||
* 节点战斗信息
|
||||
* @param user
|
||||
* @param leve
|
||||
* @param nodeInfo
|
||||
* @throws Exception
|
||||
*/
|
||||
private void nodeFightInfo(User user, int leve, ExpeditionNodeInfo nodeInfo) throws Exception {
|
||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||
|
|
|
@ -147,14 +147,14 @@ public class GuildFightLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(501);
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.size()<1){
|
||||
if(teamPosHeroInfos==null || teamPosHeroInfos.isEmpty()){
|
||||
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
|
||||
}
|
||||
for(TeamPosHeroInfo heroInfo:teamPosHeroInfos){
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
oneInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
}
|
||||
long force = user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
long force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
oneInfo.setTotalForce(force);
|
||||
// if (teamPosManager.getTeamPosForPoken().get(1) != null && teamPosManager.getTeamPosForPoken().get(1).size() > 0) {
|
||||
// for (TeamPosForPokenInfo posForPokenInfo : teamPosManager.getTeamPosForPoken().get(1)) {
|
||||
|
@ -325,14 +325,14 @@ public class GuildFightLogic {
|
|||
int[] buffInfo = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_BUFF, gid.toString(), entry.getValue().toString(), int[].class);
|
||||
FamilyFightInfo fightInfo = new FamilyFightInfo();
|
||||
//血量处理,buff处理
|
||||
long force = user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
long force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
Map<String, FamilyHeroInfo> heroAllAttribute = BloodLogic.getInstance().battleRecord(user, 501, buffInfo);
|
||||
fightInfo.setHeroAttribute(heroAllAttribute);
|
||||
fightInfo.setBuildId(entry.getValue());
|
||||
fightInfo.setStarCount(guildSetting.getStarNum()[memberType-1]);
|
||||
fightInfo.setForce(force);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(501);
|
||||
if(teamPosHeroInfoList==null||teamPosHeroInfoList.size()<1){
|
||||
if(teamPosHeroInfoList == null || teamPosHeroInfoList.isEmpty()){
|
||||
teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(1);
|
||||
}
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.ljsd.jieling.logic.fight.robot.RobotInfo;
|
|||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.*;
|
||||
|
@ -592,16 +591,15 @@ public class FightUtil {
|
|||
}
|
||||
|
||||
|
||||
//TODO 规范这个参数
|
||||
public static CommonProto.FightTeamInfo makeCrossPersonData(CSPlayer csPlayer, int teamId, ArenaRecord arenaRecord) {
|
||||
if (csPlayer == null) {
|
||||
return null;//throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
return null;
|
||||
}
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
User userByRpc = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = userByRpc.getTeamPosManager().getTeamPosForHero().getOrDefault(teamId, new ArrayList<>());
|
||||
long addforce = userByRpc.getTeamPosManager().getTeamForce(teamId);
|
||||
if(arenaRecord != null){
|
||||
long addforce = HeroLogic.getInstance().calTeamTotalForce(userByRpc, teamId);
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}
|
||||
|
@ -637,7 +635,7 @@ public class FightUtil {
|
|||
public static CommonProto.FightTeamInfo getYuxuTeam(User user, int teamId, Map<String, Integer> attackBloodMap,ArenaRecord arenaRecord) {
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
if(arenaRecord != null){
|
||||
long addforce = user.getTeamPosManager().getTeamForce(teamId);
|
||||
long addforce = HeroLogic.getInstance().calTeamTotalForce(user, teamId);
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}
|
||||
|
@ -681,60 +679,60 @@ public class FightUtil {
|
|||
/**
|
||||
* 获取跨服玉虚论道战斗
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getCrossYuxuTeam(CrossArenaManager crossArenaManager,
|
||||
int teamId, Map<String, Integer> attackBloodMap, ArenaRecord arenaRecord) {
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
if(arenaRecord != null){
|
||||
long addforcerpc = crossArenaManager.getTotalForceByTeam().getOrDefault(teamId,0L);
|
||||
arenaRecord.getYxldDefForce().add(addforcerpc);
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforcerpc);
|
||||
}
|
||||
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().getOrDefault(teamId, new ArrayList<>());
|
||||
for (com.ljsd.jieling.thrift.idl.TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero hero = crossArenaManager.getHeros().get(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null){
|
||||
continue;
|
||||
}
|
||||
//玉虚英雄取通用属性
|
||||
Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
|
||||
if(yuxuHero == null){
|
||||
continue;
|
||||
}
|
||||
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
|
||||
SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
|
||||
Map<Integer, Long> heroAttributeMap = new HashMap<>();
|
||||
for (int[] prop : sEndlessHeroProp.getProps()) {
|
||||
heroAttributeMap.put(prop[0], (long) prop[1]);
|
||||
}
|
||||
if (attackBloodMap != null && attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())) {
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) - attackBloodMap.get(teamPosHeroInfo.getHeroId()) * heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) / 100);
|
||||
}
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(GlobalsDef.HP_TYPE));
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getCrossYuxuHeroSkills(hero,yuxuHero).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(stringBuilder, hero.getPropertyId(), yuxuHero.getYuXuLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0, heroSkill.length() - 1))
|
||||
.setProperty(property.substring(0, property.length() - 1))
|
||||
.setStar(yuxuHero.getStar())
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(yuxuHero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.addAllPokemonUnitList(new ArrayList<>())
|
||||
.setTeamPassiveList("")
|
||||
.setSpecialPassive("")
|
||||
.setForceScore(crossArenaManager.getMaxHistoryForce())
|
||||
.build();
|
||||
}
|
||||
// public static CommonProto.FightTeamInfo getCrossYuxuTeam(CrossArenaManager crossArenaManager,
|
||||
// int teamId, Map<String, Integer> attackBloodMap, ArenaRecord arenaRecord) {
|
||||
// List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
// if(arenaRecord != null){
|
||||
// long addforcerpc = crossArenaManager.getTotalForceByTeam().getOrDefault(teamId,0L);
|
||||
// arenaRecord.getYxldDefForce().add(addforcerpc);
|
||||
// arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforcerpc);
|
||||
// }
|
||||
// List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().getOrDefault(teamId, new ArrayList<>());
|
||||
// for (com.ljsd.jieling.thrift.idl.TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
// com.ljsd.jieling.thrift.idl.ArenaOfHero hero = crossArenaManager.getHeros().get(teamPosHeroInfo.getHeroId());
|
||||
// if (hero == null){
|
||||
// continue;
|
||||
// }
|
||||
// //玉虚英雄取通用属性
|
||||
// Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
|
||||
// if(yuxuHero == null){
|
||||
// continue;
|
||||
// }
|
||||
// Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
|
||||
// SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
|
||||
// Map<Integer, Long> heroAttributeMap = new HashMap<>();
|
||||
// for (int[] prop : sEndlessHeroProp.getProps()) {
|
||||
// heroAttributeMap.put(prop[0], (long) prop[1]);
|
||||
// }
|
||||
// if (attackBloodMap != null && attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())) {
|
||||
// heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) - attackBloodMap.get(teamPosHeroInfo.getHeroId()) * heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) / 100);
|
||||
// }
|
||||
// heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(GlobalsDef.HP_TYPE));
|
||||
// StringBuilder stringBuilder = new StringBuilder();
|
||||
// String heroSkill = HeroLogic.getInstance().getCrossYuxuHeroSkills(hero,yuxuHero).toString();
|
||||
// String property = HeroLogic.getInstance().getHeroPropertyBuilder(stringBuilder, hero.getPropertyId(), yuxuHero.getYuXuLevel(), heroAttributeMap).toString();
|
||||
// CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
// .newBuilder()
|
||||
// .setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
// .setUnitSkillIds(heroSkill.substring(0, heroSkill.length() - 1))
|
||||
// .setProperty(property.substring(0, property.length() - 1))
|
||||
// .setStar(yuxuHero.getStar())
|
||||
// .setPosition(teamPosHeroInfo.getPosition())
|
||||
// .setSkinId(hero.getSkin())
|
||||
// .setGodSoulLv(yuxuHero.getGodSoulLv())
|
||||
// .setPropertyId(hero.getPropertyId())
|
||||
// .build();
|
||||
// heroFightInfos.add(heroFightInfo);
|
||||
// }
|
||||
// return CommonProto.FightTeamInfo.
|
||||
// newBuilder()
|
||||
// .addAllFightUnitList(heroFightInfos)
|
||||
// .addAllPokemonUnitList(new ArrayList<>())
|
||||
// .setTeamPassiveList("")
|
||||
// .setSpecialPassive("")
|
||||
// .setForceScore(crossArenaManager.getMaxHistoryForce())
|
||||
// .build();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取玉虚论道跨服战斗数据
|
||||
|
|
|
@ -1045,11 +1045,6 @@ public class HeroLogic {
|
|||
for (Map.Entry<Integer, List<TeamPosHeroInfo>> item : teamPosForHero.entrySet()) {
|
||||
int teamId = item.getKey();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = item.getValue();
|
||||
// if(teamId==501){
|
||||
// if(teamPosHeroInfoList==null|teamPosHeroInfoList.size()<1){
|
||||
// teamPosHeroInfoList = teamPosForHero.get(1);
|
||||
// }
|
||||
// }
|
||||
String teamName = teamNames.get(teamId);
|
||||
if (StringUtil.isEmpty(teamName)) {
|
||||
teamName = "";
|
||||
|
@ -1063,7 +1058,7 @@ public class HeroLogic {
|
|||
teamPosInfoList.add(
|
||||
CommonProto.TeamPosInfo.newBuilder()
|
||||
.addAllTeamHeroInfos(teamHeroInfoList)
|
||||
.setTeamName(teamName)
|
||||
.setTeamName("")
|
||||
.setTeamId(teamId)
|
||||
.build()
|
||||
);
|
||||
|
@ -1969,21 +1964,23 @@ public class HeroLogic {
|
|||
|
||||
//法宝技能
|
||||
Baubles baubles = heroVo.getBaubles();
|
||||
SEquipTalismana equipTalismana = SEquipTalismana.equipTalismanaStarMap.get(baubles.getEquipId()).get(baubles.getLevel());
|
||||
// 基础技能
|
||||
for (int skillRule : equipTalismana.getOpenSkillRules()) {
|
||||
skillList.add(skillRule);
|
||||
}
|
||||
// 职业专属技能
|
||||
for (int[] jobSkill : equipTalismana.getJobSkill()) {
|
||||
if (jobSkill[0] == tempHero.getJob()){
|
||||
skillList.add(jobSkill[1]);
|
||||
if (baubles != null){
|
||||
SEquipTalismana equipTalismana = SEquipTalismana.equipTalismanaStarMap.get(baubles.getEquipId()).get(baubles.getLevel());
|
||||
// 基础技能
|
||||
for (int skillRule : equipTalismana.getOpenSkillRules()) {
|
||||
skillList.add(skillRule);
|
||||
}
|
||||
}
|
||||
// 英雄专属技能
|
||||
for (int[] heroSkill : equipTalismana.getHeroSkill()) {
|
||||
if (heroSkill[0] == tempHero.getId()){
|
||||
skillList.add(heroSkill[1]);
|
||||
// 职业专属技能
|
||||
for (int[] jobSkill : equipTalismana.getJobSkill()) {
|
||||
if (jobSkill[0] == tempHero.getJob()){
|
||||
skillList.add(jobSkill[1]);
|
||||
}
|
||||
}
|
||||
// 英雄专属技能
|
||||
for (int[] heroSkill : equipTalismana.getHeroSkill()) {
|
||||
if (heroSkill[0] == tempHero.getId()){
|
||||
skillList.add(heroSkill[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3706,6 +3703,7 @@ public class HeroLogic {
|
|||
* 计算队伍战力
|
||||
*/
|
||||
public long calTeamTotalForce(User targetUser, int teamId) {
|
||||
long now = TimeUtils.now();
|
||||
long totalForce = 0;
|
||||
targetUser.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = targetUser.getTeamPosManager().getTeamPosForHero();
|
||||
|
@ -3746,7 +3744,7 @@ public class HeroLogic {
|
|||
totalForce+=playerSkill.getFight();
|
||||
}
|
||||
}
|
||||
LOGGER.info("calTeamTotalForce uid={} 总战力={}", targetUser.getId(), totalForce);
|
||||
LOGGER.info("calTeamTotalForce uid={} 总战力={} 耗时={}", targetUser.getId(), totalForce, TimeUtils.now()-now);
|
||||
return totalForce;
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ public class PlayerLogic {
|
|||
if (!teamPosManager.getTeamNames().containsKey(teamPosId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
teamPosManager.getTeamNames().put(teamPosId,name);
|
||||
teamPosManager.putTeamName(teamPosId,name);
|
||||
}
|
||||
if(type==3){
|
||||
//检查下
|
||||
|
@ -801,7 +801,7 @@ public class PlayerLogic {
|
|||
// teamOneTeamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon, entry.getKey()));
|
||||
// }
|
||||
//LOGGER.info("=====================跨服获取阵容:{}",teamId);
|
||||
long integer = teamPosManager.getTeamForce(teamId);
|
||||
long integer = HeroLogic.getInstance().calTeamTotalForce(user, teamId);
|
||||
teamOneTeamInfo.setTotalForce(integer);
|
||||
|
||||
// for(Map.Entry<Integer, PurpleMansionSeal> entry:user.getHeroManager().getPurpleMansionSeal().entrySet()){
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.ljsd.jieling.logic.rank;
|
||||
|
||||
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.globals.BIReason;
|
||||
|
@ -50,8 +48,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 获取单例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static RankLogic getInstance() {
|
||||
return Instance.instance;
|
||||
|
@ -82,11 +78,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 获取排行榜信息
|
||||
* @param user
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private PlayerInfoProto.RankResponse getRankInfo(User user,int start,int end) throws Exception{
|
||||
// 上次存储时间+一小时
|
||||
|
@ -114,9 +105,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 获取随机排名的用户id
|
||||
* @param user
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<List<Integer>> getRandomUserByRank(User user,int counts) throws Exception {
|
||||
List<List<Integer>> result = new ArrayList<>();
|
||||
|
@ -160,16 +148,13 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 根据用户id获取队伍
|
||||
* @param user
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private List<Integer> getTeamByUid(User user){
|
||||
ArrayList<Integer> integers = new ArrayList<>();
|
||||
if (user == null){
|
||||
return integers;
|
||||
}
|
||||
List<TeamPosHeroInfo> heroInfos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.FORMATION_NORMAL.getTeamId());
|
||||
List<TeamPosHeroInfo> heroInfos = user.getTeamPosManager().getTeamPosForHero().get(TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
heroInfos.forEach(v->{
|
||||
// 获取英雄模板id
|
||||
Hero hero = user.getHeroManager().getHero(v.getHeroId());
|
||||
|
@ -180,10 +165,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 根据排行获取排行榜玩家id
|
||||
* @param rankResponse
|
||||
* @param ranking
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private User getRankUid(PlayerInfoProto.RankResponse rankResponse, int ranking){
|
||||
CommonProto.UserRank ranks = rankResponse.getRanks(ranking);
|
||||
|
@ -192,10 +173,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 获取每个排行第一名信息
|
||||
* @param session
|
||||
* @param rankTypes
|
||||
* @param messageType
|
||||
* @throws Exception
|
||||
*/
|
||||
public void getRankFirstInfo(ISession session, List<Integer> rankTypes,List<Integer> activityId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
PlayerManager playerManager = UserManager.getUser(session.getUid()).getPlayerInfoManager();
|
||||
|
@ -220,9 +197,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 膜拜
|
||||
* @param session
|
||||
* @param type
|
||||
* @param messageType
|
||||
*/
|
||||
public void rankProud(ISession session, int type,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -239,9 +213,6 @@ public class RankLogic {
|
|||
|
||||
/**
|
||||
* 根据value删除一条排行
|
||||
* @param type
|
||||
* @param rkey
|
||||
* @param value
|
||||
*/
|
||||
public void removeOneRankByPiece(int type,String rkey,String value){
|
||||
AbstractRank rank = RankContext.getRankEnum(type);
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.ljsd.jieling.logic.fight.CombatLogic;
|
|||
import com.ljsd.jieling.logic.help.HelpHero;
|
||||
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
||||
import com.ljsd.jieling.logic.help.HelpTypeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.home.HomeLogic;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
||||
|
@ -445,6 +446,7 @@ public class CBean2Proto {
|
|||
equipProto.setEquipId(equip.getEquipId());
|
||||
equipProto.setExp(equip.getLevel());
|
||||
equipProto.setRebuildLevel(equip.getBuildLevel());
|
||||
equipProto.setHeroId(equip.getHeroId());
|
||||
return equipProto.build();
|
||||
}
|
||||
|
||||
|
@ -797,7 +799,7 @@ public class CBean2Proto {
|
|||
|
||||
}
|
||||
|
||||
public static Family.FamilyUserInfo getFamilyUserInfo(User user,int position){
|
||||
public static Family.FamilyUserInfo getFamilyUserInfo(User user,int position){
|
||||
boolean online = OnlineUserManager.checkUidOnline(user.getId());
|
||||
int outTime = 0;
|
||||
if(!online){
|
||||
|
@ -807,6 +809,7 @@ public class CBean2Proto {
|
|||
for (Map.Entry<Integer, Integer> entry : user.getGuildMyInfo().getGuidHelpInfo().entrySet()) {
|
||||
helplist.add(CommonProto.GuildHelpInfo.newBuilder().setType(entry.getKey()).setHadtakenum(user.getGuildMyInfo().getGuidHelpHadTakeInfo().getOrDefault(entry.getKey(),0)).setNum(entry.getValue()).build());
|
||||
}
|
||||
long force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.MIAN_LINE_TEAM.getTeamId());
|
||||
return Family.FamilyUserInfo.newBuilder().setRoleUid(user.getId())
|
||||
.setUserName(user.getPlayerInfoManager().getNickName())
|
||||
.setUserLevel(user.getPlayerInfoManager().getLevel())
|
||||
|
@ -814,7 +817,7 @@ public class CBean2Proto {
|
|||
.setSeconds(outTime)
|
||||
.setPosition(position)
|
||||
.setContributeToday(0)
|
||||
.setSoulForce(user.getTeamPosManager().getTeamForce(TeamEnum.FORMATION_NORMAL.getTeamId()))
|
||||
.setSoulForce(force)
|
||||
.setHead(user.getPlayerInfoManager().getHead())
|
||||
.setFrame(user.getPlayerInfoManager().getHeadFrame())
|
||||
.setMaxBossHurt(user.getGuildMyInfo().getMaxBossHurt())
|
||||
|
|
|
@ -1272,8 +1272,13 @@ public class ItemUtil {
|
|||
|
||||
private static void addPropertyEquip(User user, int equipId, List<CommonProto.Equip> jewelList) {
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
PropertyItem equip = new PropertyItem(user.getId(), equipId);
|
||||
SItem item = SItem.getsItemMap().get(equipId);
|
||||
PropertyItem equip;
|
||||
if (item.getItemType() == GlobalItemType.ESPECIAL_EQUIP){
|
||||
equip = new Baubles(user.getId(), equipId);
|
||||
}else {
|
||||
equip = new PropertyItem(user.getId(), equipId);
|
||||
}
|
||||
equipManager.addEquip(equip);
|
||||
jewelList.add(CBean2Proto.getPropertyEquipProto(equip));
|
||||
// 走马灯
|
||||
|
|
|
@ -4,13 +4,13 @@ public class KeyGenUtils {
|
|||
//机器码
|
||||
private static String machineNum;
|
||||
|
||||
private static Object uuidLock = new Object();
|
||||
private static final Object uuidLock = new Object();
|
||||
private static Integer uuidIndex = 0;
|
||||
private static long uuidPreTimeStamp = 0;
|
||||
|
||||
public static String produceIdByModule(UUIDEnum uuidEnum, int userId){
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
stringBuffer.append(userId);
|
||||
stringBuffer.append(machineNum);
|
||||
if (uuidEnum.getValue()<=9){
|
||||
|
|
Loading…
Reference in New Issue