法宝初版,删除旧跨服英雄方法
parent
31b97ac40c
commit
85526fac97
|
|
@ -83,7 +83,7 @@ public class MongoConfig {
|
|||
|
||||
private CustomConversions customConversions() {
|
||||
List<Converter<?, ?>> converterList = new ArrayList<Converter<?, ?>>();
|
||||
// converterList.add(new MongoPropertyConverter());
|
||||
converterList.add(new MongoPropertyConverter());
|
||||
converterList.add(new MongoRechargeConverter());
|
||||
return new CustomConversions(converterList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,35 @@
|
|||
package com.ljsd.jieling.db.mongo;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.logic.dao.Baubles;
|
||||
import com.ljsd.jieling.logic.dao.PropertyItem;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import config.SItem;
|
||||
import org.bson.json.JsonWriterSettings;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.data.convert.ReadingConverter;
|
||||
|
||||
@Deprecated
|
||||
@SuppressWarnings("SwitchStatementWithTooFewBranches")
|
||||
@ReadingConverter
|
||||
public class MongoPropertyConverter implements Converter<BasicDBObject, PropertyItem> {
|
||||
private static JsonWriterSettings jsonWriterSettings = new JsonWriterSettings();
|
||||
private static final JsonWriterSettings jsonWriterSettings = new JsonWriterSettings();
|
||||
@Override
|
||||
public PropertyItem convert(BasicDBObject source) {
|
||||
if (!source.containsField("equipId")) {
|
||||
return null;
|
||||
}
|
||||
SItem item = SItem.getsItemMap().get(source.getInt("equipId"));
|
||||
Class<? extends PropertyItem> target;
|
||||
switch (item.getItemType()){
|
||||
case GlobalItemType.ESPECIAL_EQUIP:// 法宝
|
||||
target = Baubles.class;
|
||||
break;
|
||||
default:
|
||||
target = PropertyItem.class;
|
||||
break;
|
||||
}
|
||||
String realJson = source.toJson(jsonWriterSettings);
|
||||
PropertyItem propertyItem = JSON.parseObject(realJson,PropertyItem.class);
|
||||
return propertyItem;
|
||||
return JSON.parseObject(realJson,target);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,4 +447,6 @@ public interface BIReason {
|
|||
|
||||
int POTENTIAL_UP_LV_COST = 1335;//潜能升级消耗
|
||||
int POTENTIAL_LV_BACK = 1335;//潜能回退获得
|
||||
|
||||
int BAUBLES_STRENGETHEN = 1336;//法宝强化
|
||||
}
|
||||
|
|
@ -24,7 +24,6 @@ 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.session.ISession;
|
||||
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
|
|
@ -352,11 +351,6 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
if (csPlayer == null){
|
||||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}
|
||||
//其他服玩家rpc 数据调用
|
||||
CrossArenaManager crossArenaManager = null;
|
||||
if(GameApplication.serverId != csPlayer.getServerId()){
|
||||
crossArenaManager = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
|
||||
}
|
||||
String defServerName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
arenaRecord.setCreateTime(TimeUtils.nowInt()); // 时间
|
||||
arenaRecord.setAttackId(defUserUid); //id
|
||||
|
|
@ -368,12 +362,12 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
arenaRecord.setServerName(defServerName);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
//编队为空 判输赢
|
||||
if (!updateResult(myUser,i, myteamId, defTeamId, result,csPlayer,crossArenaManager,arenaRecord)) {
|
||||
if (!updateResult(myUser,i, myteamId, defTeamId, result,csPlayer,arenaRecord)) {
|
||||
continue;
|
||||
}
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(myUser, myteamId[i], null, null);
|
||||
//对手 修行等级 区服名称 战斗类行 积分变化情况
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeYuxuCrossPersonData(csPlayer, defTeamId[i], arenaRecord, crossArenaManager);
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeYuxuCrossPersonData(csPlayer, defTeamId[i], arenaRecord);
|
||||
|
||||
//根据战力判断先后手
|
||||
long myforce = 0,defforce = 0;
|
||||
|
|
@ -412,10 +406,10 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
return result;
|
||||
}
|
||||
|
||||
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result,CSPlayer csPlayer,CrossArenaManager crossArenaManager, ArenaRecord arenaRecord) throws Exception{
|
||||
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]).size() == 0){
|
||||
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).isEmpty()){
|
||||
result[i] = 0;
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, defTeamId[i], arenaRecord);
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder().addMonsterList(defteamInfo).build();
|
||||
|
|
@ -430,14 +424,9 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
if (i == 2) {
|
||||
arenaRecord.setYxldFightData3(snapRecord);
|
||||
}
|
||||
if (GameApplication.serverId == csPlayer.getServerId()) {
|
||||
User defuser = UserManager.getUser(csPlayer.getUserId());
|
||||
long addforce = defuser.getTeamPosManager().getTeamForce(myteamId[i]);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}else{
|
||||
long addforcerpc = crossArenaManager.getTotalForceByTeam().get(myteamId[i]);
|
||||
arenaRecord.getYxldDefForce().add(addforcerpc);
|
||||
}
|
||||
User defuser = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
|
||||
long addforce = defuser.getTeamPosManager().getTeamForce(myteamId[i]);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -445,7 +434,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
public static boolean updateResult(User user, int i, int[] myteamId, int[] result){
|
||||
//没有队伍时候 直接断定对方赢
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){
|
||||
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).isEmpty()){
|
||||
result[i] = 0;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.equip.EquipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
public class BaublesBlessHandler extends BaseHandler<HeroInfoProto.BaublesBlessRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.BaublesBlessRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.BaublesBlessRequest proto) throws Exception {
|
||||
EquipLogic.getInstance().baublesBless(iSession, proto);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.equip.EquipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
public class BaublesStrengthenHandler extends BaseHandler<HeroInfoProto.BaublesStrengthenRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.BaublesStrengthenRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.BaublesStrengthenRequest proto) throws Exception {
|
||||
EquipLogic.getInstance().baublesStrengthen(iSession, proto);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.equip.EquipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
public class BaublesWearHandler extends BaseHandler<HeroInfoProto.BaublesWearRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.BaublesWearRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.BaublesWearRequest proto) throws Exception {
|
||||
EquipLogic.getInstance().baublesWear(iSession, proto);
|
||||
}
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ public class ComplexJewelEquipRequestHandler extends BaseHandler<HeroInfoProto.C
|
|||
}
|
||||
|
||||
//生成装备 混合消耗
|
||||
PropertyItem equip = new PropertyItem(user.getId(),sTargetEquipStarsConfig.getId());
|
||||
PropertyItem equip = new PropertyItem(user.getId(), sTargetEquipStarsConfig.getId());
|
||||
user.getEquipManager().addEquip(equip);
|
||||
newids.add(equip.getId());//后面合成可能会被删除
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.equip.EquipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
public class QueryAllBaublesHandler extends BaseHandler<HeroInfoProto.BaublesAllInfoRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.BaublesAllInfoRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.BaublesAllInfoRequest proto) throws Exception {
|
||||
EquipLogic.getInstance().queryAllBaubles(iSession);
|
||||
}
|
||||
}
|
||||
|
|
@ -28,18 +28,20 @@ public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInf
|
|||
String heroId = proto.getHeroId();
|
||||
int teamId = proto.getTeamId();
|
||||
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse;
|
||||
if(proto.getServerId()==0){
|
||||
//非跨服功能的查看
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(proto.getTargetUid());
|
||||
if(sArenaRobotConfig != null){
|
||||
PlayerLogic.getInstance().viewRobotHeroInfo(iSession,sArenaRobotConfig, heroId, teamId);
|
||||
}else if(TeamEnum.isYuxuTeam(teamId)){
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse = PlayerLogic.getInstance().viewYuxuHeroInfo(proto.getTargetUid(), heroId);
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
}else {
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse = PlayerLogic.getInstance().viewHeroInfo(proto.getTargetUid(), heroId, 1);
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
viewHeroInfoResponse = PlayerLogic.getInstance().viewRobotHeroInfo(sArenaRobotConfig, heroId, teamId);
|
||||
}
|
||||
else if(TeamEnum.isYuxuTeam(teamId)){
|
||||
viewHeroInfoResponse = PlayerLogic.getInstance().viewYuxuHeroInfo(proto.getTargetUid(), heroId);
|
||||
}
|
||||
else {
|
||||
viewHeroInfoResponse = PlayerLogic.getInstance().viewHeroInfo(proto.getTargetUid(), heroId, 1);
|
||||
}
|
||||
|
||||
}else{
|
||||
if(proto.getServerId()!=1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
|
|
@ -47,24 +49,19 @@ public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInf
|
|||
//1 跨服功能的查看
|
||||
if(proto.getTargetUid()<1000){
|
||||
//机器人
|
||||
SArenaRobotConfig sArenaRobotConfig ;
|
||||
SArenaRobotConfig sArenaRobotConfig;
|
||||
if(TeamEnum.isYuxuTeam(teamId)){
|
||||
sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(proto.getTargetUid());
|
||||
}else{
|
||||
CrossArenaEnemy info = RedisUtil.getInstence().getMapEntry(RedisKey.CROSS_ARENA_ROBOT_INFO, String.valueOf(GlobleSystemLogic.getInstence().getCrossGroup()), String.valueOf(proto.getTargetUid()), CrossArenaEnemy.class);
|
||||
sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(info.getEnemyId());
|
||||
}
|
||||
PlayerLogic.getInstance().viewRobotHeroInfo(iSession,sArenaRobotConfig, heroId, teamId);
|
||||
viewHeroInfoResponse = PlayerLogic.getInstance().viewRobotHeroInfo(sArenaRobotConfig, heroId, teamId);
|
||||
}else{
|
||||
//真人
|
||||
if(TeamEnum.isYuxuTeam(teamId)){
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse = PlayerLogic.getInstance().viewCrossYuxuHeroInfo(proto.getTargetUid(), heroId);
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
}else {
|
||||
PlayerInfoProto.ViewHeroInfoResponse viewHeroInfoResponse = PlayerLogic.getInstance().viewHeroInfo(proto.getTargetUid(), heroId, teamId);
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
}
|
||||
viewHeroInfoResponse = PlayerLogic.getInstance().viewHeroInfo(proto.getTargetUid(), heroId, teamId);
|
||||
}
|
||||
}
|
||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE,viewHeroInfoResponse,true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 法宝
|
||||
*/
|
||||
public class Baubles extends PropertyItem{
|
||||
|
||||
private String masterId;//主法宝id,用于庇佑
|
||||
|
||||
private Set<String> blessList = new HashSet<>();//庇佑
|
||||
|
||||
public Baubles(int uid, int equipId) {
|
||||
super(uid, equipId);
|
||||
}
|
||||
|
||||
public String getMasterId() {
|
||||
return masterId;
|
||||
}
|
||||
|
||||
public void setMasterId(String masterId) {
|
||||
this.masterId = masterId;
|
||||
updateString("masterId", masterId);
|
||||
}
|
||||
|
||||
public Set<String> getBlessList() {
|
||||
return blessList;
|
||||
}
|
||||
|
||||
public void setBlessList(Set<String> blessList) {
|
||||
this.blessList = blessList;
|
||||
updateString("blessList", blessList);
|
||||
}
|
||||
|
||||
public void addBless(String baublesId) {
|
||||
this.blessList.add(baublesId);
|
||||
updateString("blessList", blessList);
|
||||
}
|
||||
}
|
||||
|
|
@ -93,10 +93,31 @@ public class EquipManager extends MongoBase {
|
|||
return list;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
list.add((Baubles) item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public PropertyItem getEquip(String equipId) {
|
||||
return equipMap.get(equipId);
|
||||
}
|
||||
|
||||
public Baubles getBaubles(String equipId) {
|
||||
PropertyItem item = equipMap.get(equipId);
|
||||
if (item == null){
|
||||
return null;
|
||||
}
|
||||
return (Baubles) item;
|
||||
}
|
||||
|
||||
public void loadFaxiang(String key,String heroId) {
|
||||
PropertyItem faxiang = getEquip(key);
|
||||
if (faxiang != null){
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
|
||||
public class Faxiang {
|
||||
private String id;
|
||||
|
||||
private String bindHeroId;
|
||||
private int itemId;
|
||||
private int strongLv;
|
||||
private int star;
|
||||
|
||||
public Faxiang() {
|
||||
}
|
||||
|
||||
public Faxiang(int uid,int itemId) {
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.Faxiang, uid);
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(int itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public int getStrongLv() {
|
||||
return strongLv;
|
||||
}
|
||||
|
||||
public void setStrongLv(int strongLv) {
|
||||
this.strongLv = strongLv;
|
||||
}
|
||||
|
||||
public void addStrongLv(int Lv) {
|
||||
this.strongLv += Lv;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public void setStar(int star) {
|
||||
this.star = star;
|
||||
}
|
||||
|
||||
|
||||
public String getBindHeroId() {
|
||||
return bindHeroId;
|
||||
}
|
||||
|
||||
public void setBindHeroId(String bindHeroId) {
|
||||
this.bindHeroId = bindHeroId;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ import config.*;
|
|||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -19,53 +20,32 @@ 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 Map<Integer,Integer> equipByPositionMap = new HashMap<>();
|
||||
|
||||
// 装备位置强化信息
|
||||
private Map<Integer,HeroEquipStrong> equipStrongMap = new HashMap<>(4);
|
||||
// 英雄装备突破等级
|
||||
private int equipAdvanceLv;
|
||||
//魂印
|
||||
private Map<Integer,Integer> soulEquipByPositionMap = new HashMap<>();
|
||||
// 神印
|
||||
private Map<Integer, Integer> godSealByPositionMap = new HashMap<>();
|
||||
|
||||
private Map<Integer,HeroEquipStrong> equipStrongMap = new HashMap<>(4);// 装备位置强化信息
|
||||
private int equipAdvanceLv;// 英雄装备突破等级
|
||||
private Map<Integer,Integer> soulEquipByPositionMap = new HashMap<>();//魂印
|
||||
private Map<Integer, Integer> godSealByPositionMap = new HashMap<>();// 神印
|
||||
private int breakId;
|
||||
|
||||
private int starBreakId;
|
||||
|
||||
private int createTime;
|
||||
|
||||
private int speed;
|
||||
|
||||
private int isLock;
|
||||
|
||||
private int createType;
|
||||
private int changeId;
|
||||
private Set<String> jewelInfo = new HashSet<>();
|
||||
private Set<String> faxiangList = new HashSet<>();
|
||||
private int skin;
|
||||
|
||||
///神魂绑定英雄 神魂等级:<hero动态id>
|
||||
private Map<Integer,List<String>>godSoulBindMap=new HashMap<>();
|
||||
|
||||
private Map<Integer,List<String>>godSoulBindMap=new HashMap<>();//神魂绑定英雄 神魂等级:<hero动态id>
|
||||
private int godSoulLv;
|
||||
|
||||
private int propertyId; // 阵营id(人 佛 妖 道)
|
||||
|
||||
//被神魂绑定英雄 英雄动态id:英雄神魂等级(反绑)
|
||||
private Map<String,Integer> godSoulBeBindMap = new HashMap<>();
|
||||
|
||||
private Map<String,Integer> godSoulBeBindMap = new HashMap<>();//被神魂绑定英雄 英雄动态id:英雄神魂等级(反绑)
|
||||
private Set<Integer> heroGiftEquipList = new HashSet<>();//礼物装备列表
|
||||
|
||||
private Map<Integer, Integer> potentialUpLvMap = new HashMap<>();//潜能升级
|
||||
|
||||
public Hero() {
|
||||
|
|
@ -77,16 +57,17 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||
this.templateId = heroTid;
|
||||
this.level = initStar;//
|
||||
this.level = initStar;
|
||||
SCHero hero1 = SCHero.getsCHero().get(heroTid);
|
||||
this.setPropertyId(hero1.getPropertyName());
|
||||
int initCfgStar = hero1.getStar();
|
||||
|
||||
int maxStar = hero1.getMaxRank(); //最高星级
|
||||
if(hero.getStar()<initCfgStar){
|
||||
this.star =initCfgStar;
|
||||
}else this.star = Math.min(hero.getStar(), maxStar);
|
||||
|
||||
//最高星级
|
||||
int maxStar = hero1.getMaxRank();
|
||||
if(hero.getStar() < initCfgStar){
|
||||
this.star = initCfgStar;
|
||||
}else {
|
||||
this.star = Math.min(hero.getStar(), maxStar);
|
||||
}
|
||||
if (initCfgStar < hero.getStar()) {
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE, initCfgStar);
|
||||
if (scHeroRankUpConfigByType != null) {
|
||||
|
|
@ -584,6 +565,22 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
updateString("potentialUpLvMap", potentialUpLvMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玉虚英雄的等级
|
||||
*/
|
||||
public int getYuXuLevel(){
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public void setBauBlesId(String bauBlesId) {
|
||||
this.bauBlesId = bauBlesId;
|
||||
updateString("bauBlesId", bauBlesId);
|
||||
}
|
||||
|
||||
public String getBauBlesId() {
|
||||
return bauBlesId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hero clone(){
|
||||
Hero clone = null;
|
||||
|
|
@ -602,11 +599,4 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玉虚英雄的等级
|
||||
*/
|
||||
public int getYuXuLevel(){
|
||||
return this.level;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,19 +7,15 @@ import com.ljsd.jieling.util.UUIDEnum;
|
|||
import org.springframework.data.annotation.Id;
|
||||
|
||||
public class PropertyItem extends MongoBase {
|
||||
// 道具唯一id
|
||||
@Id
|
||||
private String id;
|
||||
// 道具模板id
|
||||
private int equipId;
|
||||
// 等级
|
||||
private int level;
|
||||
// 精炼/星级
|
||||
private int buildLevel;
|
||||
// 绑定英雄id
|
||||
private String heroId;
|
||||
|
||||
public PropertyItem(int equipId, int uid) {
|
||||
@Id
|
||||
private String id;// 唯一id
|
||||
private int equipId;// 道具id
|
||||
private int level;// 强化/等级
|
||||
private int buildLevel;// 精炼/星级
|
||||
private String heroId;// 绑定英雄id
|
||||
|
||||
public PropertyItem(int uid, int equipId) {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
this.setId(KeyGenUtils.produceIdByModule(UUIDEnum.property_equip, uid));
|
||||
this.equipId = equipId;
|
||||
|
|
@ -30,8 +26,8 @@ public class PropertyItem extends MongoBase {
|
|||
}
|
||||
|
||||
public void setId(String id) {
|
||||
updateString("id",id);
|
||||
this.id = id;
|
||||
updateString("id",id);
|
||||
}
|
||||
|
||||
public int getEquipId() {
|
||||
|
|
@ -39,8 +35,8 @@ public class PropertyItem extends MongoBase {
|
|||
}
|
||||
|
||||
public void setEquipId(int equipId){
|
||||
updateString("equipId",equipId);
|
||||
this.equipId = equipId;
|
||||
updateString("equipId",equipId);
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ public class HeroVo {
|
|||
private int star;
|
||||
private int HMBreakId;
|
||||
private int starBreakId;
|
||||
private int HMEspecialEquipLevel;
|
||||
private int propertyId;
|
||||
private int godSoulLv;
|
||||
private int likeLv;
|
||||
|
|
@ -33,6 +32,8 @@ public class HeroVo {
|
|||
private Map<String, PropertyItem> jewelMap = new HashMap<>();
|
||||
private Map<String, PropertyItem> faxiangMap = new HashMap<>();
|
||||
|
||||
private Baubles baubles;
|
||||
|
||||
public HeroVo() {
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +45,7 @@ public class HeroVo {
|
|||
heroVo.star = hero.getStar();
|
||||
heroVo.HMBreakId = hero.getBreakIdByHongMeng(heroManager);
|
||||
heroVo.starBreakId = hero.getStarBreakId();
|
||||
// todo 英雄法宝重写
|
||||
heroVo.baubles = user.getEquipManager().getBaubles(hero.getBauBlesId());
|
||||
heroVo.propertyId = hero.getPropertyId();
|
||||
heroVo.godSoulLv = hero.getGodSoulLv();
|
||||
heroVo.likeLv = heroManager.getTotalLikeLv();
|
||||
|
|
@ -107,8 +108,8 @@ public class HeroVo {
|
|||
return starBreakId;
|
||||
}
|
||||
|
||||
public int getHMEspecialEquipLevel() {
|
||||
return HMEspecialEquipLevel;
|
||||
public Baubles getBaubles() {
|
||||
return baubles;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getSoulEquipByPositionMap() {
|
||||
|
|
|
|||
|
|
@ -226,7 +226,6 @@ public class EquipLogic {
|
|||
ItemUtil.itemCostLong(user,costMap, BIReason.UP_FAXIANG_EQUIP_STAR_COST,0);
|
||||
costFaxiang(user, costID, count, true);
|
||||
}
|
||||
equipManager.addEquip(faxiang);
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.STRONGTHEN_FAXIANG_EQUIP_RESPONSE_VALUE, null, true);
|
||||
|
|
@ -660,4 +659,131 @@ public class EquipLogic {
|
|||
return resultBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部法宝
|
||||
*/
|
||||
public void queryAllBaubles(ISession session) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
HeroInfoProto.BaublesAllInfoResponse.Builder builder = HeroInfoProto.BaublesAllInfoResponse.newBuilder();
|
||||
List<Baubles> baublesList = user.getEquipManager().getBaublesList();
|
||||
for (Baubles item : baublesList) {
|
||||
CommonProto.Equip baublesProto = CBean2Proto.getBaublesProto(user, item);
|
||||
builder.addBaubles(baublesProto);
|
||||
}
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.BaublesAllInfoResponse_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝升级
|
||||
*/
|
||||
public void baublesStrengthen(ISession session, HeroInfoProto.BaublesStrengthenRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
String baublesId = proto.getBaublesId();
|
||||
int upLv = proto.getUpLv();
|
||||
|
||||
Baubles baubles = equipManager.getBaubles(baublesId);
|
||||
if (baubles == null){
|
||||
throw new ErrorCodeException("法宝道具不存在:"+baublesId);
|
||||
}
|
||||
|
||||
int nowLv = baubles.getLevel();
|
||||
int tgLv = nowLv + upLv;
|
||||
Map<Integer, SEquipTalismana> talismanaMap = SEquipTalismana.equipTalismanaStarMap.get(baubles.getEquipId());
|
||||
SEquipTalismana equipTalismana = talismanaMap.get(tgLv);
|
||||
if (equipTalismana == null){
|
||||
throw new ErrorCodeException(ErrorCode.LEVE_MAX, "法宝已到达最大等级:"+tgLv);
|
||||
}
|
||||
|
||||
ArrayList<int[][]> costList = new ArrayList<>();
|
||||
for (int i = 0; i < upLv; i++) {
|
||||
SEquipTalismana talismana = talismanaMap.get(nowLv + i);
|
||||
costList.add(talismana.getRankupBasicMaterial());
|
||||
}
|
||||
boolean cost = ItemUtil.itemCost(user, costList, BIReason.BAUBLES_STRENGETHEN, 0);
|
||||
if (!cost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
baubles.setLevel(tgLv);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.BaublesStrengthenResponse_VALUE, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 穿戴法宝
|
||||
*/
|
||||
public void baublesWear(ISession session, HeroInfoProto.BaublesWearRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
String baublesId = proto.getBaublesId();
|
||||
String heroId = proto.getHeroId();
|
||||
|
||||
Hero hero = heroManager.getHero(heroId);
|
||||
if (hero == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "英雄不存在");
|
||||
}
|
||||
|
||||
if (baublesId.isEmpty()){
|
||||
// 卸下
|
||||
String heroBauBlesId = hero.getBauBlesId();
|
||||
Baubles baubles = equipManager.getBaubles(heroBauBlesId);
|
||||
hero.setBauBlesId("");
|
||||
baubles.setHeroId("");
|
||||
}
|
||||
else {
|
||||
// 穿戴-替换
|
||||
Baubles baubles = equipManager.getBaubles(baublesId);
|
||||
if (baubles == null || !baubles.getMasterId().isEmpty()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝不存在或者处于庇佑状态");
|
||||
}
|
||||
String baublesHeroId = baubles.getHeroId();
|
||||
if (!baublesHeroId.isEmpty()){
|
||||
Hero hero1 = heroManager.getHero(baublesHeroId);
|
||||
hero1.setBauBlesId("");
|
||||
}
|
||||
String heroBauBlesId = hero.getBauBlesId();
|
||||
if (!heroBauBlesId.isEmpty()){
|
||||
Baubles baubles1 = equipManager.getBaubles(heroBauBlesId);
|
||||
baubles1.setHeroId("");
|
||||
}
|
||||
hero.setBauBlesId(baublesId);
|
||||
baubles.setHeroId(heroId);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.BaublesWearResponse_VALUE, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝庇佑
|
||||
*/
|
||||
public void baublesBless(ISession session, HeroInfoProto.BaublesBlessRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
String baublesId = proto.getBaublesId();
|
||||
String blessBaublesId = proto.getBlessBaublesId();
|
||||
|
||||
Baubles baubles = equipManager.getBaubles(baublesId);
|
||||
Baubles blessBaubles = equipManager.getBaubles(blessBaublesId);
|
||||
if (baubles == null || blessBaubles == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝不存在");
|
||||
}
|
||||
if (!baubles.getMasterId().isEmpty() || !blessBaubles.getMasterId().isEmpty()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝存在已庇佑情况");
|
||||
}
|
||||
int number = SSpecialConfig.getIntegerValue("Huyou_Number");
|
||||
if (baubles.getBlessList().size() >= number){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝安装的庇佑数量以达到上限");
|
||||
}
|
||||
int openLevel = SSpecialConfig.getIntegerValue("Huyou_OpenLevel");
|
||||
if (blessBaubles.getLevel() < openLevel){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "法宝未到达要求等级");
|
||||
}
|
||||
|
||||
baubles.addBless(blessBaublesId);
|
||||
blessBaubles.setMasterId(baublesId);
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.BaublesBlessResponse_VALUE, null, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public class ExpeditionLogic {
|
|||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
Expedition.GetExpeditionResponse.Builder builder = Expedition.GetExpeditionResponse.newBuilder();
|
||||
if(manager.getExpeditionNodeInfos().size()==0){
|
||||
if(manager.getExpeditionNodeInfos().isEmpty()){
|
||||
manager.setExpeditionLeve(1);
|
||||
manager.setLay(1);
|
||||
manager.setSortid(0);
|
||||
|
|
@ -141,7 +141,7 @@ public class ExpeditionLogic {
|
|||
}
|
||||
itemArrs.add(entry.getValue());
|
||||
}
|
||||
if (itemArrs.size() == 0) {
|
||||
if (itemArrs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String mailReward = ItemUtil.getMailReward(itemArrs);
|
||||
|
|
@ -153,10 +153,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 领取圣遗物入库
|
||||
* @param session
|
||||
* @param itemId
|
||||
* @return
|
||||
* @throws ErrorCodeException
|
||||
*/
|
||||
public String takeHoly(ISession session, int itemId) throws Exception {
|
||||
SExpeditionHolyConfig sExpeditionHolyConfig = STableManager.getConfig(SExpeditionHolyConfig.class).get(itemId);
|
||||
|
|
@ -170,7 +166,7 @@ public class ExpeditionLogic {
|
|||
expeditionManager.addPropertyItems(expeditionItem);
|
||||
expeditionManager.setGetHolyTiem(expeditionManager.getGetHolyTiem()+1);
|
||||
//更新effectitem 参与计算
|
||||
if(expeditionManager.getEffectItems().size()==0){
|
||||
if(expeditionManager.getEffectItems().isEmpty()){
|
||||
ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||
}
|
||||
Map<Integer,SExpeditionHolyConfig> effectItems = expeditionManager.getEffectItems();
|
||||
|
|
@ -274,7 +270,7 @@ public class ExpeditionLogic {
|
|||
removeId.forEach(heroHP::remove);
|
||||
Set<CommonProto.ExpeditionSimpleHeroInfo> heroInfoSet = new HashSet<>();
|
||||
for (Map.Entry<String, Double> entry : heroHP.entrySet()) {
|
||||
if (set.size() != 0 && !set.contains(entry.getKey())) {
|
||||
if (!set.isEmpty() && !set.contains(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
CommonProto.ExpeditionSimpleHeroInfo simpleHeroInfo = CommonProto.ExpeditionSimpleHeroInfo.newBuilder().setHeroId(entry.getKey()).setRemainHp(entry.getValue()).build();
|
||||
|
|
@ -286,7 +282,7 @@ public class ExpeditionLogic {
|
|||
public Set<CommonProto.ExpeditionNodeInfo> getNodeInfo(User user) throws Exception {
|
||||
Set<CommonProto.ExpeditionNodeInfo> nodeInfos = new HashSet<>();
|
||||
Map<Integer, ExpeditionNodeInfo> expeditionNodeInfos = user.getExpeditionManager().getExpeditionNodeInfos();
|
||||
if (expeditionNodeInfos.size() == 0) {
|
||||
if (expeditionNodeInfos.isEmpty()) {
|
||||
createNodeSet(user,user.getExpeditionManager().getExpeditionLeve());
|
||||
}
|
||||
expeditionNodeInfos.values().forEach(nodeInfo ->
|
||||
|
|
@ -345,9 +341,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 根据id创建一小层得战斗节点
|
||||
* @param id
|
||||
* @param nodeSets
|
||||
* @throws Exception
|
||||
*/
|
||||
private void createNodesByLay(User user,int id,int leve,Set<ExpeditionNodeInfo> nodeSets) throws Exception{
|
||||
SExpeditionFloorConfig config = STableManager.getConfig(SExpeditionFloorConfig.class).get(id);
|
||||
|
|
@ -375,8 +368,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 获取节点类型
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
private List<Integer> getNodeType(SExpeditionFloorConfig config){
|
||||
List<Integer> list = new ArrayList<>(config.getNode());
|
||||
|
|
@ -482,9 +473,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 返回猎妖之路下一个阶段sortId;
|
||||
* @param sortId
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> getNextNodeId(int sortId,int size){
|
||||
LinkedList<Integer> integers= new LinkedList<>();
|
||||
|
|
@ -519,7 +507,7 @@ public class ExpeditionLogic {
|
|||
Map<Integer,SExpeditionHolyConfig> effectItems = expeditionManager.getEffectItems();
|
||||
|
||||
Map<Integer, SExpeditionHolyConfig> config = STableManager.getConfig(SExpeditionHolyConfig.class);
|
||||
if (effectItems.size() == 0) {
|
||||
if (effectItems.isEmpty()) {
|
||||
//全量计算
|
||||
Set<ExpeditionItem> propertyItems = expeditionManager.getPropertyItems();
|
||||
for (ExpeditionItem item : propertyItems){
|
||||
|
|
@ -551,10 +539,8 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 天宫秘宝刷新逻辑,暂不用
|
||||
* @param user
|
||||
* @throws Exception
|
||||
*/
|
||||
private static void checkAndResetTreasure(User user) throws Exception {
|
||||
private static void checkAndResetTreasure(User user) {
|
||||
// WorldTreasureReward worldTreasureReward = user.getExpeditionManager().getWorldTreasureReward();
|
||||
// int nowInt = TimeUtils.nowInt();
|
||||
// if(worldTreasureReward.getFirstStartTime()> nowInt){
|
||||
|
|
@ -598,14 +584,8 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 大闹天宫,创建招募英雄
|
||||
* @param user
|
||||
* @param hero
|
||||
* @param heroTid
|
||||
* @param level
|
||||
* @param nodeId -1入背包
|
||||
* @param type 1:普通招募,2:试炼招募
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Hero createRandomHero(User user,Hero hero,int heroTid,int level,int nodeId,int type)throws Exception{
|
||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||
|
|
@ -620,7 +600,7 @@ public class ExpeditionLogic {
|
|||
level = Math.min(level, scHero.getMaxLevel());
|
||||
// 最低20级
|
||||
level = Math.max(level, 20);
|
||||
//创建新的英雄
|
||||
// 创建新的英雄
|
||||
Hero newHero = new Hero(hero,user.getId(),heroTid,level);
|
||||
// 魂宝灵宝,魂印需要走表
|
||||
addExpeditionJewel(user,newHero,type);
|
||||
|
|
@ -676,9 +656,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 添加魂印
|
||||
* @param newHero
|
||||
* @param type
|
||||
* @throws Exception
|
||||
*/
|
||||
private static void addExpenditionSoulEquip(User user,Hero newHero,int type){
|
||||
if (newHero.getStar() < 6){
|
||||
|
|
@ -699,9 +676,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 获取随机圣遗物buff
|
||||
* @param user
|
||||
* @param probability
|
||||
* @return
|
||||
*/
|
||||
public Set<Integer> getRandomHoly(User user,int type, int[][] probability){
|
||||
Set<Integer> staffsSet = new HashSet<>();
|
||||
|
|
@ -731,9 +705,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 获取不重复得圣物
|
||||
* @param user
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
private Map<Integer, Integer> getType2holy2weightRemoveHas(User user, int type) {
|
||||
// 策划表的圣物,因为会有删除操作,所以需要重新赋值,而不是直接引用
|
||||
|
|
@ -785,8 +756,6 @@ public class ExpeditionLogic {
|
|||
|
||||
/**
|
||||
* 获取全部节点得圣物信息
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
private Set<Integer> getNodeHolyInfo(User user){
|
||||
Set<Integer> set = new HashSet<>();
|
||||
|
|
@ -797,7 +766,7 @@ public class ExpeditionLogic {
|
|||
}
|
||||
// 聚合操作,首先排除不存在圣物得节点,然后循环添加剩余节点圣物
|
||||
values.stream()
|
||||
.filter(val->val.getHolyEquipId() != null && val.getHolyEquipId().size() > 0)
|
||||
.filter(val->val.getHolyEquipId() != null && !val.getHolyEquipId().isEmpty())
|
||||
.forEach(val->set.addAll(val.getHolyEquipId()));
|
||||
return set;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -739,20 +739,11 @@ public class FightUtil {
|
|||
/**
|
||||
* 获取玉虚论道跨服战斗数据
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo makeYuxuCrossPersonData(CSPlayer csPlayer, int teamId, ArenaRecord arenaRecord, CrossArenaManager crossArenaManager) throws Exception {
|
||||
public static CommonProto.FightTeamInfo makeYuxuCrossPersonData(CSPlayer csPlayer, int teamId, ArenaRecord arenaRecord) {
|
||||
if (csPlayer == null) {
|
||||
return null;//throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
return null;
|
||||
}
|
||||
if (GameApplication.serverId == csPlayer.getServerId()) {
|
||||
//本服玩家
|
||||
User user = UserManager.getUser(csPlayer.getUserId());
|
||||
return getYuxuTeam(user, teamId, null,arenaRecord);
|
||||
}
|
||||
//其他服玩家
|
||||
if (crossArenaManager == null) {
|
||||
LOGGER.error("Exception::=>{}", "rpc data is empty");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
return getCrossYuxuTeam(crossArenaManager,teamId,null,arenaRecord);
|
||||
User user = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
|
||||
return getYuxuTeam(user, teamId, null,arenaRecord);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,25 +170,9 @@ public class HeroLogic {
|
|||
EquipManager equipManager = user.getEquipManager();
|
||||
//宝器
|
||||
if (type == 4) {
|
||||
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||
Set<String> needRemove = new HashSet<>(equipMap.size());
|
||||
for (Map.Entry<String, PropertyItem> equipInfoEntry : equipMap.entrySet()) {
|
||||
PropertyItem value = equipInfoEntry.getValue();
|
||||
if (value == null) {
|
||||
needRemove.add(equipInfoEntry.getKey());
|
||||
LOGGER.info("getAllEquipInfo uid={} remove null jewel{}", uid, equipInfoEntry.getKey());
|
||||
continue;
|
||||
}
|
||||
int itemType = SItem.getsItemMap().get(value.getEquipId()).getItemType();
|
||||
if (itemType != GlobalItemType.JEWEL){
|
||||
continue;
|
||||
}
|
||||
equipList.add(CBean2Proto.getPropertyEquipProto(value));
|
||||
}
|
||||
if (!needRemove.isEmpty()) {
|
||||
for (String id : needRemove) {
|
||||
equipManager.removeEquip(id);
|
||||
}
|
||||
List<PropertyItem> jewelList = user.getEquipManager().getJewelList();
|
||||
for (PropertyItem item : jewelList) {
|
||||
equipList.add(CBean2Proto.getPropertyEquipProto(item));
|
||||
}
|
||||
} else {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
|
|
@ -1984,20 +1968,26 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
//法宝技能
|
||||
int[] equipTalismana = tempHero.getEquipTalismana();
|
||||
if (equipTalismana.length >= 2 && star >= equipTalismana[0]) {
|
||||
int especialEquipLevel = heroVo.getHMEspecialEquipLevel();
|
||||
int especialEquipId = equipTalismana[1];
|
||||
Map<Integer, SEquipTalismana> sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId);
|
||||
sEquipTalismana.forEach((k, v) -> {
|
||||
if (k <= especialEquipLevel && v.getOpenSkillRules() != null) {
|
||||
Arrays.stream(v.getOpenSkillRules()).forEach(skillList::add);
|
||||
}
|
||||
});
|
||||
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]);
|
||||
}
|
||||
}
|
||||
// 英雄专属技能
|
||||
for (int[] heroSkill : equipTalismana.getHeroSkill()) {
|
||||
if (heroSkill[0] == tempHero.getId()){
|
||||
skillList.add(heroSkill[1]);
|
||||
}
|
||||
}
|
||||
|
||||
int propertyId = heroVo.getPropertyId();
|
||||
|
||||
// 紫府神印技能
|
||||
for (PurpleMansionSeal seal : heroVo.getPurpleMansionSealMap().values()) {
|
||||
// 使用中神印
|
||||
|
|
@ -2193,8 +2183,6 @@ public class HeroLogic {
|
|||
hero2.setStar(star);
|
||||
hero2.setStarBreakId(starBreakthroughId);
|
||||
|
||||
// 更新鸿蒙阵
|
||||
addOrUpdateHongmeng(iSession);
|
||||
// 战力变化
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
||||
// 消耗道具
|
||||
|
|
@ -2662,7 +2650,7 @@ public class HeroLogic {
|
|||
// 礼物装备加成
|
||||
applyGiftEquipAttribute(heroAllAttribute, hero, user);
|
||||
// 法宝,法相加成
|
||||
applyEquipTalismanaAndFaxiangAttribute(heroAllAttribute, hero, user);
|
||||
applyBaublesAndFaxiangAttribute(heroAllAttribute, hero, user);
|
||||
// 魂印和神印属性加成
|
||||
applySoulEquipAndGodSealAttribute(heroAllAttribute, hero, user);
|
||||
// 主角修为和修行等级属性加成
|
||||
|
|
@ -2972,15 +2960,37 @@ public class HeroLogic {
|
|||
* @param hero 英雄
|
||||
* @param user 主角
|
||||
*/
|
||||
private void applyEquipTalismanaAndFaxiangAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, User user){
|
||||
private void applyBaublesAndFaxiangAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, User user){
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
// ... 法宝 ...
|
||||
|
||||
String heroBauBlesId = hero.getBauBlesId();
|
||||
Baubles baubles = equipManager.getBaubles(heroBauBlesId);
|
||||
if (baubles != null){
|
||||
Map<Integer, SEquipTalismana> talismanaMap = SEquipTalismana.equipTalismanaStarMap.get(baubles.getEquipId());
|
||||
if (talismanaMap != null && !talismanaMap.isEmpty()){
|
||||
SEquipTalismana equipTalismana = talismanaMap.get(baubles.getLevel());
|
||||
if (equipTalismana != null){
|
||||
int increase = baubles.getBlessList().size() * SSpecialConfig.getIntegerValue("Huyou_UpAttribute");
|
||||
HashMap<Integer, Long> map = new HashMap<>();
|
||||
for (int[] pp : equipTalismana.getProperty()) {
|
||||
int pId = pp[0];
|
||||
long value = pp[1];
|
||||
SPropertyConfig propertyConfig = SPropertyConfig.getsPropertyConfigByPID(pId);
|
||||
if (propertyConfig != null && propertyConfig.getStyle() == 1){
|
||||
value = Math.round(pp[1] * (1 + increase / 10000d));
|
||||
}
|
||||
map.put(pId, value);
|
||||
}
|
||||
combinedAttribute(map, heroAllAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ... 法相 ...
|
||||
Set<String> faxiangList = hero.getFaxiangList();
|
||||
if (faxiangList != null && !faxiangList.isEmpty()){
|
||||
if (!faxiangList.isEmpty()){
|
||||
for (String id : faxiangList) {
|
||||
PropertyItem faxiang = user.getEquipManager().getEquip(id);
|
||||
PropertyItem faxiang = equipManager.getEquip(id);
|
||||
SFaxiangConfig config = SFaxiangConfig.faxiangMap.get(faxiang.getEquipId());
|
||||
|
||||
// 潜能加成
|
||||
|
|
@ -4324,7 +4334,7 @@ public class HeroLogic {
|
|||
}
|
||||
// 法相
|
||||
Set<String> faxiangList = hero.getFaxiangList();
|
||||
if (faxiangList != null && !faxiangList.isEmpty()){
|
||||
if (!faxiangList.isEmpty()){
|
||||
Iterator<String> iterator = faxiangList.iterator();
|
||||
while (iterator.hasNext()){
|
||||
String next = iterator.next();
|
||||
|
|
|
|||
|
|
@ -757,15 +757,17 @@ public class PlayerLogic {
|
|||
.setName(csPlayer.getName())
|
||||
.setGuildName("nb guild") //csPlayer.getGuildName()
|
||||
.setPracticeLevel(csPlayer.getPracticeLevel())
|
||||
.setUid(user.getId()).setCrossTeamScore(csPlayer.getCrossYuxulundaoNewScore())
|
||||
.setUid(user.getId())
|
||||
.setCrossTeamScore(csPlayer.getCrossYuxulundaoNewScore())
|
||||
.setServerName(serverName);
|
||||
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
for(int teamId: team){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamOneTeamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos =user.getTeamPosManager().getTeamPosForHero().getOrDefault(teamId,new ArrayList<>());
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().getOrDefault(teamId,new ArrayList<>());
|
||||
if(teamPosHeroInfos!=null){
|
||||
for (TeamPosHeroInfo heroInfo:teamPosHeroInfos){
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
Hero hero = heroMap.get(heroInfo.getHeroId());
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
if(hero == null){
|
||||
continue;
|
||||
}
|
||||
|
|
@ -799,7 +801,7 @@ public class PlayerLogic {
|
|||
// teamOneTeamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon, entry.getKey()));
|
||||
// }
|
||||
//LOGGER.info("=====================跨服获取阵容:{}",teamId);
|
||||
long integer = user.getTeamPosManager().getTeamForce(teamId);
|
||||
long integer = teamPosManager.getTeamForce(teamId);
|
||||
teamOneTeamInfo.setTotalForce(integer);
|
||||
|
||||
// for(Map.Entry<Integer, PurpleMansionSeal> entry:user.getHeroManager().getPurpleMansionSeal().entrySet()){
|
||||
|
|
@ -818,129 +820,43 @@ public class PlayerLogic {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
//获取跨服玩家信息
|
||||
public CommonProto.TeamOneInfo getCrossYxldMyTeamInfoNew(User user,List<Integer> team) throws Exception{
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(user.getId());
|
||||
if(csPlayer==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//基本信息从redis中拿 剩下的队伍 属性 数据量大的数据rpc调用
|
||||
String serverName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
GuildInfo mapEntry = GuilidManager.getGuildInfo(csPlayer.getGuildId());
|
||||
CommonProto.TeamOneInfo.Builder builder = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(csPlayer.getHead())
|
||||
.setHeadFrame(csPlayer.getHeadFrame())
|
||||
.setUserTitle(csPlayer.getUserTitle())
|
||||
.setLevel(csPlayer.getLevel())
|
||||
.setName(csPlayer.getName())
|
||||
.setGuildName(Optional.ofNullable(mapEntry).map(GuildInfo::getName).orElse("")) //csPlayer.getGuildName()
|
||||
.setPracticeLevel(csPlayer.getPracticeLevel())
|
||||
.setUid(user.getId()).setCrossTeamScore(csPlayer.getCrossYuxulundaoNewScore())
|
||||
.setServerName(serverName);
|
||||
for(int teamId: team){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamOneTeamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos =user.getTeamPosManager().getTeamPosForHero().getOrDefault(teamId,new ArrayList<>());
|
||||
if(teamPosHeroInfos!=null){
|
||||
for (TeamPosHeroInfo heroInfo:teamPosHeroInfos){
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
Hero hero = heroMap.get(heroInfo.getHeroId());
|
||||
if(hero == null){
|
||||
continue;
|
||||
}
|
||||
Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
|
||||
if(yuxuHero == null){
|
||||
continue;
|
||||
}
|
||||
teamOneTeamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(hero.getId())
|
||||
.setHeroTid(hero.getTemplateId())
|
||||
.setLevel(yuxuHero.getYuXuLevel())
|
||||
.setStar(yuxuHero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(yuxuHero.getGodSoulLv())
|
||||
.setPropertyId(yuxuHero.getPropertyId())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
// 灵兽
|
||||
// Map<String, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
|
||||
// Map<Integer, String> teamMap = user.getPokemonManager().getPokemonTeamMap();
|
||||
// for (Map.Entry<Integer, String> entry : teamMap.entrySet()) {
|
||||
// // clone 深度复制
|
||||
// Pokemon pokemon = (Pokemon)pokemonMap.get(entry.getValue()).clone();
|
||||
// pokemon.setTmpId(pokemon.getTmpId());
|
||||
// pokemon.setId(pokemon.getId());
|
||||
// pokemon.setLevel(pokemon.getLevel());
|
||||
// pokemon.setStar(pokemon.getStar());
|
||||
// teamOneTeamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon, entry.getKey()));
|
||||
// }
|
||||
//LOGGER.info("=====================跨服获取阵容:{}",teamId);
|
||||
|
||||
long integer = user.getTeamPosManager().getTeamForce(teamId);
|
||||
teamOneTeamInfo.setTotalForce(integer);
|
||||
|
||||
// for(Map.Entry<Integer, PurpleMansionSeal> entry:user.getHeroManager().getPurpleMansionSeal().entrySet()){
|
||||
// PurpleMansionSeal value = entry.getValue();
|
||||
// Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
// Hero hero = heroMap.get(value.getSubId());
|
||||
// if(value.getState()==0){
|
||||
// continue;
|
||||
// }
|
||||
// teamOneTeamInfo.addSealShow(CommonProto.PurpleSealShowInfo.newBuilder().setType(value.getType()).
|
||||
// setId(value.getSealId()).setHeroTId(hero==null?0:hero.getTemplateId()));
|
||||
// }
|
||||
// //身外化身变身卡
|
||||
// teamOneTeamInfo.addAllTransformationCardInfo(CBean2Proto.getTransformationInfoList2(user));
|
||||
// //四象心法
|
||||
// teamOneTeamInfo.addAllSixiangxinfaInfo(GetPlayerInfoHandler.getSixiangxinfaInfos(user.getHeroManager()));
|
||||
// //命格
|
||||
// teamOneTeamInfo.addAllLifeGridInfo(GetPlayerInfoHandler.getLifeGridInfos(user.getHeroManager()));
|
||||
// //坐骑
|
||||
// teamOneTeamInfo.addAllUserMountInfo(CBean2Proto.getUserMountList(user));
|
||||
builder.setTeam(teamOneTeamInfo.build());
|
||||
//builder.addCrossTeam(teamOneTeamInfo.build());
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 此方法调用必须在外层做特殊验证,只有获取非本服玩家数据才能使用
|
||||
*/
|
||||
public CrossArenaManager getCrossArenaManagerData(CSPlayer csPlayer){
|
||||
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisKey.LOGIC_SERVER_INFO, String.valueOf(csPlayer.getServerId()), String.class, -1);
|
||||
String[] split = rpcString.split(":");
|
||||
if (split.length < 4){
|
||||
LOGGER.error("获取玩家rpc地址,长度错误,rpc:{},玩家id:{},服务器id:{}",rpcString,csPlayer.getUserId(),csPlayer.getServerId());
|
||||
return null;
|
||||
}
|
||||
String ip = rpcString.split(":")[0];
|
||||
String port = rpcString.split(":")[3];
|
||||
//rpc 数据调用
|
||||
//String ip =csPlayer.getRpcIp();
|
||||
//int port = csPlayer.getRpcPort();
|
||||
int uid = csPlayer.getUserId();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("RPCCORE").append("|")
|
||||
.append(ip).append("|")
|
||||
.append(port);
|
||||
ClientAdapterPo<RPCRequestIFace.Client> rPCClient = null;
|
||||
CrossArenaManager crossArenaManager = null ;
|
||||
try{
|
||||
rPCClient = ClientAdapterPo.getClientAdapterPo(sb.toString());
|
||||
crossArenaManager = rPCClient.getClient().getHeroManagerInfo(uid);
|
||||
}catch (Exception e) {
|
||||
LOGGER.error("callback=>{}", e.getMessage(), e);
|
||||
} finally {
|
||||
if(rPCClient != null){
|
||||
rPCClient.returnObject(sb.toString());
|
||||
}else{
|
||||
LOGGER.info("callback=> rPCClient is null ");
|
||||
}
|
||||
}
|
||||
return crossArenaManager;
|
||||
}
|
||||
// public CrossArenaManager getCrossArenaManagerData(CSPlayer csPlayer){
|
||||
//
|
||||
// String rpcString = RedisUtil.getInstence().getObject(RedisKey.LOGIC_SERVER_INFO, String.valueOf(csPlayer.getServerId()), String.class, -1);
|
||||
// String[] split = rpcString.split(":");
|
||||
// if (split.length < 4){
|
||||
// LOGGER.error("获取玩家rpc地址,长度错误,rpc:{},玩家id:{},服务器id:{}",rpcString,csPlayer.getUserId(),csPlayer.getServerId());
|
||||
// return null;
|
||||
// }
|
||||
// String ip = rpcString.split(":")[0];
|
||||
// String port = rpcString.split(":")[3];
|
||||
// //rpc 数据调用
|
||||
// //String ip =csPlayer.getRpcIp();
|
||||
// //int port = csPlayer.getRpcPort();
|
||||
// int uid = csPlayer.getUserId();
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("RPCCORE").append("|")
|
||||
// .append(ip).append("|")
|
||||
// .append(port);
|
||||
// ClientAdapterPo<RPCRequestIFace.Client> rPCClient = null;
|
||||
// CrossArenaManager crossArenaManager = null ;
|
||||
// try{
|
||||
// rPCClient = ClientAdapterPo.getClientAdapterPo(sb.toString());
|
||||
// crossArenaManager = rPCClient.getClient().getHeroManagerInfo(uid);
|
||||
// }catch (Exception e) {
|
||||
// LOGGER.error("callback=>{}", e.getMessage(), e);
|
||||
// } finally {
|
||||
// if(rPCClient != null){
|
||||
// rPCClient.returnObject(sb.toString());
|
||||
// }else{
|
||||
// LOGGER.info("callback=> rPCClient is null ");
|
||||
// }
|
||||
// }
|
||||
// return crossArenaManager;
|
||||
// }
|
||||
|
||||
public boolean sendCrossLingmaiHongdian(CSPlayer csPlayer){
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisKey.LOGIC_SERVER_INFO, String.valueOf(csPlayer.getServerId()), String.class, -1);
|
||||
|
|
@ -985,231 +901,11 @@ public class PlayerLogic {
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//基本信息从redis中拿 剩下的队伍 属性 数据量大的数据rpc调用
|
||||
String serverName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
CommonProto.TeamOneInfo.Builder builder = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(csPlayer.getHead())
|
||||
.setHeadFrame(csPlayer.getHeadFrame())
|
||||
.setUserTitle(csPlayer.getUserTitle())
|
||||
.setLevel(csPlayer.getLevel())
|
||||
.setName(csPlayer.getName())
|
||||
.setGuildName("nb guild") //csPlayer.getGuildName()
|
||||
.setPracticeLevel(csPlayer.getPracticeLevel())
|
||||
.setUid(id).setCrossTeamScore(csPlayer.getCrossYuxulundaoNewScore())
|
||||
.setServerName(serverName);
|
||||
//如果是本服玩家 直接本服调用数据
|
||||
if(GameApplication.serverId == csPlayer.getServerId()){
|
||||
User user = UserManager.getUser(id);
|
||||
return PlayerLogic.getInstance().getCrossYxldMyTeamInfo(user, team);
|
||||
}
|
||||
CrossArenaManager crossArenaManager = getCrossArenaManagerData(csPlayer) ;
|
||||
if(crossArenaManager == null){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
|
||||
}
|
||||
//rpc 数据调用测试
|
||||
for(int teamId: team){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamOneTeamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().get(teamId);
|
||||
if(teamPosHeroInfos!=null){
|
||||
for (com.ljsd.jieling.thrift.idl.TeamPosHeroInfo heroInfo:teamPosHeroInfos) {
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero hero = crossArenaManager.getHeros().get(heroInfo.getHeroId());
|
||||
teamOneTeamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(hero.getId())
|
||||
.setHeroTid(hero.getTemplateId())
|
||||
.setLevel(hero.getLevel())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
// if(crossArenaManager.getPokemons()!=null){
|
||||
// Map<String, com.ljsd.jieling.thrift.idl.Pokemon> pokemonMap = crossArenaManager.getPokemons();
|
||||
// Map<Integer, String> teamMap = crossArenaManager.getPokemonTeamMap();
|
||||
// for(Map.Entry<Integer, String> entry :teamMap.entrySet()){
|
||||
// // clone 深度复制
|
||||
// com.ljsd.jieling.thrift.idl.Pokemon pokemon = pokemonMap.get(entry.getValue());
|
||||
// pokemon.setTmpId(pokemon.getTmpId());
|
||||
// pokemon.setId(pokemon.getId());
|
||||
// pokemon.setLevel(pokemon.getLevel());
|
||||
// pokemon.setStar(pokemon.getStar());
|
||||
// teamOneTeamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon, entry.getKey()));
|
||||
// }
|
||||
// }
|
||||
LOGGER.info("=====================跨服获取阵容:{}",teamId);
|
||||
long integer = crossArenaManager.getTotalForceByTeam().getOrDefault(teamId,0L);
|
||||
teamOneTeamInfo.setTotalForce(integer);
|
||||
// if(crossArenaManager.getSeals()!= null){
|
||||
// for(Map.Entry<Integer, com.ljsd.jieling.thrift.idl.PurpleMansionSeal> entry:crossArenaManager.getSeals().entrySet()){
|
||||
// com.ljsd.jieling.thrift.idl.PurpleMansionSeal value = entry.getValue();
|
||||
// com.ljsd.jieling.thrift.idl.ArenaOfHero arenaOfHero = crossArenaManager.getHeros().get(value.getSubId());
|
||||
// if(value.getState()==0){
|
||||
// continue;
|
||||
// }
|
||||
// teamOneTeamInfo.addSealShow(CommonProto.PurpleSealShowInfo.newBuilder().setType(value.getType()).setId(value.getSealId()).setHeroTId(arenaOfHero==null?0:arenaOfHero.getTemplateId()));
|
||||
// }
|
||||
// }
|
||||
//builder.setTeam(teamOneTeamInfo.build());
|
||||
builder.addCrossTeam(teamOneTeamInfo.build());
|
||||
}
|
||||
// PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.newBuilder().setTeamInfo(builder.build());
|
||||
return builder.build();
|
||||
User user = PlayerLogic.getInstance().getUserByRpc(id);
|
||||
return PlayerLogic.getInstance().getCrossYxldMyTeamInfo(user, team);
|
||||
}
|
||||
|
||||
//获取跨服玩家信息
|
||||
@Deprecated
|
||||
public CommonProto.TeamOneInfo getCrossYxldOneTeamInfoNew(int id,List<Integer> team) throws Exception {
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(id);
|
||||
if(csPlayer==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//基本信息从redis中拿 剩下的队伍 属性 数据量大的数据rpc调用
|
||||
String serverName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||
GuildInfo mapEntry = GuilidManager.getGuildInfo(csPlayer.getGuildId());
|
||||
CommonProto.TeamOneInfo.Builder builder = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(csPlayer.getHead())
|
||||
.setHeadFrame(csPlayer.getHeadFrame())
|
||||
.setUserTitle(csPlayer.getUserTitle())
|
||||
.setLevel(csPlayer.getLevel())
|
||||
.setName(csPlayer.getName())
|
||||
.setGuildName(Optional.ofNullable(mapEntry).map(GuildInfo::getName).orElse("")) //csPlayer.getGuildName()
|
||||
.setPracticeLevel(csPlayer.getPracticeLevel())
|
||||
.setUid(id).setCrossTeamScore(csPlayer.getCrossYuxulundaoNewScore())
|
||||
.setServerName(serverName);
|
||||
//如果是本服玩家 直接本服调用数据
|
||||
if(GameApplication.serverId == csPlayer.getServerId()){
|
||||
User user = UserManager.getUserNotCache(id);
|
||||
if (user == null){
|
||||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}
|
||||
return PlayerLogic.getInstance().getCrossYxldMyTeamInfoNew(user, team);
|
||||
}
|
||||
CrossArenaManager crossArenaManager = getCrossArenaManagerData(csPlayer) ;
|
||||
if(crossArenaManager == null){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
|
||||
}
|
||||
//rpc 数据调用测试
|
||||
for(int teamId: team){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamOneTeamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().get(teamId);
|
||||
if(teamPosHeroInfos!=null){
|
||||
for (com.ljsd.jieling.thrift.idl.TeamPosHeroInfo heroInfo:teamPosHeroInfos) {
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero hero = crossArenaManager.getHeros().get(heroInfo.getHeroId());
|
||||
teamOneTeamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(hero.getId())
|
||||
.setHeroTid(hero.getTemplateId())
|
||||
.setLevel(hero.getLevel())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
if(crossArenaManager.getPokemons()!=null){
|
||||
Map<String, com.ljsd.jieling.thrift.idl.Pokemon> pokemonMap = crossArenaManager.getPokemons();
|
||||
Map<Integer, String> teamMap = crossArenaManager.getPokemonTeamMap();
|
||||
for(Map.Entry<Integer, String> entry :teamMap.entrySet()){
|
||||
// clone 深度复制
|
||||
com.ljsd.jieling.thrift.idl.Pokemon pokemon = pokemonMap.get(entry.getValue());
|
||||
pokemon.setTmpId(pokemon.getTmpId());
|
||||
pokemon.setId(pokemon.getId());
|
||||
pokemon.setLevel(pokemon.getLevel());
|
||||
pokemon.setStar(pokemon.getStar());
|
||||
teamOneTeamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon, entry.getKey()));
|
||||
}
|
||||
}
|
||||
LOGGER.info("=====================跨服获取阵容:{}",teamId);
|
||||
long integer = crossArenaManager.getTotalForceByTeam().getOrDefault(teamId,0L);
|
||||
teamOneTeamInfo.setTotalForce(integer);
|
||||
if(crossArenaManager.getSeals()!= null){
|
||||
for(Map.Entry<Integer, com.ljsd.jieling.thrift.idl.PurpleMansionSeal> entry:crossArenaManager.getSeals().entrySet()){
|
||||
com.ljsd.jieling.thrift.idl.PurpleMansionSeal value = entry.getValue();
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero arenaOfHero = crossArenaManager.getHeros().get(value.getSubId());
|
||||
if(value.getState()==0){
|
||||
continue;
|
||||
}
|
||||
teamOneTeamInfo.addSealShow(CommonProto.PurpleSealShowInfo.newBuilder().setType(value.getType()).setId(value.getSealId()).setHeroTId(arenaOfHero==null?0:arenaOfHero.getTemplateId()));
|
||||
}
|
||||
}
|
||||
//builder.setTeam(teamOneTeamInfo.build());
|
||||
//builder.addCrossTeam(teamOneTeamInfo.build());
|
||||
//四象心法数据
|
||||
teamOneTeamInfo.addAllSixiangxinfaInfo(RpcData2sixiangData(crossArenaManager.getSixiangInfos()));
|
||||
//命格
|
||||
teamOneTeamInfo.addAllLifeGridInfo(RpcData2LifeGridInfos(crossArenaManager));
|
||||
//玩家坐骑信息
|
||||
teamOneTeamInfo.addAllUserMountInfo(getUserMountList(crossArenaManager.getUserMountValidTime()));
|
||||
//身外化身
|
||||
teamOneTeamInfo.addAllTransformationCardInfo(getTransformationInfoListFromRpc(crossArenaManager.getTransformationList()));
|
||||
builder.setTeam(teamOneTeamInfo.build());
|
||||
}
|
||||
//PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.newBuilder().setTeamInfo(builder.build());
|
||||
return builder.build();
|
||||
}
|
||||
/**
|
||||
* 获取变身卡列表信息过滤
|
||||
*/
|
||||
public static List<CommonProto.TransformationCardInfo> getTransformationInfoListFromRpc( List<TransformationCardInfo> listRpc){
|
||||
List<CommonProto.TransformationCardInfo> list = new ArrayList<>();
|
||||
for(TransformationCardInfo rpcData:listRpc){
|
||||
CommonProto.TransformationCardInfo perData = CommonProto.TransformationCardInfo.newBuilder()
|
||||
.setId(rpcData.getId()).setIndex(rpcData.getIndex()).setStatus(rpcData.getStatus())
|
||||
.setLevel(rpcData.getLevel()).setStar(rpcData.getStar()).build();
|
||||
list.add(perData);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家皮肤列表
|
||||
*/
|
||||
public static List<CommonProto.UserMountInfo> getUserMountList(List<com.ljsd.jieling.thrift.idl.UserMountInfo> userMountInfo) {
|
||||
List<CommonProto.UserMountInfo> userMountLists = new ArrayList<>();
|
||||
for(com.ljsd.jieling.thrift.idl.UserMountInfo rpcData:userMountInfo){
|
||||
CommonProto.UserMountInfo.Builder build = CommonProto.UserMountInfo.newBuilder();
|
||||
build.setMountId(rpcData.getMountId()).setOverTime(rpcData.getOverTime());
|
||||
userMountLists.add(build.build());
|
||||
}
|
||||
return userMountLists;
|
||||
}
|
||||
/**
|
||||
* 初始化获取命格数据
|
||||
*/
|
||||
public static List<CommonProto.LifeGridInfo>RpcData2LifeGridInfos( CrossArenaManager crossArenaManager ){
|
||||
List<LifeGridInfo> rpcdata = crossArenaManager.getLifeGridInfos();
|
||||
List<CommonProto.LifeGridInfo>data = new ArrayList<>();
|
||||
for(LifeGridInfo perRpcData:rpcdata){
|
||||
CommonProto.LifeGridInfo.Builder perData = CommonProto.LifeGridInfo.newBuilder();
|
||||
perData.setGridId(perRpcData.getGridId());
|
||||
perData.setGridIndex(perRpcData.getGridIndex());
|
||||
perData.setItemId(perRpcData.getItemId());
|
||||
data.add(perData.build());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//四象心法数据转换
|
||||
public static List<CommonProto.SixiangxinfaInfo> RpcData2sixiangData(List<SixiangxinfaInfo> rpcSixiangData){
|
||||
List<CommonProto.SixiangxinfaInfo> info = new ArrayList<>();
|
||||
for(SixiangxinfaInfo prcdata:rpcSixiangData){
|
||||
List<CommonProto.SixiangxinfaPropertyInfo> propertyInfo = new ArrayList<>();
|
||||
for(SixiangxinfaPropertyInfo rpcProperty:prcdata.getPropertyInfoList()){
|
||||
CommonProto.SixiangxinfaPropertyInfo sixiangxinfaPropertyInfo = CommonProto.SixiangxinfaPropertyInfo.newBuilder().
|
||||
setPropertyId(rpcProperty.getPropertyId()).setPropertyNum(rpcProperty.getPropertyNum()).build();
|
||||
propertyInfo.add(sixiangxinfaPropertyInfo);
|
||||
}
|
||||
CommonProto.SixiangxinfaInfo perRpcInfo = CommonProto.SixiangxinfaInfo.newBuilder().setLevel(prcdata.getLevel())
|
||||
.setProfessionId(prcdata.getProfessionId()).addAllPropertyInfoList(propertyInfo).build();
|
||||
info.add(perRpcInfo);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public void viewRobotHeroInfo(ISession session, SArenaRobotConfig sArenaRobotConfig,String robotHeroId,int teamId) {
|
||||
public PlayerInfoProto.ViewHeroInfoResponse viewRobotHeroInfo(SArenaRobotConfig sArenaRobotConfig, String robotHeroId, int teamId) {
|
||||
PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
|
||||
|
||||
int[] differDemonsId = sArenaRobotConfig.getDifferDemonsId();
|
||||
|
|
@ -1233,8 +929,7 @@ public class PlayerLogic {
|
|||
}else {
|
||||
builder.setHero(sArenaRobotConfig.getHeroMapList().get(scHero.getId()));
|
||||
}
|
||||
int resMsgId = MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE;
|
||||
MessageUtil.sendMessage(session,1,resMsgId,builder.build(),true);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public PlayerInfoProto.ViewHeroInfoResponse viewHeroInfo(int uid,String heroId,int teamId) throws Exception {
|
||||
|
|
@ -1266,6 +961,10 @@ public class PlayerLogic {
|
|||
PropertyItem faxiang = equipManager.getEquip(key);
|
||||
builder.addEquip(CBean2Proto.getPropertyEquipProto(faxiang));
|
||||
}
|
||||
// 法宝
|
||||
Baubles baubles = equipManager.getBaubles(hero.getBauBlesId());
|
||||
builder.addEquip(CBean2Proto.getBaublesProto(userInMem, baubles));
|
||||
|
||||
builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||
builder.setHero(CBean2Proto.getHero(hero));
|
||||
builder.setPlayerGiftLv(HeroLogic.getInstance().getGiftPotentialLv(userInMem, heroId));
|
||||
|
|
@ -1689,87 +1388,11 @@ public class PlayerLogic {
|
|||
}
|
||||
builder.setForce(HeroLogic.getInstance().calForce(heroAttributeMap));
|
||||
builder.setHero(CBean2Proto.getYuxuHero(yuxuHero,hero));
|
||||
// Map<Integer, Integer> guildSkill = userInMem.getGuildMyInfo().getGuildSkill();
|
||||
//// int profession = SCHero.getsCHero().get(hero.getTemplateId()).getProfession();
|
||||
//// Integer skill = guildSkill.getOrDefault(profession, 0);
|
||||
//公会等级统一为0
|
||||
builder.setGuildSkill(0);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看跨服玉虚英雄信息
|
||||
*/
|
||||
public PlayerInfoProto.ViewHeroInfoResponse viewCrossYuxuHeroInfo(int uid,String heroId) throws Exception {
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(uid);
|
||||
if (csPlayer == null){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("该玩家没有跨服数据"));
|
||||
}
|
||||
if(GameApplication.serverId == csPlayer.getServerId()){
|
||||
return viewYuxuHeroInfo(uid,heroId);
|
||||
}
|
||||
//其他服玩家rpc 数据调用
|
||||
CrossArenaManager crossArenaManager = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
|
||||
Map<String, com.ljsd.jieling.thrift.idl.ArenaOfHero> rpcHeroes =crossArenaManager.getHeros();
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero rpcHero = rpcHeroes.get(heroId);
|
||||
if(rpcHero == null){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
|
||||
}
|
||||
//获取玉虚英雄通用配置
|
||||
Hero yuxuHero = HeroLogic.getInstance().getYuHero(rpcHero.getTemplateId());
|
||||
if(yuxuHero == null){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
|
||||
}
|
||||
CommonProto.Hero.Builder heroBuilder = CommonProto.Hero.newBuilder().
|
||||
setLevel(yuxuHero.getYuXuLevel()).
|
||||
setEspecialEquipLevel(rpcHero.getEspecialEquipLevel()).
|
||||
setStar(yuxuHero.getStar()).
|
||||
setId(rpcHero.getId()).
|
||||
setHeroId(rpcHero.getTemplateId()).
|
||||
setGodSoulLv(yuxuHero.getGodSoulLv()).
|
||||
setBreakId(yuxuHero.getBreakId()).
|
||||
setStarBreakId(yuxuHero.getStarBreakId())
|
||||
.setPropertyId(rpcHero.getPropertyId());
|
||||
PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
|
||||
|
||||
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
|
||||
SEndlessHeroProp sEndlessHeroProp = config.get(rpcHero.getTemplateId());
|
||||
Map<Integer, Long> heroAttributeMap = new HashMap<>();
|
||||
for (int[] prop : sEndlessHeroProp.getProps()) {
|
||||
heroAttributeMap.put(prop[0], (long) prop[1]);
|
||||
}
|
||||
for(Map.Entry<Integer,Long> item : heroAttributeMap.entrySet()){
|
||||
int id = item.getKey();
|
||||
int values = item.getValue().intValue();
|
||||
builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(id).setPropertyValue(values).build());
|
||||
}
|
||||
|
||||
// 无装备
|
||||
// for(int equipId : yuxuHero.getEquipByPositionMap().values()){
|
||||
// heroBuilder.addEquipIdList(equipId);
|
||||
// }
|
||||
// 魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = yuxuHero.getSoulEquipByPositionMap();
|
||||
for(Map.Entry<Integer,Integer> entry: soulEquipByPositionMap.entrySet()){
|
||||
heroBuilder.addSoulPos(CommonProto.SoulPos.newBuilder().setEquipId(entry.getValue()).setPosition(entry.getKey()));
|
||||
}
|
||||
// 神印
|
||||
Map<Integer, Integer> godSealByPositionMap = yuxuHero.getGodSealByPositionMap();
|
||||
for(Map.Entry<Integer,Integer> entry: godSealByPositionMap.entrySet()){
|
||||
heroBuilder.addGodSeals(CommonProto.SoulPos.newBuilder().setEquipId(entry.getValue()).setPosition(entry.getKey()));
|
||||
}
|
||||
// 皮肤
|
||||
heroBuilder.setSkinId(rpcHero.getSkin());
|
||||
// 公会技能统一为0
|
||||
// int profession = SCHero.getsCHero().get(rpcHero.getTemplateId()).getProfession();
|
||||
int skill = 0;
|
||||
builder.setGuildSkill(skill);
|
||||
// 战力
|
||||
builder.setForce(HeroLogic.getInstance().calForce(heroAttributeMap));
|
||||
builder.setHero(heroBuilder);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取神尊特权等级
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -361,8 +361,7 @@ public class CBean2Proto {
|
|||
.setStarBreakId(hero.getStarBreakId())
|
||||
.setCreateTime(hero.getCreateTime())
|
||||
.addAllEquipIdList(hero.getEquipByPositionMap().values())
|
||||
// todo 法宝重写
|
||||
.setEspecialEquipLevel(0)
|
||||
.setBaublesId(hero.getBauBlesId())
|
||||
.addAllSoulPos(soulPoss)
|
||||
.setLockState(hero.getIsLock())
|
||||
.addAllJewels(hero.getJewelInfo())
|
||||
|
|
@ -430,6 +429,12 @@ public class CBean2Proto {
|
|||
return getMail(mail,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 常用于基础装备,只要装备模板id即可
|
||||
*/
|
||||
public static CommonProto.Equip getEquipProto(int equipId) {
|
||||
return CommonProto.Equip.newBuilder().setEquipId(equipId).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性道具信息
|
||||
|
|
@ -444,10 +449,20 @@ public class CBean2Proto {
|
|||
}
|
||||
|
||||
/**
|
||||
* 常用于基础装备,只要装备模板id即可
|
||||
* 获取法宝信息
|
||||
*/
|
||||
public static CommonProto.Equip getEquipProto(int equipId) {
|
||||
return CommonProto.Equip.newBuilder().setEquipId(equipId).build();
|
||||
public static CommonProto.Equip getBaublesProto(User user, Baubles baubles){
|
||||
CommonProto.Equip.Builder builder = getPropertyEquipProto(baubles).toBuilder();
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
for (String id : baubles.getBlessList()) {
|
||||
Baubles item = equipManager.getBaubles(id);
|
||||
if (item == null){
|
||||
continue;
|
||||
}
|
||||
CommonProto.Equip equip = getPropertyEquipProto(item);
|
||||
builder.addBless(equip);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static CommonProto.PokemonInfo getPokemon(Pokemon pokemon) {
|
||||
|
|
@ -1194,7 +1209,6 @@ public class CBean2Proto {
|
|||
builder.setBreakId(yuxuHero.getBreakId());
|
||||
builder.setStarBreakId(yuxuHero.getStarBreakId());
|
||||
//显示真实的法宝等级 todo 法宝重写
|
||||
builder.setEspecialEquipLevel(0);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ public class FightDataUtil {
|
|||
|
||||
enemyData.rawset(i+1, unitData);
|
||||
}
|
||||
//todo 灵兽技能
|
||||
enemyData.set("monsterList", getPokemonSkill(data.getPokemonUnitListList(),1));
|
||||
enemyData.set("weaponList", getMagicSoldierSkill(data.getMagicSoldierListList(),1));
|
||||
enemyData.set("teamPassive", new LuaTable());
|
||||
|
|
|
|||
|
|
@ -616,6 +616,7 @@ public class ItemUtil {
|
|||
break;
|
||||
case GlobalItemType.JEWEL:
|
||||
case GlobalItemType.FAXIANG_EQUIP:
|
||||
case GlobalItemType.ESPECIAL_EQUIP:
|
||||
putCountMap(itemId,(int)amount, itemObj.getEquipMap());
|
||||
break;
|
||||
case GlobalItemType.SpecialMonster:
|
||||
|
|
@ -670,7 +671,6 @@ public class ItemUtil {
|
|||
case GlobalItemType.MAGIC_SOLDIER_FRAGMENTS:
|
||||
case GlobalItemType.SOUL_MARK:
|
||||
case GlobalItemType.GOD_SEAL:
|
||||
case GlobalItemType.ESPECIAL_EQUIP:
|
||||
case GlobalItemType.EQUIP:
|
||||
case GlobalItemType.GIFT_EQUIP:
|
||||
itemType = GlobalItemType.ITEM;
|
||||
|
|
@ -1197,13 +1197,6 @@ public class ItemUtil {
|
|||
if (equipMap == null || equipMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 过滤装备
|
||||
List<Integer> filter = new ArrayList<>();
|
||||
filter.add(GlobalItemType.JEWEL);
|
||||
filter.add(GlobalItemType.FAXIANG_EQUIP);
|
||||
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_txt");
|
||||
|
||||
// 装备上限
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
|
|
@ -1216,7 +1209,7 @@ public class ItemUtil {
|
|||
Integer key = entry.getKey();
|
||||
int count = entry.getValue();
|
||||
int itemType = SItem.getsItemMap().get(key).getItemType();
|
||||
if(!filter.contains(itemType)){
|
||||
if(!ifPropertyItem(itemType)){
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
|
@ -1227,7 +1220,7 @@ public class ItemUtil {
|
|||
reward = new StringBuilder(reward.substring(0, reward.length() - 1));
|
||||
}
|
||||
}else {
|
||||
addJewel(user, key, jewelList);
|
||||
addPropertyEquip(user, key, jewelList);
|
||||
jewelPush.add(key);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_TREASURE.getType(), key,reason);
|
||||
}
|
||||
|
|
@ -1235,6 +1228,8 @@ public class ItemUtil {
|
|||
}
|
||||
|
||||
if (reward.length() > 0) {
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_txt");
|
||||
MailLogic.getInstance().sendMail(user.getId(), title, content, reward.toString(), TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
MessageUtil.nofityBagIsFull(user);
|
||||
}
|
||||
|
|
@ -1272,30 +1267,24 @@ public class ItemUtil {
|
|||
* 是否是属性道具
|
||||
*/
|
||||
public static boolean ifPropertyItem(int itemType){
|
||||
return itemType == GlobalItemType.JEWEL || itemType == GlobalItemType.FAXIANG_EQUIP;
|
||||
return itemType == GlobalItemType.JEWEL || itemType == GlobalItemType.FAXIANG_EQUIP || itemType == GlobalItemType.ESPECIAL_EQUIP;
|
||||
}
|
||||
|
||||
private static void addJewel(User user, int equipId, List<CommonProto.Equip> jewelList) {
|
||||
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);
|
||||
int itemType = item.getItemType();
|
||||
String msgTem = "lamp_lottery_equip_content";
|
||||
// 属性道具
|
||||
if(ifPropertyItem(itemType)){
|
||||
PropertyItem equip = new PropertyItem(user.getId(),equipId);
|
||||
equipManager.addEquip(equip);
|
||||
jewelList.add(CBean2Proto.getPropertyEquipProto(equip));
|
||||
}
|
||||
equipManager.addEquip(equip);
|
||||
jewelList.add(CBean2Proto.getPropertyEquipProto(equip));
|
||||
// 走马灯
|
||||
if (item.getQuantity() >= SSpecialConfig.getIntegerValue(msgTem+"_parm")) {
|
||||
try {
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
String nameColor = user.getPlayerInfoManager().getNameColor();
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert(msgTem, new Object[]{nameColor, nickName, equipQulityNameMap.get(item.getQuantity()), item.getName()}, new int[]{0,0,1,1});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(equipId),0,0,0,0,0);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("发送通知报错:{}",e.getMessage());
|
||||
}
|
||||
int quantity = item.getQuantity();
|
||||
int value = SSpecialConfig.getIntegerValue("lamp_lottery_equip_content_parm");
|
||||
if (quantity >= value) {
|
||||
String content = "lamp_lottery_equip_content";
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
String nameColor = user.getPlayerInfoManager().getNameColor();
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert(content, new Object[]{nameColor, nickName, equipQulityNameMap.get(quantity), item.getName()}, new int[]{0,0,1,1});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(equipId),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,21 +18,17 @@ public class SEquipTalismana implements BaseConfig {
|
|||
|
||||
private int[][] rankupBasicMaterial;
|
||||
|
||||
private int[][] rankupConsumeMaterial;
|
||||
|
||||
private int[][] property;
|
||||
|
||||
private int[][] specialProperty;
|
||||
|
||||
private int[][] specialSkill;
|
||||
|
||||
private int[] openSkillRules;
|
||||
|
||||
private int[][] resolve;
|
||||
private int[][] jobSkill;
|
||||
|
||||
public static Map<Integer,SEquipTalismana> equipTalismanaMap ;
|
||||
private int[][] heroSkill;
|
||||
|
||||
public static Map<Integer,Map<Integer,SEquipTalismana>> equipTalismanaStarMap;
|
||||
public static Map<Integer,SEquipTalismana> equipTalismanaMap = new HashMap<>();
|
||||
|
||||
public static Map<Integer,Map<Integer,SEquipTalismana>> equipTalismanaStarMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
@ -42,9 +38,6 @@ public class SEquipTalismana implements BaseConfig {
|
|||
equipTalismanaStarMap.computeIfAbsent(entry.getValue().getTalismanaId(),v->new TreeMap<>()).put(entry.getValue().getLevel(),entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
|
@ -62,27 +55,19 @@ public class SEquipTalismana implements BaseConfig {
|
|||
return rankupBasicMaterial;
|
||||
}
|
||||
|
||||
public int[][] getRankupConsumeMaterial() {
|
||||
return rankupConsumeMaterial;
|
||||
}
|
||||
|
||||
public int[][] getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public int[][] getSpecialProperty() {
|
||||
return specialProperty;
|
||||
}
|
||||
|
||||
public int[] getOpenSkillRules() {
|
||||
return openSkillRules;
|
||||
}
|
||||
|
||||
public int[][] getSpecialSkill() {
|
||||
return specialSkill;
|
||||
public int[][] getJobSkill() {
|
||||
return jobSkill;
|
||||
}
|
||||
|
||||
public int[][] getResolve() {
|
||||
return resolve;
|
||||
public int[][] getHeroSkill() {
|
||||
return heroSkill;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue