Merge branch 'master_test_gn' into master_test_gn_feisheng
commit
e8fd75b925
|
@ -203,6 +203,12 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
rpcArenaManager.setPracticeSkillMap(user.getHeroManager().getPracticeSkillMap());
|
||||
rpcArenaManager.setFaBaoGongMingSkillMap(user.getHeroManager().getFaBaoGongMingSkillMap());
|
||||
rpcArenaManager.setMaxHistoryForce(user.getPlayerInfoManager().getMaxForce());
|
||||
// 身外化身数据
|
||||
List<Integer> list = user.getHeroManager().getTransformationList().values().stream()
|
||||
.filter(v -> v.getStatus() == 1)
|
||||
.mapToInt(TransformationInfo::getCardId)
|
||||
.boxed().collect(Collectors.toList());
|
||||
rpcArenaManager.setTfInfoList(list);
|
||||
LOGGER.info("跨服,获取玩家英雄信息耗时:{}ms",TimeUtils.now()-start);
|
||||
return rpcArenaManager;
|
||||
}catch (Exception e){
|
||||
|
|
|
@ -74,6 +74,7 @@ public enum FunctionIdEnum {
|
|||
Likable(114,null),//好感度
|
||||
GodSoul(116,null),//神魂
|
||||
FaBaoSoul(119,null),//法宝聚灵
|
||||
LifeGrid(122,null),//命格
|
||||
WeekGood(9091,null),
|
||||
;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class ChampionFunction implements FunctionManager {
|
|||
return;
|
||||
}
|
||||
ChampionshipLogic.start();
|
||||
Poster.getPoster().dispatchEvent(new FunctionRefreshEvent(FunctionIdEnum.Arena.getFunctionType(),-1));
|
||||
// Poster.getPoster().dispatchEvent(new FunctionRefreshEvent(FunctionIdEnum.TopBattle.getFunctionType(),-1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -373,7 +373,10 @@ public interface BIReason {
|
|||
int FABAO_SOUL_UP_COST =1223;//法宝之魂升级消耗
|
||||
|
||||
int TRANSFORMATION_CARD_COST = 1224;//变身卡激活消耗
|
||||
|
||||
|
||||
int BUY_GOOD_ITEM_COST =1225;//妖晶购买道具消耗
|
||||
int BUY_GOOD_ITEM_GET =1226;//妖晶购买道具获得
|
||||
int LIFE_STONE_UP = 1227;//命石合成
|
||||
|
||||
int GM_COST = 1228;//gm删除道具
|
||||
}
|
|
@ -29,5 +29,6 @@ public interface GlobalGm {
|
|||
// int POKEMAN_MAX = 22;//一键获得所有满级异妖
|
||||
int HARD_STAGE =25;//一键通关山河社稷图特定关卡之前的所有关卡
|
||||
int FOUR_SPIRITS =26;//一键通关山河社稷图特定关卡之前的所有关卡
|
||||
int CLEAR_ITEM=27;//批量清除道具
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public interface GlobalItemType {
|
|||
int MOUNT_FRAGMENTS_ITEM = 28;//坐骑碎片
|
||||
int TRANSFORMATION_CARD = 29;//化身卡
|
||||
int TRUMP_CHIP=30;//法宝碎片(法宝聚灵使用)
|
||||
int LIFE_STONE=31;//命石
|
||||
int HOOK_PROP=32;//挂机奖励资源道具
|
||||
//物品使用类型
|
||||
int NO_USE = 0 ; //不使用
|
||||
|
|
|
@ -102,7 +102,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
// if(!GameApplication.serverProperties.isDebug()){
|
||||
// throw new ErrorCodeException("In a formal setting");
|
||||
// }
|
||||
if (!command.contains("#") || command.split("#").length < 3) {
|
||||
if (!command.contains("#") || command.split("#").length < 2) {
|
||||
LOGGER.error("wrong command :" + command);
|
||||
return;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
if (gmCommandType == GlobalGm.RESET_USER_NAME){
|
||||
prarm3 = commandArray[2];
|
||||
}else{
|
||||
if(gmCommandType!=GlobalGm.TIME_INFO){
|
||||
if(gmCommandType!=GlobalGm.TIME_INFO&&gmCommandType!=GlobalGm.CLEAR_ITEM){
|
||||
prarm2 = Integer.parseInt(commandArray[2]);
|
||||
}
|
||||
}
|
||||
|
@ -471,11 +471,20 @@ public class GMRequestHandler extends BaseHandler{
|
|||
prarm2 = Integer.parseInt(commandArray[2]);
|
||||
cUser.getPlayerInfoManager().updateFourChallengeByIndex(prarm1, prarm2);
|
||||
break;
|
||||
case GlobalGm.CLEAR_ITEM:
|
||||
Map<Integer,Long>costMap=new HashMap<>();
|
||||
for (int i = 1; i < commandArray.length; i++) {
|
||||
Item item=cUser.getItemManager().getItem(Integer.parseInt(commandArray[i]));
|
||||
if (item!=null){
|
||||
costMap.put(item.getItemId(),item.getItemNum());
|
||||
}
|
||||
}
|
||||
ItemUtil.itemCostLong(cUser, costMap, BIReason.GM_COST, GlobalGm.CLEAR_ITEM);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
try {
|
||||
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
|
||||
LOGGER.info("back to client!");
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -313,6 +313,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setXiuweiLevel(heroManager.getXiuweiLevel())
|
||||
.addAllPracticeSkillInfos(practiceSkillInfos)
|
||||
.addAllFaBaoSoulInfos(faBaoSoulInfos)
|
||||
.addAllLifeGridInfos(getLifeGridInfos(heroManager))
|
||||
.build();
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.APP_LOGIN.getType());
|
||||
try {
|
||||
|
@ -465,6 +466,26 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
return faBaoSoulInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化获取命格数据
|
||||
* @param heroManager
|
||||
* @return
|
||||
*/
|
||||
private List<CommonProto.LifeGridInfo>getLifeGridInfos(HeroManager heroManager){
|
||||
List<CommonProto.LifeGridInfo>lifeGridInfos=new ArrayList<>();
|
||||
for (Map.Entry<Integer, Map<Integer,Integer>> entry : heroManager.getLifeGridMap().entrySet()) {
|
||||
for (Map.Entry<Integer, Integer> indexById : entry.getValue().entrySet()) {
|
||||
CommonProto.LifeGridInfo info=CommonProto.LifeGridInfo.newBuilder()
|
||||
.setGridId(entry.getKey())
|
||||
.setGridIndex(indexById.getKey())
|
||||
.setItemId(indexById.getValue())
|
||||
.build();
|
||||
lifeGridInfos.add(info);
|
||||
}
|
||||
}
|
||||
return lifeGridInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化英雄星级map(针对老号)
|
||||
* @param user
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
|
@ -12,6 +14,8 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
|||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCHero;
|
||||
import config.SGlobalSystemConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
@ -33,6 +37,11 @@ public class HeroGodSoulBindRequestHandler extends BaseHandler<HeroInfoProto.Her
|
|||
List<String>bindHeroList= proto.getBindHerosList();
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.GodSoul.getFunctionType());
|
||||
if (!HandlerLogicThread.checkOpen(user, sGlobalSystemConfig)) {
|
||||
LOGGER.error("等级不足功能尚未开启");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
HeroManager heroManager= user.getHeroManager();
|
||||
Hero upHero=heroManager.getHero(heroId);
|
||||
SCHero heroConfig=SCHero.getsCHero().get(upHero.getTemplateId());
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.common.mogodb.util.GlobalData;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
|
@ -14,6 +16,7 @@ import com.ljsd.jieling.network.session.ISession;
|
|||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
@ -40,7 +43,11 @@ public class HeroUpLikableRequestHandler extends BaseHandler<HeroInfoProto.HeroU
|
|||
|
||||
User user = UserManager.getUser(uid);
|
||||
HeroManager heroManager=user.getHeroManager();
|
||||
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Likable.getFunctionType());
|
||||
if (!HandlerLogicThread.checkOpen(user, sGlobalSystemConfig)) {
|
||||
LOGGER.error("等级不足功能尚未开启");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
if (itemNum+heroManager.getLikableSendTime()> SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)){
|
||||
LOGGER.error("好感度赠送次数超出每日限制");
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SGlobalSystemConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 命格命石穿戴/卸下
|
||||
*/
|
||||
@Component
|
||||
public class LifeGridChangeRequestHandler extends BaseHandler<HeroInfoProto.LifeGridChangeRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.LIFE_GRID_CHANGE_REQUEST;
|
||||
}
|
||||
@Override
|
||||
public void processWithProto(ISession session, HeroInfoProto.LifeGridChangeRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.LifeGrid.getFunctionType());
|
||||
if (!HandlerLogicThread.checkOpen(user, sGlobalSystemConfig)) {
|
||||
LOGGER.error("等级不足功能尚未开启");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
int type=proto.getType();
|
||||
int position=proto.getPosition();
|
||||
int index=proto.getIndex();
|
||||
int itemId=proto.getLifeStoneId();
|
||||
HeroManager heroManager=user.getHeroManager();
|
||||
Map<Integer, Map<Integer,Integer>>lifeGridMap=heroManager.getLifeGridMap();
|
||||
HeroInfoProto.LifeGridChangeResponse response=null;
|
||||
if (type==1){//穿戴
|
||||
Map<Integer,Integer>instItemMap=new HashMap<>();
|
||||
instItemMap.put(itemId,1);
|
||||
boolean isTrue=ItemUtil.itemCost(user,instItemMap,BIReason.LIFE_STONE_UP,type);
|
||||
if (!isTrue){
|
||||
LOGGER.error("穿戴的命石未拥有");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
//更换
|
||||
if (lifeGridMap.containsKey(position)&&lifeGridMap.get(position).containsKey(index)&&lifeGridMap.get(position).get(index)>0){
|
||||
int unItemId=lifeGridMap.get(position).get(index);
|
||||
int[][]unItem=new int[1][2];
|
||||
unItem[0][0]=unItemId;
|
||||
unItem[0][1]=1;
|
||||
ItemUtil.drop(user,unItem, BIReason.LIFE_STONE_UP);
|
||||
}
|
||||
heroManager.setLifeGridMap(position,index,itemId);
|
||||
CommonProto.LifeGridInfo lifeGridInfo=CommonProto.LifeGridInfo.newBuilder()
|
||||
.setGridId(position)
|
||||
.setGridIndex(index)
|
||||
.setItemId(itemId)
|
||||
.build();
|
||||
response=HeroInfoProto.LifeGridChangeResponse.newBuilder().setLifeGridInfo(lifeGridInfo).build();
|
||||
}else{//卸下
|
||||
int unItemId= lifeGridMap.get(position).get(index);
|
||||
int[][]unItem=new int[1][2];
|
||||
unItem[0][0]=unItemId;
|
||||
unItem[0][1]=1;
|
||||
ItemUtil.drop(user,unItem, BIReason.LIFE_STONE_UP);
|
||||
heroManager.setLifeGridMap(position,index,0);
|
||||
CommonProto.LifeGridInfo lifeGridInfo=CommonProto.LifeGridInfo.newBuilder()
|
||||
.setGridId(position)
|
||||
.setGridIndex(index)
|
||||
.setItemId(0)
|
||||
.build();
|
||||
response=HeroInfoProto.LifeGridChangeResponse.newBuilder().setLifeGridInfo(lifeGridInfo).build();
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.LIFE_GRID_CHANGE_RESPONSE_VALUE,response,true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,327 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.ItemManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SGemConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 命石合成协议
|
||||
*/
|
||||
@Component
|
||||
public class LifeStoneUpRequestHandler extends BaseHandler<HeroInfoProto.LifeStoneUpRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.LIFE_STONE_UP_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession session, HeroInfoProto.LifeStoneUpRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int type = proto.getType();
|
||||
Map<Integer, Long> costItemMap = new HashMap<>();
|
||||
Map<Integer, Long> addItemMap = new HashMap<>();
|
||||
int equipLifeStoneId = 0;
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
//操作类型 1:批量合成 2:一键合成 3:命石单个合成 4:快速合成
|
||||
if (type == 1) {
|
||||
int itemId = proto.getCurGemId();
|
||||
int itemNum = proto.getSelectNum();
|
||||
SGemConfig gemConfig = STableManager.getConfig(SGemConfig.class).get(itemId);
|
||||
if (itemNum%gemConfig.getUpgradeNum()>0){
|
||||
itemNum=itemNum-(itemNum%gemConfig.getUpgradeNum());
|
||||
}
|
||||
long upNum = itemNum / gemConfig.getUpgradeNum();
|
||||
long costGold = upNum * gemConfig.getUpgradeCost()[1];
|
||||
costItemMap.put(gemConfig.getUpgradeCost()[0], costGold);
|
||||
costItemMap.put(itemId, (long) itemNum);
|
||||
addItemMap.put(gemConfig.getNextGem(), upNum);
|
||||
} else if (type == 2) {
|
||||
for (Map.Entry<Integer, TreeMap<Integer, SGemConfig>> integerTreeMapEntry : SGemConfig.gemConfigMapByType.entrySet()) {
|
||||
boolean isCost = LifeStoneAllUp(itemManager, integerTreeMapEntry.getValue(), costItemMap, addItemMap);
|
||||
if (!isCost) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (type == 3) {
|
||||
int itemId = proto.getCurGemId();
|
||||
int itemNum = proto.getSelectNum();
|
||||
SGemConfig gemConfig = STableManager.getConfig(SGemConfig.class).get(itemId);
|
||||
costItemMap.put(gemConfig.getUpgradeCost()[0], (long) gemConfig.getUpgradeCost()[1]);
|
||||
if (proto.getGridIndex() > 0) {
|
||||
costItemMap.put(itemId, (long) itemNum);
|
||||
equipLifeStoneId = gemConfig.getNextGem();
|
||||
} else {
|
||||
costItemMap.put(itemId, (long) itemNum + 1);
|
||||
addItemMap.put(gemConfig.getNextGem(), 1L);
|
||||
}
|
||||
|
||||
} else if (type == 4) {
|
||||
SGemConfig gemConfig = STableManager.getConfig(SGemConfig.class).get(proto.getCurGemId());
|
||||
TreeMap<Integer, SGemConfig> gemConfigMap = SGemConfig.gemConfigMapByType.get(gemConfig.getType());
|
||||
boolean isBag=proto.getGridIndex()<=0;//此字段判断是否在背包里进行快速合成
|
||||
if (LifeStoneQuickUp(itemManager, gemConfigMap, costItemMap, gemConfig.getLevel(),isBag)) {
|
||||
int[] curUpCost = gemConfig.getUpgradeCost();
|
||||
long allGoldCost = curUpCost[1];
|
||||
if (costItemMap.containsKey(curUpCost[0])){
|
||||
allGoldCost+=costItemMap.get(curUpCost[0]);
|
||||
}
|
||||
costItemMap.put(curUpCost[0], allGoldCost);
|
||||
if (isBag) {
|
||||
addItemMap.put(gemConfig.getNextGem(), 1L);
|
||||
if (costItemMap.containsKey(proto.getCurGemId())){
|
||||
long costNum=costItemMap.get(proto.getCurGemId())+1;
|
||||
costItemMap.put(proto.getCurGemId(),costNum);
|
||||
}else{
|
||||
costItemMap.put(proto.getCurGemId(),1L);
|
||||
}
|
||||
|
||||
} else {
|
||||
equipLifeStoneId = gemConfig.getNextGem();
|
||||
}
|
||||
} else {
|
||||
LOGGER.error("快速合成:命石合成材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
}
|
||||
if (costItemMap.isEmpty()) {
|
||||
LOGGER.error("命石合成异常,请联系后端");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
boolean isTrue = ItemUtil.itemCostLong(user, costItemMap, BIReason.LIFE_STONE_UP, type);
|
||||
if (!isTrue) {
|
||||
LOGGER.error("命石合成材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
HeroInfoProto.LifeStoneUpResponse.Builder response = HeroInfoProto.LifeStoneUpResponse.newBuilder();
|
||||
///大于0说明是在命格系统操作
|
||||
if (equipLifeStoneId > 0) {
|
||||
CommonProto.LifeGridInfo lifeGridInfo = CommonProto.LifeGridInfo.newBuilder()
|
||||
.setGridId(proto.getGridId())
|
||||
.setGridIndex(proto.getGridIndex())
|
||||
.setItemId(equipLifeStoneId)
|
||||
.build();
|
||||
response.setLifeGridInfo(lifeGridInfo);
|
||||
user.getHeroManager().setLifeGridMap(proto.getGridId(), proto.getGridIndex(), equipLifeStoneId);
|
||||
} else {
|
||||
long[][] addItem = ItemUtil.mapToLongArray(addItemMap);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, addItem, BIReason.LIFE_STONE_UP);
|
||||
response.setDrop(drop.build());
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.LIFE_STONE_UP_RESPONSE_VALUE, response.build(), true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 命石一键合成
|
||||
* @param itemManager
|
||||
* @param gemConfigMap
|
||||
* @param costItemMap
|
||||
* @param addItemMap
|
||||
* @return
|
||||
*/
|
||||
private boolean LifeStoneAllUp(ItemManager itemManager, TreeMap<Integer, SGemConfig> gemConfigMap, Map<Integer, Long> costItemMap, Map<Integer, Long> addItemMap) {
|
||||
long addCount = 0;//一个循环合成数量
|
||||
long costGoldNum = 0;//合成金币总消耗
|
||||
int costGoldId = gemConfigMap.get(1).getUpgradeCost()[0];//获取消耗材料id
|
||||
if (costItemMap.containsKey(costGoldId)) {
|
||||
costGoldNum = costItemMap.get(costGoldId);
|
||||
}
|
||||
int[]minCostArr=gemConfigMap.get(1).getUpgradeCost();
|
||||
if (itemManager.getItem(minCostArr[0]).getItemNum()-costGoldNum<minCostArr[1]){
|
||||
return false;
|
||||
}
|
||||
for (Map.Entry<Integer, SGemConfig> gemConfigEntry : gemConfigMap.entrySet()) {
|
||||
SGemConfig gemConfig = gemConfigEntry.getValue();
|
||||
///升到满级
|
||||
if (gemConfig.getNextGem() == 0) {
|
||||
if (addCount > 0) {
|
||||
addItemMap.put(gemConfig.getId(), addCount);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Item curItem = itemManager.getItem(gemConfig.getId());
|
||||
long costNum = addCount;
|
||||
if (curItem != null) {
|
||||
costNum = curItem.getItemNum() + addCount;
|
||||
}
|
||||
///命石不足
|
||||
if (costNum < gemConfig.getUpgradeNum()) {
|
||||
if (addCount > 0) {
|
||||
addItemMap.put(gemConfig.getId(), addCount);
|
||||
addCount = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
int stoneNum = gemConfig.getUpgradeNum();
|
||||
int[] costGold = gemConfig.getUpgradeCost();
|
||||
long remainNum = costNum % stoneNum;
|
||||
if (remainNum != 0) {
|
||||
costNum -= remainNum;
|
||||
}
|
||||
if (costNum <= 0) {
|
||||
continue;
|
||||
}
|
||||
//本次合成消耗
|
||||
long needCostGoldNum = costNum / stoneNum * costGold[1];
|
||||
long haveGoldNum = 0;
|
||||
if (itemManager.getItem(costGold[0]) != null) {
|
||||
haveGoldNum = itemManager.getItem(costGold[0]).getItemNum();
|
||||
}
|
||||
///金币不足情况中断合成
|
||||
if (needCostGoldNum + costGoldNum > haveGoldNum) {
|
||||
long upNum = (haveGoldNum - costGoldNum) / costGold[1];
|
||||
long endCostNum = upNum * stoneNum;
|
||||
long haveCostNum = endCostNum - addCount;
|
||||
if (haveCostNum > 0) {
|
||||
costItemMap.put(gemConfig.getId(), haveCostNum);
|
||||
} else {
|
||||
addItemMap.put(gemConfig.getId(), -haveCostNum);
|
||||
}
|
||||
addItemMap.put(gemConfig.getNextGem(), upNum);
|
||||
costGoldNum += upNum * costGold[1];
|
||||
//刷新消耗金币数量
|
||||
costItemMap.put(costGold[0], costGoldNum);
|
||||
return true;
|
||||
}
|
||||
//计算累计消耗金币
|
||||
costGoldNum += needCostGoldNum;
|
||||
if (curItem != null) {
|
||||
long bagCost = curItem.getItemNum() - remainNum;
|
||||
//刷新消耗命石数量
|
||||
costItemMap.put(gemConfig.getId(), bagCost);
|
||||
long addNum = remainNum - curItem.getItemNum();
|
||||
if (addNum > 0) {
|
||||
addItemMap.put(gemConfig.getId(), addNum);
|
||||
}
|
||||
}
|
||||
//保存累计消耗金币数量
|
||||
costItemMap.put(costGold[0], costGoldNum);
|
||||
|
||||
if (curItem == null) {
|
||||
addItemMap.put(gemConfig.getId(), remainNum);
|
||||
}
|
||||
addCount = costNum / stoneNum;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 命石快速合成
|
||||
* @param itemManager
|
||||
* @param gemConfigMap
|
||||
* @param costItemMap
|
||||
* @param selectGemLv
|
||||
* @return
|
||||
*/
|
||||
private boolean LifeStoneQuickUp(ItemManager itemManager, TreeMap<Integer, SGemConfig> gemConfigMap, Map<Integer, Long> costItemMap, int selectGemLv,boolean isBag) {
|
||||
long addCount = 0;//一个循环合成数量
|
||||
long costGoldNum = 0;//合成金币总消耗
|
||||
for (Map.Entry<Integer, SGemConfig> gemConfigEntry : gemConfigMap.entrySet()) {
|
||||
SGemConfig gemConfig = gemConfigEntry.getValue();
|
||||
Item curItem = itemManager.getItem(gemConfig.getId());
|
||||
if (gemConfig.getLevel()==selectGemLv){
|
||||
if (addCount>0||curItem==null){
|
||||
break;
|
||||
}
|
||||
///是否是在背包操作
|
||||
if (isBag){
|
||||
if (curItem.getItemNum()<gemConfig.getUpgradeNum()){
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (curItem.getItemNum()<gemConfig.getUpgradeNum()-1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
costItemMap.put(gemConfig.getId(),1L);
|
||||
addCount=1;
|
||||
break;
|
||||
}
|
||||
///如果命石等级大于当前选中的命石等级跳过
|
||||
if (gemConfig.getLevel() > selectGemLv) {
|
||||
break;
|
||||
}
|
||||
|
||||
long costNum = addCount;
|
||||
if (curItem != null) {
|
||||
costNum = curItem.getItemNum() + addCount;
|
||||
}
|
||||
int[] costGold = gemConfig.getUpgradeCost();
|
||||
int stoneNum = gemConfig.getUpgradeNum();
|
||||
if (costNum < stoneNum) {
|
||||
costItemMap.clear();
|
||||
costGoldNum = 0;
|
||||
addCount = 0;
|
||||
continue;
|
||||
}
|
||||
long needNum = GetNeedLifeStoneNum(gemConfig.getType(), gemConfig.getLevel(), selectGemLv);
|
||||
//剩余数量
|
||||
long remainNum = costNum % stoneNum;
|
||||
if (costNum > needNum) {
|
||||
remainNum = costNum - needNum;
|
||||
costNum = needNum;
|
||||
}
|
||||
addCount = costNum / stoneNum;
|
||||
//本次合成消耗金币
|
||||
long needCostGoldNum = addCount * costGold[1];
|
||||
//计算累计消耗金币
|
||||
costGoldNum += needCostGoldNum;
|
||||
costItemMap.put(costGold[0], costGoldNum);
|
||||
if (curItem != null) {
|
||||
long bagCost = curItem.getItemNum() - remainNum;
|
||||
//刷新消耗命石数量
|
||||
costItemMap.put(gemConfig.getId(), bagCost);
|
||||
}
|
||||
long haveGoldNum = itemManager.getItem(costGold[0]).getItemNum();
|
||||
if (costGoldNum > haveGoldNum) {
|
||||
LOGGER.error("命石快速合成金币不足");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return addCount == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取升级到目标等级获取消耗指定命石需要数量
|
||||
* @param stoneType 命石类型
|
||||
* @param costStoneLv 消耗命石等级
|
||||
* @param targetStoneLv 目标等级
|
||||
* @return
|
||||
*/
|
||||
private long GetNeedLifeStoneNum(int stoneType, int costStoneLv, int targetStoneLv) {
|
||||
long needNum = 1;
|
||||
TreeMap<Integer, SGemConfig> stoneLvMap = SGemConfig.gemConfigMapByType.get(stoneType);
|
||||
for (Map.Entry<Integer, SGemConfig> gemConfigEntry : stoneLvMap.entrySet()) {
|
||||
if (gemConfigEntry.getKey() < costStoneLv) {
|
||||
continue;
|
||||
}
|
||||
if (gemConfigEntry.getValue().getLevel() == targetStoneLv) {
|
||||
break;
|
||||
}
|
||||
needNum *= gemConfigEntry.getValue().getUpgradeNum();
|
||||
}
|
||||
return needNum;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,22 +5,18 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.SixiangProfessionInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SFourQuadrantConfig;
|
||||
import config.SPlayerSkill;
|
||||
import config.SXiuXian;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.PracticeSkillUpRequest> {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
|
@ -9,12 +11,11 @@ import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
|||
import com.ljsd.jieling.logic.dao.SixiangProfessionInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SFourQuadrantConfig;
|
||||
import config.SXiuXian;
|
||||
import config.SGlobalSystemConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
|
@ -37,6 +38,11 @@ public class SixiangUpRequestHandler extends BaseHandler<HeroInfoProto.SixiangUp
|
|||
int uid = session.getUid();
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.FourQua.getFunctionType());
|
||||
if (!HandlerLogicThread.checkOpen(user, sGlobalSystemConfig)) {
|
||||
LOGGER.error("等级不足功能尚未开启");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
SixiangProfessionInfo professionInfo = user.getHeroManager().getSixiangDataMap().get(professionId);
|
||||
if (CheckCurUpIsLimit(professionInfo)) {
|
||||
throw new ErrorCodeException(ErrorCode.SIXIANG_UP_LIMIT);
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
|||
import com.ljsd.jieling.logic.dao.SixiangProfessionInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.eventhandler.IFightEventProcesor;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
|
|
@ -18,7 +18,9 @@ import config.SActivityRewardConfig;
|
|||
import config.SRechargeCommodityNewConfig;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
class NewRechargeSumDayActivity extends AbstractActivity {
|
||||
|
||||
|
@ -81,4 +83,20 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<Integer> getCloseGoods(User user) {
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null) {
|
||||
return set;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> progressInfoEntry : map.entrySet()) {
|
||||
SActivityRewardConfig rewardConfig = SActivityRewardConfig.getsActivityRewardConfigByMissionId(progressInfoEntry.getKey());
|
||||
if (progressInfoEntry.getValue().getState() == ActivityType.HAD_TAKED || (progressInfoEntry.getValue().getState() == ActivityType.WILL_TAKE && mission.getV() + 1 != rewardConfig.getSort())) {
|
||||
set.add(rewardConfig.getValues()[0][0]);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,6 +167,24 @@ public class HeroManager extends MongoBase {
|
|||
return faBaoGongMingSkillMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 命格数据
|
||||
*/
|
||||
private Map<Integer,Map<Integer,Integer>>LifeGridMap=new HashMap<>();
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getLifeGridMap() {
|
||||
return LifeGridMap;
|
||||
}
|
||||
|
||||
///设置命格数据
|
||||
public void setLifeGridMap(int gridId,int index,int itemId) {
|
||||
if (!LifeGridMap.containsKey(gridId)) {
|
||||
LifeGridMap.put(gridId, new HashMap<>());
|
||||
}
|
||||
LifeGridMap.get(gridId).put(index,itemId);
|
||||
updateString("LifeGridMap."+gridId, LifeGridMap.get(gridId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 心愿可以选择的英雄列表
|
||||
*/
|
||||
|
|
|
@ -45,7 +45,7 @@ public class UserManager {
|
|||
private static Map<Integer,Long> userMapPutTime = new ConcurrentHashMap<>(); //离线读入
|
||||
private static AtomicInteger login_f_num = new AtomicInteger(0);//登陆计数
|
||||
private static final int LOGIN_F_LIMIT = 100;//报警界限
|
||||
private static final long LIVE_TIME = 12 * 60 * 60 * 1000L;
|
||||
private static final long LIVE_TIME = 3 * 60 * 60 * 1000L;
|
||||
|
||||
public static void addUser(User user) {
|
||||
userMap.put(user.getId(), user);
|
||||
|
|
|
@ -466,7 +466,6 @@ public class FightUtil {
|
|||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
int i = 0;
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
|
|
|
@ -2673,7 +2673,7 @@ public class HeroLogic {
|
|||
//英雄皮肤加成 记得判断皮肤过期
|
||||
int skin = hero.getSkin();
|
||||
if (skin != 0) {
|
||||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
Map<Integer, Integer> skinInfo = heroManager.getSkinInfo();
|
||||
SHeroSkin sHeroSkin = SHeroSkin.skinMapByType.get(skin);
|
||||
if (sHeroSkin != null && sHeroSkin.getMonomerProperty() != null && sHeroSkin.getMonomerProperty().length > 0) {
|
||||
if (skinInfo.containsKey(skin) && (skinInfo.get(skin) == -1 || skinInfo.get(skin) > TimeUtils.nowInt())) {
|
||||
|
@ -2703,7 +2703,7 @@ public class HeroLogic {
|
|||
combinedAttribute(SPlayerHeadIcon.getHeadIconMap().get(entry.getKey()).getUnlockProperty(), heroAllAttribute);
|
||||
}
|
||||
//四象心法加成
|
||||
for (Map.Entry<Integer, SixiangProfessionInfo> entry : user.getHeroManager().getSixiangDataMap().entrySet()) {
|
||||
for (Map.Entry<Integer, SixiangProfessionInfo> entry :heroManager.getSixiangDataMap().entrySet()) {
|
||||
if (scHero.getProfession() != entry.getKey()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -2711,22 +2711,22 @@ public class HeroLogic {
|
|||
Map<Integer, Integer> propertyMap = entry.getValue().propertyMap;
|
||||
int[][] propArr = ItemUtil.mapToArray(propertyMap);
|
||||
combinedAttribute(propArr, heroAllAttribute);
|
||||
if (user.getHeroManager().getSixiangPropUpMap().containsKey(entry.getKey())) {
|
||||
if (heroManager.getSixiangPropUpMap().containsKey(entry.getKey())) {
|
||||
//进阶属性
|
||||
Map<Integer, Integer> upStarPropertyMap = user.getHeroManager().getSixiangPropUpMap().get(entry.getKey());
|
||||
Map<Integer, Integer> upStarPropertyMap = heroManager.getSixiangPropUpMap().get(entry.getKey());
|
||||
int[][] upStarProp = ItemUtil.mapToArray(upStarPropertyMap);
|
||||
combinedAttribute(upStarProp, heroAllAttribute);
|
||||
}
|
||||
}
|
||||
///四象心法共鸣属性加成
|
||||
if (user.getHeroManager().GetSiXiangGongMingLv() > 0) {
|
||||
SFourQuadrantConfig fourConfig = SFourQuadrantConfig.configByStrtMap.get(user.getHeroManager().GetSiXiangGongMingLv());
|
||||
if (heroManager.GetSiXiangGongMingLv() > 0) {
|
||||
SFourQuadrantConfig fourConfig = SFourQuadrantConfig.configByStrtMap.get(heroManager.GetSiXiangGongMingLv());
|
||||
combinedAttribute(fourConfig.getPropResonance(), heroAllAttribute);
|
||||
}
|
||||
|
||||
///四象心法技能属性加成
|
||||
Map<Integer, Integer> skillPropertyMap = new HashMap<>();
|
||||
for (Map.Entry<Integer, SixiangProfessionInfo> entry : user.getHeroManager().getSixiangDataMap().entrySet()) {
|
||||
for (Map.Entry<Integer, SixiangProfessionInfo> entry : heroManager.getSixiangDataMap().entrySet()) {
|
||||
if (entry.getValue().level > 0) {
|
||||
SFourQuadrantConfig fourConfig = SFourQuadrantConfig.configByStrtMap.get(entry.getValue().level);
|
||||
int[] skillAddProp = fourConfig.getSkill()[entry.getKey() - 1];
|
||||
|
@ -2737,25 +2737,36 @@ public class HeroLogic {
|
|||
combinedAttribute(skillProp, heroAllAttribute);
|
||||
|
||||
//英雄好感度属性加成
|
||||
if (user.getHeroManager().getHeroLikablePropAddMap().containsKey(scHero.getId())) {
|
||||
int[][] likableProp = ItemUtil.mapToArray(user.getHeroManager().getHeroLikablePropAddMap().get(scHero.getId()));
|
||||
if (heroManager.getHeroLikablePropAddMap().containsKey(scHero.getId())) {
|
||||
int[][] likableProp = ItemUtil.mapToArray(heroManager.getHeroLikablePropAddMap().get(scHero.getId()));
|
||||
combinedAttribute(likableProp, heroAllAttribute);
|
||||
}
|
||||
//英雄总好感度属性加成
|
||||
if (user.getHeroManager().getAllLikablePropAddMap().size() > 0) {
|
||||
int[][] allLikableProp = ItemUtil.mapToArray(user.getHeroManager().getAllLikablePropAddMap());
|
||||
if (heroManager.getAllLikablePropAddMap().size() > 0) {
|
||||
int[][] allLikableProp = ItemUtil.mapToArray(heroManager.getAllLikablePropAddMap());
|
||||
combinedAttribute(allLikableProp, heroAllAttribute);
|
||||
}
|
||||
|
||||
///法宝之魂属性加成
|
||||
for (Map.Entry<Integer, Integer> faBaoSoulEntry : user.getHeroManager().getFaBaoSoulMap().entrySet()) {
|
||||
for (Map.Entry<Integer, Integer> faBaoSoulEntry :heroManager.getFaBaoSoulMap().entrySet()) {
|
||||
STrump trumpConfig = STrump.sTrumpMap.get(faBaoSoulEntry.getKey());
|
||||
STrumpLevelupPool lvUpProps = STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(faBaoSoulEntry.getValue());
|
||||
combinedAttribute(lvUpProps.getLvupProps(), heroAllAttribute);
|
||||
}
|
||||
|
||||
///命格属性加成
|
||||
for (Map.Entry<Integer, Map<Integer, Integer>> lifeGridMapEntry : heroManager.getLifeGridMap().entrySet()) {
|
||||
for (Map.Entry<Integer, Integer> entry : lifeGridMapEntry.getValue().entrySet()) {
|
||||
int lifeStoneId=entry.getValue();
|
||||
if (lifeStoneId>0){
|
||||
SGemConfig sGemConfig=STableManager.getConfig(SGemConfig.class).get(lifeStoneId);
|
||||
combinedAttribute(sGemConfig.getProperty(), heroAllAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 身外化身加成
|
||||
Map<Integer, TransformationInfo> transformationList = user.getHeroManager().getTransformationList();
|
||||
Map<Integer, TransformationInfo> transformationList = heroManager.getTransformationList();
|
||||
Map<Integer, SChangingCard> changingCardMap = STableManager.getConfig(SChangingCard.class);
|
||||
int[][] arrayValue = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.PER_CHANGING_CART_PROP);
|
||||
for (TransformationInfo info : transformationList.values()) {
|
||||
|
@ -2770,7 +2781,7 @@ public class HeroLogic {
|
|||
|
||||
//装备总战力评分
|
||||
int equipForce = 0;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(heroManager).entrySet().iterator();
|
||||
// 套装list初始化
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
while (iterator.hasNext()) {
|
||||
|
@ -4083,10 +4094,18 @@ public class HeroLogic {
|
|||
}
|
||||
// 卸下魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
for (Integer value : soulEquipByPositionMap.values()) {
|
||||
dropMap.put(value, 1);
|
||||
Map<Integer, Integer> hunying = null;
|
||||
if (!soulEquipByPositionMap.isEmpty()) {
|
||||
hunying = new HashMap<>(soulEquipByPositionMap.size());
|
||||
Set<Integer> unload = new HashSet<>(soulEquipByPositionMap.size());
|
||||
for (Map.Entry<Integer, Integer> entry : soulEquipByPositionMap.entrySet()) {
|
||||
hunying.put(entry.getValue(), 1);
|
||||
unload.add(entry.getKey());
|
||||
}
|
||||
for (Integer integer : unload) {
|
||||
hero.removeSoulEquip(integer);
|
||||
}
|
||||
}
|
||||
|
||||
for (int[] ints : returnPercent) {
|
||||
for (int i = 1; i < ints.length; i++) {
|
||||
SHeroRankupGroup sHeroRankupGroup=STableManager.getConfig(SHeroRankupGroup.class).get(ints[i]);
|
||||
|
@ -4108,22 +4127,13 @@ public class HeroLogic {
|
|||
}
|
||||
ItemUtil.itemCost(user, cost, BIReason.HERO_RETURN, hero.getTemplateId());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(dropMap), BIReason.HERO_RETURN);
|
||||
if (!soulEquipByPositionMap.isEmpty()) {
|
||||
List<CommonProto.Item> itemlistList = drop.getItemlistList();
|
||||
Set<Integer> needRemove = new HashSet<>(soulEquipByPositionMap.size());
|
||||
for (int i = 0; i < itemlistList.size(); i++) {
|
||||
CommonProto.Item item = itemlistList.get(i);
|
||||
if (soulEquipByPositionMap.values().contains(item.getItemId())) {
|
||||
needRemove.add(i);
|
||||
}
|
||||
}
|
||||
for (Integer index : needRemove) {
|
||||
drop.removeItemlist(index);
|
||||
}
|
||||
if (hunying != null) {
|
||||
ItemUtil.drop(user, ItemUtil.mapToArray(hunying), BIReason.HERO_RETURN);
|
||||
}
|
||||
hero.setLevel(1);
|
||||
hero.setBreakId(0);
|
||||
hero.setStar(5);
|
||||
hero.setStarBreakId(0);
|
||||
//鸿蒙阵
|
||||
addOrUpdateHongmeng(session);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
|
|
|
@ -233,6 +233,7 @@ public class StoreLogic implements IEventHandler {
|
|||
StoreInfo storeInfo = it.next().getValue();
|
||||
SStoreTypeConfig sStoreTypeConfig = SStoreTypeConfig.getsStoreTypeConfigMap().get(storeInfo.getId());
|
||||
if(null == sStoreTypeConfig){
|
||||
removeStoreIds.add(storeInfo.getId());
|
||||
continue;
|
||||
}
|
||||
if (sStoreTypeConfig.getStoreOpenRule() ==2 || sStoreTypeConfig.getStoreOpenRule() ==5 || sStoreTypeConfig.getStoreOpenRule() ==6 || sStoreTypeConfig.getStoreOpenRule() ==7){
|
||||
|
|
|
@ -591,6 +591,7 @@ public class ItemUtil {
|
|||
case GlobalItemType.LikableCostItem:
|
||||
case GlobalItemType.MOUNT_FRAGMENTS_ITEM:
|
||||
case GlobalItemType.TRUMP_CHIP:
|
||||
case GlobalItemType.LIFE_STONE:
|
||||
case GlobalItemType.TRANSFORMATION_CARD:
|
||||
case GlobalItemType.HOOK_PROP:
|
||||
itemType = GlobalItemType.ITEM;
|
||||
|
@ -1416,17 +1417,16 @@ public class ItemUtil {
|
|||
// 鸿蒙阵推送
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
if (reason == BIReason.HERO_RETURN) {
|
||||
return;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
|
||||
if (!message.isEmpty()){
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(hero.getTemplateId()),0,0,0,0,0);
|
||||
if (reason != BIReason.HERO_RETURN) {
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
|
||||
if (!message.isEmpty()){
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(hero.getTemplateId()),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,reason,GlobalsDef.addReason,cardId,1,heroStar[1]);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_HERO.getType(),String.valueOf(cardId),String.valueOf(hero.getStar()),String.valueOf(reason));
|
||||
}
|
||||
|
@ -1458,15 +1458,6 @@ public class ItemUtil {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean itemCostLong(User user,Map<Integer, Long> costItems,int reason,int subReson) throws Exception {
|
||||
boolean result = checkCostLong(user, costItems);
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
useItemLong(user, costItems,reason,subReson);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean itemCost(User user,int[][] costItems,int times,int reason,int subReason) throws Exception {
|
||||
Map<Integer, Integer> itemMap = new HashMap<>();
|
||||
selectCost(costItems,itemMap,times);
|
||||
|
@ -1478,6 +1469,15 @@ public class ItemUtil {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean itemCostLong(User user,Map<Integer, Long> costItems,int reason,int subReson) throws Exception {
|
||||
boolean result = checkCostLong(user, costItems);
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
useItemLong(user, costItems,reason,subReson);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean checkCost(User user, Map<Integer, Integer> itemMap) throws Exception {
|
||||
HashMap<Integer, Long> longMap = new HashMap<>();
|
||||
itemMap.forEach((k,v)->longMap.put(k,v.longValue()));
|
||||
|
|
|
@ -180,6 +180,9 @@ public abstract class TaskKit {
|
|||
// 最佳的线程数 = CPU可用核心数 / (1 - 阻塞系数)
|
||||
// TODO 阻塞系数是不是需要有个setter方法能让使用者自由设置呢?
|
||||
num = (int)(cores / (1 - 0.9));
|
||||
if (num > 8) {
|
||||
num = 8;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
// 异常发生时姑且返回10个任务线程池
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@Table(name ="GemConfig")
|
||||
public class SGemConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int quality;
|
||||
|
||||
private int type;
|
||||
|
||||
private int level;
|
||||
|
||||
private int[][] property;
|
||||
|
||||
private int upgradeNum;
|
||||
|
||||
private int[] upgradeCost;
|
||||
|
||||
private int nextGem;
|
||||
|
||||
public static TreeMap<Integer, TreeMap<Integer,SGemConfig>>gemConfigMapByType;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
gemConfigMapByType=new TreeMap<>();
|
||||
Map<Integer, SGemConfig> config = STableManager.getConfig(SGemConfig.class);
|
||||
for(SGemConfig sGemConfig : config.values()){
|
||||
if (!gemConfigMapByType.containsKey(sGemConfig.getType())){
|
||||
TreeMap<Integer,SGemConfig>lvMap=new TreeMap<>();
|
||||
gemConfigMapByType.put(sGemConfig.getType(),lvMap);
|
||||
}
|
||||
gemConfigMapByType.get(sGemConfig.getType()).put(sGemConfig.getLevel(),sGemConfig);
|
||||
}
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return quality;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int[][] getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public int getUpgradeNum() {
|
||||
return upgradeNum;
|
||||
}
|
||||
|
||||
public int[] getUpgradeCost() {
|
||||
return upgradeCost;
|
||||
}
|
||||
|
||||
public int getNextGem() {
|
||||
return nextGem;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue