Merge branch 'master_dev' into master_haizei
commit
2b90935be3
|
@ -2,22 +2,19 @@ package com.ljsd.fight;
|
|||
|
||||
public enum FightType {
|
||||
CrossLuofuFight(0),//跨服罗浮争锋
|
||||
StoryFight(1), //故事副本
|
||||
StoryFight(1), //故事副本(主线)
|
||||
MapExploreFight(2), // 地图探索
|
||||
ArenaFight(3), //竞技场
|
||||
InvasionBossFight(4),//秘境boss
|
||||
AdventureLock(5), // 解锁秘境
|
||||
GuildFight(6), // 公会站
|
||||
BloodyFight(7), // 血战
|
||||
MonterFight(8), // 兽潮
|
||||
MonterFight(8), // 兽潮(心魔试炼)
|
||||
TOPFight(9), // 巅峰赛
|
||||
GuildBossFight(10), // 工会boss
|
||||
|
||||
|
||||
CarBossFight(11), // 车迟斗法挑战boss
|
||||
CarPersonFight(12), // 车迟斗法抢夺
|
||||
|
||||
EXPEDITION(13), // 远征
|
||||
EXPEDITION(13), // 远征(大闹天宫)
|
||||
GuildChallenge(14), //公会副本
|
||||
NewGeneral(15),//新将
|
||||
TenDespairArray(16),//十绝阵
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -158,7 +158,7 @@ end
|
|||
|
||||
-- 判断是否命中
|
||||
function Skill:CheckTargetIsHit(role)
|
||||
if role==nil then
|
||||
if role == nil then
|
||||
return false
|
||||
end
|
||||
return self.effectCaster:CheckTargetIsHit(role)
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
v1.0.151
|
||||
v1.0.153
|
||||
1.同步战斗提jiao
|
||||
v1.0.152
|
||||
1.同步战斗提jiao
|
||||
v1.0.151
|
||||
1.同步战斗提jiao
|
||||
v1.0.150
|
||||
1.同步战斗提jiao
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -86,7 +86,7 @@ public class ChatLogic {
|
|||
chatInfoList.add(CBean2Proto.getChatInfoBuilder(user, message,time,0));
|
||||
}
|
||||
}
|
||||
if (hmget!= null && hmget.size() != 0){
|
||||
if (hmget!= null && !hmget.isEmpty()){
|
||||
//取出数据好友聊天数据后删除
|
||||
RedisUtil.getInstence().del(GameApplication.serverId + RedisKey.CUser_Chat + uid);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class StartExpeditionBattleRequest extends BaseHandler<Expedition.StartEx
|
|||
}
|
||||
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误!!"));
|
||||
}
|
||||
|
||||
|
@ -108,13 +108,14 @@ public class StartExpeditionBattleRequest extends BaseHandler<Expedition.StartEx
|
|||
|
||||
|
||||
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
|
||||
int expeditionType = FightType.EXPEDITION.getType();
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(maxTime)
|
||||
.setFightSeed(seed)
|
||||
.setHeroFightInfos(fightTeamInfo)
|
||||
.addMonsterList(deffightTeamInfo)
|
||||
.setFightType(FightType.StoryFight.getType())
|
||||
.setFightId(FightUtil.getFightId(user.getId(), FightType.StoryFight.getType()))
|
||||
.setFightType(expeditionType)
|
||||
.setFightId(FightUtil.getFightId(user.getId(), expeditionType))
|
||||
.build();
|
||||
fightStartResponse.setFightData(fightData);
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.ljsd.GameApplication;
|
|||
import com.ljsd.jieling.db.mongo.AreaManager;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.handler.hero.FaBaoSoulUpLvRequestHandler;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
|
@ -144,7 +143,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
StoreLogic.getInstance().reloadStoreInfo(user,7);//重载功能商店
|
||||
ExplorerMapLogic.getInstance().calOfflineReward(user);//挂机探索
|
||||
// monthCardRefresh(user);//月卡特殊处理
|
||||
faBaoJuLingHandler(user);//法宝修改
|
||||
// faBaoJuLingHandler(user);//法宝修改
|
||||
//森罗幻境自动挂机返回掉落展示清除
|
||||
Map<Integer,Integer> dropShow = mapManager.getTowerGetRewardInfoShowMap();
|
||||
if(dropShow != null && !dropShow.isEmpty()){
|
||||
|
@ -221,7 +220,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setDailyredpack(playerInfoManager.getDailyWelfareRedPacket())
|
||||
.setRandomCount(randomCount)
|
||||
.addAllDrawTimes(CBean2Proto.getRandomTypeNums(user))
|
||||
.addAllHelpFightList(CBean2Proto.getHelpFightList(user))
|
||||
.addAllHelpFightList(CBean2Proto.getHelpHeroList(user))
|
||||
.addAllSixiangInfos(sixiangxinfaInfos)
|
||||
.setServerOpenTime((int) (openTime / 1000))
|
||||
.setXiuweiLevel(heroManager.getXiuweiLevel())
|
||||
|
@ -230,6 +229,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.addAllLifeGridInfos(getLifeGridInfos(heroManager))
|
||||
.addAllGiftIds(user.getPlayerInfoManager().getPlayerGiftEquipList())
|
||||
.addAllGemLotteryCountByDay(EquipLogic.getInstance().getGemLotteryCountByDay(userId))
|
||||
.setIsStart(PlayerLogic.getCrossStartWeek())
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
@ -429,11 +429,4 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
return lifeGridInfos;
|
||||
}
|
||||
|
||||
public static void faBaoJuLingHandler(User user) throws Exception {
|
||||
Set<Integer> keySet = user.getHeroManager().getFaBaoGongMingSkillMap().keySet();
|
||||
for (Integer bookId : keySet) {
|
||||
FaBaoSoulUpLvRequestHandler.updateFaBaoGongMingLv(user, bookId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.handler.gtw;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
|
@ -11,6 +10,7 @@ import com.ljsd.jieling.logic.arena.ArenaLogic;
|
|||
import com.ljsd.jieling.logic.arenaworld.ArenaWorldLogic;
|
||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
|
@ -44,24 +44,37 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, WorldProto.GetWorldArenaInfoRequest proto) throws Exception {
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.World_Arena.getFunctionType());
|
||||
|
||||
|
||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
|
||||
if(setting==null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
long before = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
long week = TimeUtils.AfterTimeByWeek(before, TimeUtils.now());
|
||||
builder.setIsStart((int) week);
|
||||
|
||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
|
||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
||||
if (timeControllerOfFunction == null){
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
int functionStartTime = (int)(timeControllerOfFunction.getStartTime() / 1000);
|
||||
int diff = TimeUtils.nowInt() - functionStartTime;
|
||||
if (diff > setting.getRestTime()[0] && diff < setting.getRestTime()[1]) {
|
||||
//多加1分钟 周期间隔后 client再发起请求
|
||||
builder.setEndTime(functionStartTime + setting.getRestTime()[1]+61);
|
||||
}
|
||||
else if (diff > setting.getBattleTime()[0] && diff < setting.getBattleTime()[1]) {
|
||||
builder.setEndTime(functionStartTime + setting.getBattleTime()[1]+10);
|
||||
}
|
||||
else {
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
|
||||
}
|
||||
|
||||
builder.setIsStart(PlayerLogic.getCrossStartWeek());
|
||||
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.World_Arena.getFunctionType());
|
||||
if (!GlobleSystemLogic.checkOpen(UserManager.getUser(iSession.getUid()),sGlobalSystemConfig)) {
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GetWorldArenaInfoResponse.getNumber(),builder.build(),true);
|
||||
return;
|
||||
}
|
||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
||||
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
||||
|
||||
if(diff>setting.getRestTime()[0]&&diff<setting.getRestTime()[1]){
|
||||
WorldProto.GetWorldArenaInfoRequest.Builder builder1 = WorldProto.GetWorldArenaInfoRequest.newBuilder(proto);
|
||||
|
@ -79,14 +92,6 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
builder.setStage(ArenaLogic.getState());
|
||||
}
|
||||
|
||||
if (diff > setting.getRestTime()[0] && diff < setting.getRestTime()[1]) {
|
||||
//多加1分钟 周期间隔后 client再发起请求
|
||||
builder.setEndTime((int)(timeControllerOfFunction.getStartTime()/1000+setting.getRestTime()[1])+61);
|
||||
} else if (diff > setting.getBattleTime()[0] && diff < setting.getBattleTime()[1]) {
|
||||
builder.setEndTime((int)(timeControllerOfFunction.getStartTime()/1000+setting.getBattleTime()[1])+10);
|
||||
} else {
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
if (!ArenaWorldLogic.checkJoin(String.valueOf(iSession.getUid()))) {
|
||||
builder.setEnterable(-1);
|
||||
}
|
||||
|
@ -96,7 +101,7 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
builder1.setScore(score==-1?9999:(int)score);
|
||||
|
||||
//如果是攻击阶段
|
||||
if(ArenaLogic.getInstance().getState()==ArenaLogic.BATTLE_STATE){
|
||||
if(ArenaLogic.getState()==ArenaLogic.BATTLE_STATE){
|
||||
List<CommonProto.ArenaEnemy> arenaEnemyList = ArenaLogic.randomRank(iSession.getUid(), score == -1 ? 9999 : (int) score,crossGroup);
|
||||
builder1.addAllArenaEnemys(arenaEnemyList);
|
||||
}else{
|
||||
|
|
|
@ -8,13 +8,11 @@ import com.ljsd.jieling.logic.activity.event.Poster;
|
|||
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
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.STrump;
|
||||
import config.STrumpBook;
|
||||
import config.STrumpLevelupPool;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
|
@ -32,50 +30,27 @@ public class FaBaoSoulUpLvRequestHandler extends BaseHandler<HeroInfoProto.FaBao
|
|||
public void processWithProto(ISession session, HeroInfoProto.FaBaoSoulUpLvRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int faBaoId=proto.getId();
|
||||
int faBaoLv=proto.getLevel();
|
||||
STrump trumpConfig=STrump.sTrumpMap.get(faBaoId);
|
||||
int faBaoId = proto.getId();
|
||||
int faBaoLv = proto.getLevel();
|
||||
STrump trumpConfig = STrump.sTrumpMap.get(faBaoId);
|
||||
if (faBaoLv > trumpConfig.getLvMax()) {
|
||||
LOGGER.error("法宝之魂强化等级已达上限");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
int[][]costArr=new int[1][2];
|
||||
int costLv=faBaoLv-1;
|
||||
costArr[0][0]=trumpConfig.getLvupCostItem();
|
||||
costArr[0][1]=STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(costLv).getLvupCostItemNum();
|
||||
int[][] costArr = new int[1][2];
|
||||
int costLv = faBaoLv-1;
|
||||
costArr[0][0] = trumpConfig.getLvupCostItem();
|
||||
costArr[0][1] = STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(costLv).getLvupCostItemNum();
|
||||
boolean costResult = ItemUtil.itemCost(user,costArr, BIReason.FABAO_SOUL_UP_COST,faBaoId);
|
||||
if (!costResult) {
|
||||
LOGGER.error("法宝之魂强化材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
user.getHeroManager().putFaBaoSoulMap(faBaoId,faBaoLv);
|
||||
updateFaBaoGongMingLv(user,trumpConfig.getBookId());
|
||||
user.getHeroManager().putFaBaoSoulMap(faBaoId, faBaoLv);
|
||||
int bookId = trumpConfig.getBookId();
|
||||
HeroLogic.getInstance().updateTrumpBookStarLv(user, bookId);
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.FA_BAO_SOUL_UPLV_RESPONSE_VALUE,null,true);
|
||||
}
|
||||
|
||||
public static void updateFaBaoGongMingLv(User user,int bookId) throws Exception {
|
||||
STrumpBook sTrumpBook=STrumpBook.sTrumpBookMap.get(bookId);
|
||||
int[] trumpList = sTrumpBook.getTrumpList();
|
||||
int gongmingLv=0;
|
||||
for (int trumpId : trumpList) {
|
||||
if (!user.getHeroManager().getFaBaoSoulMap().containsKey(trumpId)) {
|
||||
return;
|
||||
}
|
||||
if (gongmingLv==0){
|
||||
gongmingLv=user.getHeroManager().getFaBaoSoulMap().get(trumpId);
|
||||
}
|
||||
if (user.getHeroManager().getFaBaoSoulMap().get(trumpId)<gongmingLv){
|
||||
gongmingLv=user.getHeroManager().getFaBaoSoulMap().get(trumpId);
|
||||
}
|
||||
}
|
||||
int skillId=sTrumpBook.getSkillList()[gongmingLv-1][1];
|
||||
Integer integer = user.getHeroManager().getFaBaoGongMingSkillMap().getOrDefault(bookId, 0);
|
||||
if (integer == 0){
|
||||
// 触发任务,东海寻仙
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.GET_TREASURE_SKILL_NUM, sTrumpBook.getQuality(), 1);
|
||||
}
|
||||
user.getHeroManager().putFaBaoGongMingSkillMap(bookId,skillId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1604,11 +1604,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 校验主线战斗
|
||||
* @param user
|
||||
* @param fightId
|
||||
* @param teamId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean checkMainFight(User user, int fightId, int teamId) throws Exception {
|
||||
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
||||
|
@ -1810,7 +1805,7 @@ public class MapLogic {
|
|||
for (Map.Entry<Integer, Item> equipEntry : user.getItemManager().getItemMap().entrySet()) {
|
||||
if (SItem.getsItemMap().get(equipEntry.getKey()).getItemType() == 3) {
|
||||
if (equipConfig.get(equipEntry.getKey()).getStar() >= ints[1]) {
|
||||
num+=equipEntry.getValue().getItemNum();
|
||||
num+= (int) equipEntry.getValue().getItemNum();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2272,7 +2267,7 @@ public class MapLogic {
|
|||
if (mapManager.getCurMapId() == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if (heroInfo.size() < 1 || !heroInfo.containsKey(heroId)) {
|
||||
if (heroInfo.isEmpty() || !heroInfo.containsKey(heroId)) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] healing = STrialSetting.sTrialSetting.getHealingId();
|
||||
|
@ -2311,9 +2306,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 获取无尽副本英雄信息
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void getEndlessHero(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2328,7 +2320,7 @@ public class MapLogic {
|
|||
MapInfoProto.GetEndlessHeroResponse.Builder response = MapInfoProto.GetEndlessHeroResponse.newBuilder();
|
||||
//已开启地图处理
|
||||
Map<Integer, SEndlessMapConfig> sEndlessMapConfigMap = SEndlessMapConfig.sEndlessMapConfigMap;
|
||||
if (endlessMapInfo.getOpenMap() == null || endlessMapInfo.getOpenMap().size() < 1) {
|
||||
if (endlessMapInfo.getOpenMap() == null || endlessMapInfo.getOpenMap().isEmpty()) {
|
||||
Set<Integer> openMap = new HashSet<>();
|
||||
for (Map.Entry<Integer, SEndlessMapConfig> entry : sEndlessMapConfigMap.entrySet()) {
|
||||
openMap.add(entry.getKey());
|
||||
|
@ -2383,9 +2375,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 无尽副本复位
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void resetEndlessHero(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2411,11 +2400,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 无尽副本设置标记
|
||||
*
|
||||
* @param session
|
||||
* @param cellId
|
||||
* @param content
|
||||
* @param messageType
|
||||
*/
|
||||
public void setEndlessSign(ISession session, int type, int mapId, int cellId, String content, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2449,10 +2433,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 刷新获取行动力
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
* @throws Exception
|
||||
*/
|
||||
public void refreshEndlessExecution(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2462,9 +2442,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 获取出图统计数据
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void endlessOutMapConsume(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2479,9 +2456,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 无尽副本复活消耗行动力
|
||||
*
|
||||
* @param user
|
||||
* @throws Exception
|
||||
*/
|
||||
public void reviveConsumeExecution(User user) throws Exception {
|
||||
MapManager mapManager = user.getMapManager();
|
||||
|
@ -2507,19 +2481,13 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 清理无尽副本道具
|
||||
*
|
||||
* @param uid
|
||||
* @throws Exception
|
||||
*/
|
||||
public void clearEndLessDrop(int uid) throws Exception {
|
||||
public void clearEndLessDrop(int uid) {
|
||||
ItemLogic.getInstance().functionEndClearItem(uid, FunctionIdEnum.Endless.getFunctionType(), BIReason.ENDLESS_REASON_CHANGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无尽副本小地图信息
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void endlessMinMapInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
MapManager mapManager = UserManager.getUser(session.getUid()).getMapManager();
|
||||
|
@ -2527,15 +2495,15 @@ public class MapLogic {
|
|||
MapInfoProto.EndlessMinMapResponse.Builder response = MapInfoProto.EndlessMinMapResponse.newBuilder();
|
||||
Map<Integer, SCMap> scMap = SCMap.sCMap.get(mapManager.getEndlessMapInfo().getCurMapId());
|
||||
for (Map.Entry<Integer, SCMap> entry : scMap.entrySet()) {
|
||||
for (int i = 0; i < endlessMinMapPoint.length; i++) {
|
||||
if (entry.getValue().getEvent() == endlessMinMapPoint[i][0]) {
|
||||
for (int[] ints : endlessMinMapPoint) {
|
||||
if (entry.getValue().getEvent() == ints[0]) {
|
||||
int[][] groups = entry.getValue().getGroups();
|
||||
for (int j = 0; j < groups.length; j++) {
|
||||
for (int[] group : groups) {
|
||||
CommonProto.EndlessPoint.Builder point = CommonProto.EndlessPoint.newBuilder();
|
||||
int x = groups[j][0];
|
||||
int y = groups[j][1];
|
||||
int x = group[0];
|
||||
int y = group[1];
|
||||
int xy = CellUtil.xy2Pos(x, y);
|
||||
point.setLocation(xy).setMonsterId(endlessMinMapPoint[i][1]);
|
||||
point.setLocation(xy).setMonsterId(ints[1]);
|
||||
response.addPoints(point);
|
||||
LOGGER.info("小地图怪物坐标点{}", xy);
|
||||
}
|
||||
|
@ -2596,8 +2564,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 无尽副本赛季更换,用户信息清除
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void resetEndlessInfo() throws Exception {
|
||||
Map<Integer, ISession> onlineUserMap = OnlineUserManager.sessionMap;
|
||||
|
@ -2640,44 +2606,12 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 设置无尽副本是否跳过战斗
|
||||
*
|
||||
* @param session
|
||||
* @param type
|
||||
* @param messageType
|
||||
*/
|
||||
public void setEndlessSkipType(ISession session, int type, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
UserManager.getUser(session.getUid()).getMapManager().updateEndlessSkipFight(type);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
||||
}
|
||||
|
||||
public void getDifficult() throws Exception {
|
||||
SEndlessDifficulty baseDiff = STableManager.getConfig(SEndlessDifficulty.class).get(1);
|
||||
|
||||
// if (serverConfigTmp.getWorldLevel() == 0) {
|
||||
// for (int i = 0; i < baseDiff.getMonsterId().length; i++) {
|
||||
// difficultyMonster.put(baseDiff.getMonsterId()[i], baseDiff.getMonsterId()[i]);
|
||||
// }
|
||||
// for (int i = 0; i < baseDiff.getRewardId().length; i++) {
|
||||
// difficultyReward.put(baseDiff.getRewardId()[i], baseDiff.getRewardId()[i]);
|
||||
// }
|
||||
// } else {
|
||||
// for (Map.Entry<Integer, SEndlessDifficulty> entry : STableManager.getConfig(SEndlessDifficulty.class).entrySet()) {
|
||||
// if (serverConfigTmp.getWorldLevel() <= entry.getValue().getWorldLevel()[0] || serverConfigTmp.getWorldLevel() > entry.getValue().getWorldLevel()[1]) {
|
||||
// continue;
|
||||
// }
|
||||
// for (int i = 0; i < baseDiff.getMonsterId().length; i++) {
|
||||
// difficultyMonster.put(baseDiff.getMonsterId()[i], entry.getValue().getMonsterId()[i]);
|
||||
// }
|
||||
// for (int i = 0; i < baseDiff.getRewardId().length; i++) {
|
||||
// difficultyReward.put(baseDiff.getRewardId()[i], entry.getValue().getRewardId()[i]);
|
||||
// }
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public void dailyChallenge(ISession session, int type, int id, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
PlayerInfoProto.DailyChallengeResponse.Builder builder = PlayerInfoProto.DailyChallengeResponse.newBuilder();
|
||||
|
@ -2783,11 +2717,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 试炼副本保存阵容
|
||||
*
|
||||
* @param session
|
||||
* @param heroes
|
||||
* @param messageType
|
||||
* @throws Exception
|
||||
*/
|
||||
public void saveTrailTeam(ISession session, List<MapInfoProto.TrialSaveHero> heroes, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -2848,10 +2777,6 @@ public class MapLogic {
|
|||
|
||||
/**
|
||||
* 获取宝箱
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
* @throws Exception
|
||||
*/
|
||||
public void trialGetBox(ISession session, int type, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
@ -3111,7 +3036,7 @@ public class MapLogic {
|
|||
|
||||
}
|
||||
|
||||
public void flushEndlessTreasure(User user) throws Exception {
|
||||
public void flushEndlessTreasure(User user) {
|
||||
if (user.getMapManager().getEndlessTreasureReward().getCreateTime() < TimeUtils.nowInt()) {
|
||||
user.getMapManager().resetEndlessTreasure();
|
||||
Item item = user.getItemManager().getItem(102);//升级积分清除
|
||||
|
|
|
@ -106,7 +106,7 @@ public class CircleGame extends ColorGame{
|
|||
|
||||
private void fiveStarPokemonPushByRandom(User user,int itemId) throws Exception{
|
||||
SSpiritAnimal ssa = SSpiritAnimal.mapConfig.get(itemId);
|
||||
if(ssa != null && ssa.getQuality()==5){
|
||||
if(ssa != null && ssa.getQuality()==7){
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(user.getId(), WelfareRedPacketType.game_pokemon.getType(),1));
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.pokemon_quality.getType(),5);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.handler.monsterAttack;
|
||||
|
||||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
|
@ -13,7 +12,10 @@ import com.ljsd.jieling.logic.activity.ActivityType;
|
|||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.FightDispatcher;
|
||||
import com.ljsd.jieling.logic.fight.FightRecordLogic;
|
||||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
@ -22,9 +24,6 @@ import com.ljsd.jieling.logic.rank.RankEnum;
|
|||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SFloodConfig;
|
||||
|
@ -32,6 +31,9 @@ import manager.STableManager;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -66,7 +68,7 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
|
|||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()) {
|
||||
LOGGER.info("startLevelDifficultyFight==> uid={},fightId={},teamId={}", uid, fightId, teamId);
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误"));
|
||||
}
|
||||
|
@ -74,7 +76,7 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.JOIN_MONSTER_ATTACK_TIMES);
|
||||
int groupId = sFloodConfig.getMonster();
|
||||
int mostTime = sFloodConfig.getBattleTime();
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid,teamId, mostTime, "", GameFightType.MonterFight, groupId, 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid,teamId, mostTime, "", GameFightType.MonterQuickFight, groupId, 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
|
||||
//校验结果码 1:胜利
|
||||
|
@ -83,15 +85,7 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
|
|||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
|
||||
CommonProto.FightData fightDataBuild = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(mostTime)
|
||||
.setFightSeed(fightResult.getSeed())
|
||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
||||
.addAllMonsterList(fightResult.getMonsterTeamList())
|
||||
.setFightType(FightType.MonterFight.getType())
|
||||
.setFightId(FightUtil.getFightId(uid,FightType.MonterFight.getType()))
|
||||
.build();
|
||||
|
||||
CommonProto.FightData fightDataBuild = fightResult.getFightData();
|
||||
// 记录战报
|
||||
FightRecordLogic.getInstance().addRecordMap(user,fightDataBuild);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import rpc.protocols.MessageTypeProto;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 轩辕宝镜
|
||||
* @author lvxinran
|
||||
* @date 2020/8/6
|
||||
* @discribe
|
||||
|
|
|
@ -36,7 +36,6 @@ public class Cmd_updateguild extends GmAbstract {
|
|||
case "dissolution":
|
||||
guildInfo.setLevelTime(1);
|
||||
GuilidManager.addGuildToRelease(guildInfo);
|
||||
GuilidManager.saveOrUpdateGuildInfo(guildInfo);
|
||||
break;
|
||||
default:
|
||||
throw new ErrorCodeException("修改公会,类型错误,公会id:"+guildId+",类型:"+parm);
|
||||
|
|
|
@ -98,7 +98,7 @@ public class GlobalDataManaager implements IManager {
|
|||
public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum functionIdEnum){
|
||||
Map<Integer, SGlobalSystemConfig> sGlobalSystemConfigMap = STableManager.getConfig(SGlobalSystemConfig.class);
|
||||
for(Map.Entry<Integer,TimeControllerOfFunction> item : openTimeOfFuntionCache.entrySet()){
|
||||
SGlobalSystemConfig sGlobalSystemConfig = sGlobalSystemConfigMap.get(item.getKey());
|
||||
SGlobalSystemConfig sGlobalSystemConfig = sGlobalSystemConfigMap.get(item.getKey());
|
||||
if(sGlobalSystemConfig.getIsIDdSame() == functionIdEnum.getFunctionType()){
|
||||
return item.getValue();
|
||||
}
|
||||
|
|
|
@ -141,6 +141,8 @@ public interface ActivityType {
|
|||
|
||||
int LINGLONG_BAOJING_TASK = 20014;//玲珑宝镜任务
|
||||
|
||||
int BAUBLES_SUMMON_GIFT = 20015;//法宝召唤礼包
|
||||
|
||||
//***************************************bt活动=====================================//
|
||||
|
||||
int BRUSH_PRIVILEGE = 103;//刷充特权
|
||||
|
|
|
@ -122,6 +122,7 @@ public enum ActivityTypeEnum {
|
|||
LINGLONG_BAOJING_TASK(ActivityType.LINGLONG_BAOJING_TASK, DefaultEmptyActivity::new),//玲珑宝镜任务
|
||||
NOVICE_GEM_CHEST(ActivityType.NOVICE_GEM_CHEST, GemChestActivity::new),//初级命石宝箱
|
||||
ADVANCED_GEM_CHEST(ActivityType.ADVANCED_GEM_CHEST, GemChestActivity::new),//高级命石宝箱
|
||||
BAUBLES_SUMMON_GIFT(ActivityType.BAUBLES_SUMMON_GIFT, DefaultEmptyActivity::new),//法宝召唤礼包
|
||||
|
||||
/****************************************************** bt **********************************************************/
|
||||
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityManager;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -27,11 +28,8 @@ public class FifteenActivity extends AbstractActivity {
|
|||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
SGlobalActivity globalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
if(TimeUtils.getOverTimeCount(user.getPlayerInfoManager().getCreateTime()+globalActivity.getStartTimeLong()*1000,
|
||||
System.currentTimeMillis(),0)<sActivityRewardConfig.getValues()[0][0]-1){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
long createTime = user.getPlayerInfoManager().getCreateTime();
|
||||
return TimeUtils.getOverTimeCount(createTime + globalActivity.getStartTimeLong() * 1000, TimeUtils.now(), 0) >= sActivityRewardConfig.getValues()[0][0] - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,18 +38,19 @@ public class FifteenActivity extends AbstractActivity {
|
|||
if(globalActivity == null){
|
||||
return;
|
||||
}
|
||||
ActivityLogic.getInstance().initAllActivityMission(user.getActivityManager().getActivityMissionMap(),globalActivity.getId());
|
||||
if(user.getActivityManager().getActivityMissionMap().get(globalActivity.getId()) == null){
|
||||
ActivityManager activityManager = user.getActivityManager();
|
||||
Map<Integer, ActivityMission> activityMissionMap = activityManager.getActivityMissionMap();
|
||||
ActivityLogic.getInstance().initAllActivityMission(activityMissionMap,globalActivity.getId());
|
||||
ActivityMission activityMission = activityMissionMap.get(globalActivity.getId());
|
||||
if(activityMission == null){
|
||||
return;
|
||||
}
|
||||
long startTime = ToolsUtil.getTimeLong
|
||||
(globalActivity.getStartTimeLong(),globalActivity.getEndTimeLong(),globalActivity.getTime(),
|
||||
user.getPlayerInfoManager().getCreateTime(), 1);
|
||||
int st = (int)(startTime/1000);
|
||||
for(Map.Entry<Integer,ActivityProgressInfo> entry : user.getActivityManager().getActivityMissionMap().
|
||||
get(globalActivity.getId()).getActivityMissionMap().entrySet()){
|
||||
long startTime = ToolsUtil.getTimeLong(globalActivity.getStartTimeLong(),globalActivity.getEndTimeLong(),globalActivity.getTime(),user.getPlayerInfoManager().getCreateTime(), 1);
|
||||
int time = (int)(startTime/1000);
|
||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||
for(Map.Entry<Integer,ActivityProgressInfo> entry : progressInfoMap.entrySet()){
|
||||
SActivityRewardConfig config = SActivityRewardConfig.getsActivityRewardConfigByMissionId(entry.getKey());
|
||||
entry.getValue().setProgrss((int)((TimeUtils.DAY * (config.getValues()[0][0] - 1))/1000) + st);
|
||||
entry.getValue().setProgrss((int)((TimeUtils.DAY * (config.getValues()[0][0] - 1))/1000) + time);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,18 +62,17 @@ public class FifteenActivity extends AbstractActivity {
|
|||
User user = UserManager.getUser(session.getUid());
|
||||
List<int[][]> reward = new ArrayList<>();
|
||||
getAllMissRewards(user,session,reward);
|
||||
Map<Integer,Integer> itemMap = new HashMap<>();
|
||||
reward.forEach(n-> Arrays.stream(n).forEach(m->itemMap.put(m[0],itemMap.getOrDefault(m[0], 0)+m[1])));
|
||||
|
||||
int[][] rewardArray = ItemUtil.mapToArray(itemMap);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, rewardArray, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
|
||||
reportTakeActivityReward(user,rewardArray,missionId);
|
||||
|
||||
// reportTakeActivityReward(user,rewardArray,missionId);
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
|
||||
updateActivityValue(session);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void updateActivityValue(ISession session) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
boolean isAll = true;
|
||||
for(Map.Entry<Integer,ActivityProgressInfo> entry:activityMission.getActivityMissionMap().entrySet()){
|
||||
|
@ -87,7 +85,5 @@ public class FifteenActivity extends AbstractActivity {
|
|||
activityMission.setV(2);
|
||||
}
|
||||
sendActivityProgress(session, null);
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
|
@ -19,7 +19,6 @@ public class PokemonFiveStarGetEventHandler implements IEventHandler {
|
|||
//动态控制购买数量
|
||||
User user = UserManager.getUser(((PokemonFiveStarGetEvent) event).getUid());
|
||||
int star = ((PokemonFiveStarGetEvent) event).getStar();
|
||||
int num = ((PokemonFiveStarGetEvent) event).getNum();
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.pokemon_quality.getType(),star);
|
||||
}
|
||||
|
|
|
@ -71,17 +71,17 @@ public class ChallengeLogic {
|
|||
int ratio = 0;
|
||||
int[][] value = stage.getReward1();
|
||||
if (type == 1){
|
||||
ratio = Arrays.stream(value).filter(v -> bout > v[0]).mapToInt(v -> v[1]).max().orElse(0);
|
||||
ratio = Arrays.stream(value).filter(v -> bout >= v[0]).mapToInt(v -> v[1]).max().orElse(0);
|
||||
}
|
||||
if (type == 2){
|
||||
ratio = Arrays.stream(value).filter(v -> bout < v[0]).mapToInt(v -> v[1]).min().orElse(0);
|
||||
ratio = Arrays.stream(value).filter(v -> bout <= v[0]).mapToInt(v -> v[1]).max().orElse(0);
|
||||
}
|
||||
builder.setLossBloodOrTimes(bout);
|
||||
|
||||
// 加成百分比
|
||||
for (int[] fix : stage.getPassReward()) {
|
||||
Integer num = comDropMap.getOrDefault(fix[0], 0);
|
||||
num = num + (int)(fix[1] * (ratio/10000d+1d));
|
||||
num = num + (int)(fix[1] * (ratio/10000d));
|
||||
comDropMap.put(fix[0], num);
|
||||
}
|
||||
builder.setPercentReward(ratio);
|
||||
|
|
|
@ -125,13 +125,13 @@ public class CumulationData {
|
|||
|
||||
public int refreshMrTimes; //刷新迷宫寻宝次数
|
||||
|
||||
public int especialEquipMaxLeve; //法宝最高等级达到5
|
||||
private int especialEquipMaxLeve; //法宝最高等级达到5
|
||||
|
||||
public Map<Integer,Integer> luckyWheelTimes = new HashMap<>(); //幸运探宝次数
|
||||
|
||||
public int expeditinoTimes; // 猎妖之路次数
|
||||
|
||||
public Map<Integer,Integer> especialEquipStar = new HashMap<>();//法宝升到%s星级的数量为
|
||||
private Map<Integer,Integer> especialEquipStar = new HashMap<>();//法宝升到%s星级的数量为
|
||||
|
||||
public Map<Integer,Integer> finishMissionTimes = new HashMap<>();//完成迷宫寻宝%品质%次
|
||||
public Map<Integer,Integer> loginTimesDay = new HashMap<>();//每日登陆次数
|
||||
|
@ -148,7 +148,7 @@ public class CumulationData {
|
|||
|
||||
public int decompose_times;//献祭武将次数
|
||||
public int death_path_times;// 击杀过关十绝阵num次
|
||||
public int jewl_all_leve;//全体上阵成员法宝等级达到level(需求人数6人,不满上阵不计完成度)
|
||||
private int baubles_all_level;//全体上阵成员法宝等级达到level(需求人数6人,不满上阵不计完成度)
|
||||
public int daily_task_value;//
|
||||
public int guild_help_value;//
|
||||
public int car_play_time;//
|
||||
|
@ -589,7 +589,7 @@ public class CumulationData {
|
|||
}
|
||||
|
||||
public void addTransfigurationNum(int quality,int num){
|
||||
get_transfiguration_num.merge(quality,num,(oldV, newV) -> oldV + newV);
|
||||
get_transfiguration_num.merge(quality,num, Integer::sum);
|
||||
}
|
||||
|
||||
public void setGet_transfiguration_num(Map<Integer, Integer> get_transfiguration_num) {
|
||||
|
@ -601,7 +601,7 @@ public class CumulationData {
|
|||
}
|
||||
|
||||
public void addActivate_treasure_skill_num(int quality,int num){
|
||||
get_transfiguration_num.merge(quality,num,(oldV, newV) -> oldV + newV);
|
||||
get_transfiguration_num.merge(quality, num, Integer::sum);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getActivate_treasure_skill_num() {
|
||||
|
@ -751,4 +751,32 @@ public class CumulationData {
|
|||
public void addXiaoyaoyouConsumeNum(int num) {
|
||||
this.xiaoyaoyouConsumeNum += num;
|
||||
}
|
||||
|
||||
public int getEspecialEquipMaxLeve() {
|
||||
return especialEquipMaxLeve;
|
||||
}
|
||||
|
||||
public void setEspecialEquipMaxLeve(int especialEquipMaxLeve) {
|
||||
this.especialEquipMaxLeve = especialEquipMaxLeve;
|
||||
}
|
||||
|
||||
public int getBaubles_all_level() {
|
||||
return baubles_all_level;
|
||||
}
|
||||
|
||||
public void setBaubles_all_level(int baubles_all_level) {
|
||||
this.baubles_all_level = baubles_all_level;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getEspecialEquipStar() {
|
||||
return especialEquipStar;
|
||||
}
|
||||
|
||||
public int getEspecialEquipStar(int star) {
|
||||
return especialEquipStar.getOrDefault(star, 0);
|
||||
}
|
||||
|
||||
public void setEspecialEquipStar(Map<Integer, Integer> especialEquipStar) {
|
||||
this.especialEquipStar = especialEquipStar;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,10 +109,10 @@ public class EquipManager extends MongoBase {
|
|||
|
||||
public Baubles getBaubles(String equipId) {
|
||||
PropertyItem item = equipMap.get(equipId);
|
||||
if (item == null){
|
||||
return null;
|
||||
if (item instanceof Baubles){
|
||||
return (Baubles) item;
|
||||
}
|
||||
return (Baubles) item;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void loadFaxiang(String key,String heroId) {
|
||||
|
|
|
@ -190,7 +190,7 @@ public class GuilidManager {
|
|||
RedisUtil.getInstence().zsetRemoveOne(key,Integer.toString(guildInfo.getId()));
|
||||
return;
|
||||
}
|
||||
levelTime+= SGuildSetting.sGuildSetting.getDestroyTime();
|
||||
levelTime += SGuildSetting.sGuildSetting.getDestroyTime();
|
||||
RedisUtil.getInstence().zsetAddOne(key,Integer.toString(guildInfo.getId()),levelTime);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,10 +87,7 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
this.training = new Training();
|
||||
}
|
||||
|
||||
/**
|
||||
* 大脑天宫
|
||||
* 初始化英雄,不入英雄背包
|
||||
*/
|
||||
// 大脑天宫 初始化英雄,不入英雄背包
|
||||
public Hero(Hero hero,int uid,int heroTid,int level) {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||
|
@ -111,9 +108,7 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
this.jewelInfo = new HashSet<>(hero.getJewelInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建默认英雄
|
||||
*/
|
||||
// 创建默认英雄
|
||||
public Hero(int uid, int heroTid, int initStar){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||
|
|
|
@ -116,39 +116,33 @@ public class HeroManager extends MongoBase {
|
|||
*/
|
||||
private Map<Integer, SixiangProfessionInfo> sixiangDataMap = new HashMap<>();
|
||||
|
||||
public Map<Integer, SixiangProfessionInfo> getSixiangDataMap() {
|
||||
return sixiangDataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 四象心法进阶额外属性加成
|
||||
* key: 职业类型 value:< key: 属性类型 value: 属性加成值 >
|
||||
*/
|
||||
private Map<Integer, Map<Integer,Integer>> sixiangPropUpMap = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> heroLikableMap = new HashMap<>();// 好感度数据 key: 英雄静态id value:好感度值
|
||||
private int likableSendTime;//好感度已赠送次数
|
||||
private Map<Integer,Integer> faBaoSoulMap = new HashMap<>();//法宝之魂数据
|
||||
private Map<Integer, Integer> trumpBookStarMap = new HashMap<>();// 法宝组合星级 key:bookid,value:星级
|
||||
private Map<Integer,Map<Integer,Integer>> LifeGridMap = new HashMap<>();//命格数据
|
||||
private Map<Integer,TransformationInfo> transformationList = new HashMap<>();//变身卡列表
|
||||
|
||||
public Map<Integer, SixiangProfessionInfo> getSixiangDataMap() {
|
||||
return sixiangDataMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer,Integer>> getSixiangPropUpMap() {
|
||||
return sixiangPropUpMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 好感度数据
|
||||
* key: 英雄静态id value:好感度值
|
||||
*/
|
||||
private Map<Integer,Integer> heroLikableMap = new HashMap<>();
|
||||
|
||||
public Map<Integer, Integer> getHeroLikableMap() {
|
||||
return heroLikableMap;
|
||||
}
|
||||
|
||||
//神将好感度属性加成, 20220812修改,好感度加成读表计算,不再记录到数据库
|
||||
private Map<Integer,Map<Integer,Integer>>heroLikablePropAddMap=new HashMap<>();
|
||||
//所有神将总好感度带来的属性加成(包含特权加成) 20220812修改,好感度加成属性读表计算,不再记录到数据库
|
||||
private Map<Integer,Integer> allLikablePropAddMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 获取单个英雄好感度加成属性
|
||||
* @param heroTId
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer,Integer> getHeroLikablePropAddMap(int heroTId) {
|
||||
Integer curHeroLikableNum = getHeroLikableMap().getOrDefault(heroTId, 0);
|
||||
|
@ -158,7 +152,6 @@ public class HeroManager extends MongoBase {
|
|||
|
||||
/**
|
||||
* 获取总好感度加成属性
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer,Integer> getAllLikablePropAddMap() {
|
||||
int allHeroLikableNum = HeroUpLikableRequestHandler.GetAllHeroLikableNum(getHeroLikableMap());
|
||||
|
@ -174,27 +167,13 @@ public class HeroManager extends MongoBase {
|
|||
return HeroUpLikableRequestHandler.GetAllLikableLvByLikaNum(allHeroLikableNum);
|
||||
}
|
||||
|
||||
private int likableSendTime;//好感度已赠送次数
|
||||
public void setLifeGridMap(Map<Integer, Map<Integer, Integer>> lifeGridMap) {
|
||||
LifeGridMap = lifeGridMap;
|
||||
updateString("LifeGridMap", LifeGridMap);
|
||||
}
|
||||
|
||||
public int getLikableSendTime() { return likableSendTime; }
|
||||
|
||||
private Map<Integer,Integer> faBaoSoulMap= new HashMap<>();//法宝之魂数据
|
||||
|
||||
public Map<Integer, Integer> getFaBaoSoulMap() {
|
||||
return faBaoSoulMap;
|
||||
}
|
||||
|
||||
private Map<Integer,Integer> faBaoGongMingSkillMap = new HashMap<>();//法宝之魂共鸣数据<法宝组合id:技能id>
|
||||
|
||||
public Map<Integer, Integer> getFaBaoGongMingSkillMap() {
|
||||
return faBaoGongMingSkillMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 命格数据
|
||||
*/
|
||||
private Map<Integer,Map<Integer,Integer>>LifeGridMap=new HashMap<>();
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getLifeGridMap() {
|
||||
return LifeGridMap;
|
||||
}
|
||||
|
@ -208,11 +187,6 @@ public class HeroManager extends MongoBase {
|
|||
updateString("LifeGridMap."+gridId, LifeGridMap.get(gridId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 变身卡列表
|
||||
*/
|
||||
private Map<Integer,TransformationInfo> transformationList = new HashMap<>();
|
||||
|
||||
public void setTransformationList(Map<Integer, TransformationInfo> transformationList) {
|
||||
this.transformationList = transformationList;
|
||||
updateString("transformationList", this.transformationList);
|
||||
|
@ -286,14 +260,40 @@ public class HeroManager extends MongoBase {
|
|||
updateString("heroLikableMap."+heroStaticId, likableNum);
|
||||
}
|
||||
|
||||
public void putFaBaoSoulMap(int fabaoId,int fabaoLv) {
|
||||
public void setFaBaoSoulMap(Map<Integer, Integer> faBaoSoulMap) {
|
||||
this.faBaoSoulMap = faBaoSoulMap;
|
||||
updateString("faBaoSoulMap", faBaoSoulMap);
|
||||
}
|
||||
|
||||
public void putFaBaoSoulMap(int fabaoId, int fabaoLv) {
|
||||
faBaoSoulMap.put(fabaoId,fabaoLv);
|
||||
updateString("faBaoSoulMap."+fabaoId, fabaoLv);
|
||||
}
|
||||
|
||||
public void putFaBaoGongMingSkillMap(int bookId,int skillId) {
|
||||
faBaoGongMingSkillMap.put(bookId,skillId);
|
||||
updateString("faBaoGongMingSkillMap."+bookId, skillId);
|
||||
public Map<Integer, Integer> getFaBaoSoulMap() {
|
||||
return faBaoSoulMap;
|
||||
}
|
||||
|
||||
public int getFaBaoSoulLv(int id) {
|
||||
return faBaoSoulMap.getOrDefault(id, 0);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTrumpBookStarMap() {
|
||||
return trumpBookStarMap;
|
||||
}
|
||||
|
||||
public int getTrumpBookStar(int bookId){
|
||||
return trumpBookStarMap.getOrDefault(bookId, 0);
|
||||
}
|
||||
|
||||
public void setTrumpBookStarMap(Map<Integer, Integer> trumpBookStarMap) {
|
||||
this.trumpBookStarMap = trumpBookStarMap;
|
||||
updateString("trumpBookStarMap", trumpBookStarMap);
|
||||
}
|
||||
|
||||
public void putTrumpBookStar(int bookID, int star){
|
||||
this.trumpBookStarMap.put(bookID, star);
|
||||
updateString("trumpBookStarMap", trumpBookStarMap);
|
||||
}
|
||||
|
||||
//刷新好感度赠送次数 参数传当日已赠送次数
|
||||
|
|
|
@ -4,8 +4,11 @@ import com.ljsd.common.mogodb.MongoBase;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PropertyItem extends MongoBase {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyItem.class);
|
||||
|
||||
private String id;// 唯一id
|
||||
private int equipId;// 道具id
|
||||
|
@ -77,7 +80,7 @@ public class PropertyItem extends MongoBase {
|
|||
clone = (PropertyItem) super.clone();
|
||||
clone.init(0,"");
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.error("强化类型装备克隆失败........",e);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class GuildInfo extends MongoBase {
|
|||
|
||||
private int joinType ; //加入类型 1:直接加入 2:申请加入 3:禁止加入
|
||||
|
||||
private Map<Integer, Set<Integer>> members ;
|
||||
private Map<Integer, Set<Integer>> members;
|
||||
|
||||
private int levelTime;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class HeroVo {
|
|||
private Map<Integer, Integer> godSealByPositionMap = new HashMap<>();
|
||||
private Map<Integer, PurpleMansionSeal> purpleMansionSealMap = new HashMap<>();
|
||||
private Map<Integer, Integer> equipPositionMap = new HashMap<>();
|
||||
private Map<Integer, Integer> faBaoGongMingSkillMap = new HashMap<>();
|
||||
private Map<Integer, Integer> trumpBookStarMap = new HashMap<>();
|
||||
private Map<Integer, Long> userMountValidTime = new HashMap<>();
|
||||
private Map<String, PropertyItem> jewelMap = new HashMap<>();
|
||||
private Map<String, PropertyItem> faxiangMap = new HashMap<>();
|
||||
|
@ -53,7 +53,7 @@ public class HeroVo {
|
|||
heroVo.godSealByPositionMap = new HashMap<>(hero.getGodSealByPositionMap());
|
||||
heroVo.purpleMansionSealMap = new HashMap<>(heroManager.getPurpleMansionSeal());
|
||||
heroVo.equipPositionMap = new HashMap<>(hero.getEquipByPositionMap());
|
||||
heroVo.faBaoGongMingSkillMap = new HashMap<>(heroManager.getFaBaoGongMingSkillMap());
|
||||
heroVo.trumpBookStarMap = new HashMap<>(heroManager.getTrumpBookStarMap());
|
||||
heroVo.userMountValidTime = new HashMap<>(user.getPlayerInfoManager().getUserMountValidTime());
|
||||
heroVo.jewelMap = CBean2Proto.propertyItemOfLocal(user,hero.getJewelInfo());
|
||||
heroVo.faxiangMap = CBean2Proto.propertyItemOfLocal(user,hero.getFaxiangList());
|
||||
|
@ -133,7 +133,7 @@ public class HeroVo {
|
|||
return equipPositionMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getFaBaoGongMingSkillMap() {
|
||||
return faBaoGongMingSkillMap;
|
||||
public Map<Integer, Integer> getTrumpBookStarMap() {
|
||||
return trumpBookStarMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
|||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.TrainingLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.tools.Utils;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
|
@ -715,12 +716,13 @@ public class EquipLogic {
|
|||
|
||||
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){
|
||||
|
||||
int limit = SSpecialConfig.getIntegerValue("EquipTalismanaUpperLimit");
|
||||
if (tgLv > limit){
|
||||
throw new ErrorCodeException(ErrorCode.LEVE_MAX, "法宝已到达最大等级:"+tgLv);
|
||||
}
|
||||
|
||||
Map<Integer, SEquipTalismana> talismanaMap = SEquipTalismana.equipTalismanaStarMap.get(baubles.getEquipId());
|
||||
HashMap<Integer, Integer> costItemMap = new HashMap<>();
|
||||
int count = 0;
|
||||
for (int i = 0; i < upLv; i++) {
|
||||
|
@ -757,6 +759,7 @@ public class EquipLogic {
|
|||
}
|
||||
|
||||
baubles.setLevel(tgLv);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BAUBLES_EQUIP, tgLv);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.BaublesStrengthenResponse_VALUE, null, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ public class GuildLogic {
|
|||
int[][] reward = sGuildSacrificeRewardConfig.getReward();
|
||||
itemArrs.add(reward);
|
||||
}
|
||||
if (itemArrs.size() == 0) {
|
||||
if (itemArrs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("guildsacrifice_reward_title");
|
||||
|
@ -194,7 +194,7 @@ public class GuildLogic {
|
|||
if(StringUtil.isEmpty(announce)){
|
||||
announce= SGuildSetting.sGuildSetting.getDefaultDeclaration();
|
||||
}
|
||||
if(announce.length()==0||announce.length()>32){
|
||||
if(announce.isEmpty() ||announce.length()>32){
|
||||
throw new ErrorCodeException(ErrorCode.ANNOUNCE_SIZE);
|
||||
}
|
||||
// 创建公会
|
||||
|
@ -249,7 +249,7 @@ public class GuildLogic {
|
|||
Family.FamilyRecommandResponse.Builder builder = Family.FamilyRecommandResponse.newBuilder();
|
||||
Map<Integer, GuildApply> applyGuildInfos = GuilidManager.getApplyGuildInfos(uid, 1);
|
||||
int now = TimeUtils.nowInt();
|
||||
if(applyGuildInfos.size()>0){
|
||||
if(!applyGuildInfos.isEmpty()){
|
||||
Iterator<Map.Entry<Integer, GuildApply>> iterator = applyGuildInfos.entrySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
Map.Entry<Integer, GuildApply> next = iterator.next();
|
||||
|
@ -315,7 +315,7 @@ public class GuildLogic {
|
|||
throw new ErrorCodeException(ErrorCode.FAMILY_HAD_APPLY);
|
||||
}
|
||||
for(Integer applyGuildId : applyGuilds){
|
||||
if(GuilidManager.getGuildInfo(applyGuildId).getJoinType()!=0&&applyGuilds.size()==0){
|
||||
if(GuilidManager.getGuildInfo(applyGuildId).getJoinType()!=0&& applyGuilds.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
GuildApply guildApply = new GuildApply(uid,applyGuildId);
|
||||
|
@ -329,7 +329,7 @@ public class GuildLogic {
|
|||
GuilidManager.addApplyGuildInfo(guildApply);
|
||||
Map<Integer, Set<Integer>> members = GuilidManager.getGuildInfo(applyGuildId).getMembers();
|
||||
for(Map.Entry<Integer, Set<Integer>> entry: members.entrySet()){
|
||||
if(entry.getValue().size()<1){
|
||||
if(entry.getValue().isEmpty()){
|
||||
continue;
|
||||
}
|
||||
if (entry.getKey()==GlobalsDef.MEMBER){
|
||||
|
@ -726,6 +726,7 @@ public class GuildLogic {
|
|||
|
||||
/**
|
||||
* 解散公会
|
||||
* @param type 1:解散 2:取消解散
|
||||
*/
|
||||
public static void dissolution(ISession session,int type) throws Exception {
|
||||
int msgId = MessageTypeProto.MessageType.FAMILY_DISSOLUTION_RESPONSE_VALUE;
|
||||
|
@ -737,21 +738,29 @@ public class GuildLogic {
|
|||
}
|
||||
GuildInfo guildInfo = GuilidManager.getGuildInfo(guildId);
|
||||
int uidType = getMemberType(uid, guildInfo.getMembers());
|
||||
if(uidType!=1){
|
||||
if(uidType != 1){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO_ACCESS);
|
||||
}
|
||||
if(type == 1 && guildInfo.getLevelTime()>0){
|
||||
if(type == 1 && guildInfo.getLevelTime() > 0){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("已操作过了"));
|
||||
}
|
||||
if(type == 1&&GuildFightLogic.getStatus()!=0){
|
||||
if(type == 1&&GuildFightLogic.getStatus() != 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_DESTROY_IN_WAR);
|
||||
}
|
||||
//解散公会
|
||||
int time = 0;
|
||||
if(type == 1){
|
||||
guildInfo.setLevelTime(TimeUtils.nowInt());
|
||||
}else{
|
||||
guildInfo.setLevelTime(0);
|
||||
int num = 0;
|
||||
for (Set<Integer> set : guildInfo.getMembers().values()) {
|
||||
num += set.size();
|
||||
}
|
||||
if (num == 1){
|
||||
time = 1;
|
||||
}else {
|
||||
time = TimeUtils.nowInt();
|
||||
}
|
||||
}
|
||||
guildInfo.setLevelTime(time);
|
||||
GuilidManager.saveOrUpdateGuildInfo(guildInfo);
|
||||
sendFamilyBaseUpdateIndication(guildInfo);
|
||||
GuilidManager.addGuildToRelease(guildInfo);
|
||||
|
@ -910,7 +919,9 @@ public class GuildLogic {
|
|||
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退出公会
|
||||
*/
|
||||
public static void levelFamily(ISession session) throws Exception {
|
||||
int msgId = MessageTypeProto.MessageType.FAMILY_LEVEL_RESPONSE_VALUE;
|
||||
int uid = session.getUid();
|
||||
|
@ -928,7 +939,6 @@ public class GuildLogic {
|
|||
guildInfo.removeDefendInfo(uid);
|
||||
}
|
||||
|
||||
//TODO lock check
|
||||
OnUserLeveFamily(user);
|
||||
guildInfo.removeMember(uidType,uid);
|
||||
user.getPlayerInfoManager().setGuildId(0);
|
||||
|
|
|
@ -19,29 +19,21 @@ import com.ljsd.jieling.logic.fight.eventhandler.*;
|
|||
*/
|
||||
public enum GameFightType {
|
||||
StoryFight(FightType.StoryFight,new MainLineOrInnerDemonFightHandler(), RedisKey.LEVE_DIFFICULTY_FIGHT),
|
||||
|
||||
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
||||
MonterQuickFight(FightType.MonterFight,new MainLineOrInnerQuickFightHandler(),null),//心魔快速战斗
|
||||
MapFastFight(FightType.MapExploreFight,new DefaultWithoutHandFightHandler(),null),
|
||||
|
||||
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
|
||||
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
|
||||
EndMonsterAttackFight(FightType.MapExploreFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
||||
|
||||
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
|
||||
|
||||
TOPArenaPersonFight(FightType.TOPFight,new PVPFightHandler(),null),
|
||||
TOPArenaRobotFight(FightType.TOPFight,new PVPFightHandler(),null),
|
||||
TOPArena2RobotFight(FightType.TOPFight,new PVPFightHandler(),null),
|
||||
|
||||
MonterFight(FightType.MonterFight,new DefaultWithoutHandFightHandler(),null),
|
||||
|
||||
GuildFight(FightType.GuildFight,new PVPFightHandler(),null),
|
||||
|
||||
GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT),
|
||||
DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null),
|
||||
DeathPathChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
||||
|
||||
CarBossChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
||||
CarPersonChallenge(FightType.CarPersonFight,new PVPFightHandler(),null),
|
||||
GuildChallenge(FightType.GuildChallenge,new DefaultWithoutHandFightHandler(),null),
|
||||
|
|
|
@ -34,13 +34,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
*/
|
||||
public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DuoduiTowerFightHandler.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MainLineOrInnerDemonFightHandler.class);
|
||||
|
||||
@Override
|
||||
public FightResult process(FightEvent fightEvent) throws Exception {
|
||||
GameFightType fightType = fightEvent.getFightType();
|
||||
int playerId = fightEvent.getAttackUid();
|
||||
int fightTime = fightEvent.getMostTime();
|
||||
String key = RedisKey.getKey(fightType.getFightTypeOfRedis(), Integer.toString(playerId));
|
||||
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
|
||||
if (valueMap == null || valueMap.isEmpty()) {
|
||||
|
@ -52,12 +51,29 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
|||
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
|
||||
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
|
||||
|
||||
return returnFightResult(fightEvent, seed, fightTeamInfo, monsterTeamList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回挑战结果
|
||||
* @param fightEvent 战斗类型
|
||||
* @param seed 速度
|
||||
* @param fightTeamInfo 我方队伍
|
||||
* @param monsterTeamList 地方队伍
|
||||
* @return FightResult
|
||||
*/
|
||||
public FightResult returnFightResult(FightEvent fightEvent, int seed, CommonProto.FightTeamInfo fightTeamInfo, List<CommonProto.FightTeamInfo> monsterTeamList){
|
||||
int playerId = fightEvent.getAttackUid();
|
||||
int fightTime = fightEvent.getMostTime();
|
||||
GameFightType fightType = fightEvent.getFightType();
|
||||
|
||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
||||
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));
|
||||
|
||||
FightResult.Builder fightResult = FightResult.newBuilder();
|
||||
long[] fightResultInfo = CheckFight.getInstance().checkFight(seed, fightTime, getFightData, getOptionData, fightType.getFightType());
|
||||
fightResult.setCheckResult(fightResultInfo);
|
||||
|
||||
FightResult.Builder builder = FightResult.newBuilder();
|
||||
builder.setCheckResult(fightResultInfo);
|
||||
String fightId = FightUtil.getFightId(playerId, fightType);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightType(fightType.getFightType().getType())
|
||||
|
@ -67,8 +83,8 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
|||
.setFightMaxTime(fightTime)
|
||||
.setFightId(fightId)
|
||||
.build();
|
||||
fightResult.setFightData(fightData);
|
||||
FightResult result = fightResult.build();
|
||||
builder.setFightData(fightData);
|
||||
FightResult result = builder.build();
|
||||
|
||||
if (result.getResult() == 1){
|
||||
// 成功清除时间
|
||||
|
@ -96,7 +112,7 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
|||
*/
|
||||
public static void setFailTime(int uid, int type, int time){
|
||||
int failTime = getFailTime(uid, type);
|
||||
if (failTime != 0){
|
||||
if (time != 0 && failTime != 0){
|
||||
return;
|
||||
}
|
||||
// redis记录key
|
||||
|
@ -109,14 +125,18 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
|||
* 根据时间获取减免系数
|
||||
*/
|
||||
public static double getDownNum(int uid, int type){
|
||||
int nowInt = TimeUtils.nowInt();
|
||||
// 耗时(分)/ 减少比例
|
||||
int[] timeDowns = SSpecialConfig.getIntegerArrayValue("Level_Time_Down");
|
||||
// 最大减少比例
|
||||
int maxDown = SSpecialConfig.getIntegerValue("Level_Time_Maxdown");
|
||||
// 失败时间
|
||||
int failTime = getFailTime(uid, type);
|
||||
if (failTime == 0){
|
||||
failTime = nowInt;
|
||||
}
|
||||
// 按照分钟计算减免系数
|
||||
int minutesTime = failTime / 1000 / timeDowns[0];
|
||||
int minutesTime = (nowInt - failTime) / 60 / timeDowns[0];
|
||||
// 万分比
|
||||
double downTime = 1 - (Math.min(minutesTime * timeDowns[1], maxDown) / 10000d);
|
||||
LOGGER.info("关卡挑战,战力降低日志,uid:{},类型:{},系数:{}",uid, type, downTime);
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.logic.fight.eventhandler;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightEvent;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import rpc.protocols.CommonProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主线编队和心魔战斗快速处理方法
|
||||
*/
|
||||
public class MainLineOrInnerQuickFightHandler extends MainLineOrInnerDemonFightHandler {
|
||||
@Override
|
||||
public FightResult process(FightEvent fightEvent) throws Exception {
|
||||
GameFightType fightType = fightEvent.getFightType();
|
||||
int playerId = fightEvent.getAttackUid();
|
||||
int fightSeed = TimeUtils.nowInt();
|
||||
|
||||
PVEFightEvent pveFightEvent = (PVEFightEvent) fightEvent;
|
||||
int groupId = pveFightEvent.getMonsterGroupId();
|
||||
// 玩家队伍信息
|
||||
User user = UserManager.getUserNotCache(playerId);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, pveFightEvent.getTeamId(), pveFightEvent.getAttackBloodMap(), pveFightEvent.getBuffIds());
|
||||
//怪物队伍信息
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = getMonsterByGroup(playerId, groupId, fightType.getFightType().getType());
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.getFightTeamInfos(groupId, pveFightEvent.getNums(), monsterByGroup);
|
||||
|
||||
return returnFightResult(fightEvent, fightSeed, fightTeamInfo, monsterfightTeamInfos);
|
||||
}
|
||||
}
|
|
@ -56,6 +56,8 @@ public class HelpHero {
|
|||
|
||||
private Baubles baubles;
|
||||
|
||||
private List<Baubles> baublesList = new ArrayList<>();
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
@ -135,4 +137,12 @@ public class HelpHero {
|
|||
public void setBaubles(Baubles baubles) {
|
||||
this.baubles = baubles;
|
||||
}
|
||||
|
||||
public List<Baubles> getBaublesList() {
|
||||
return baublesList;
|
||||
}
|
||||
|
||||
public void setBaublesList(List<Baubles> baublesList) {
|
||||
this.baublesList = baublesList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class HelpHeroLogic {
|
|||
// 我的助战
|
||||
if (typeEnum == Me){
|
||||
for (Map.Entry<String, HelpHero> data:helpHeroMap.entrySet()){
|
||||
result.add(CBean2Proto.helpHeroProto(data.getValue()));
|
||||
result.add(CBean2Proto.buildHelpHeroToProto(data.getValue()));
|
||||
}
|
||||
}
|
||||
// 人佛妖道
|
||||
|
@ -113,7 +113,7 @@ public class HelpHeroLogic {
|
|||
if (friends.contains(Integer.parseInt(data.getKey()))){
|
||||
// 此处进行助战类型赋值
|
||||
data.getValue().setHelpType(0);
|
||||
result.add(CBean2Proto.helpHeroProto(data.getValue()));
|
||||
result.add(CBean2Proto.buildHelpHeroToProto(data.getValue()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class HelpHeroLogic {
|
|||
if (mem.contains(Integer.parseInt(data.getKey()))){
|
||||
// 此处进行助战类型赋值
|
||||
data.getValue().setHelpType(1);
|
||||
result.add(CBean2Proto.helpHeroProto(data.getValue()));
|
||||
result.add(CBean2Proto.buildHelpHeroToProto(data.getValue()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class HelpHeroLogic {
|
|||
HelpHero helpHero = getHelpHero(subKey1, typeEnum.getPropertyId());
|
||||
// 英雄不存在添加
|
||||
if (helpHero != null && !strings.contains(helpHero.getHero().getId())){
|
||||
result.add(CBean2Proto.helpHeroProto(helpHero));
|
||||
result.add(CBean2Proto.buildHelpHeroToProto(helpHero));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -157,10 +157,11 @@ public class HelpHeroLogic {
|
|||
if (helpHero != null){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"已选择其他神将!");
|
||||
}
|
||||
HelpHero helpHeroForRedis = CBean2Proto.buildHelpHeroToRedis(user, hero);
|
||||
// 自己的助战列表添加
|
||||
addHelpHero(subKey,propertyName,CBean2Proto.heroToHelpHero(user,hero));
|
||||
addHelpHero(subKey,propertyName, helpHeroForRedis);
|
||||
// 类型助战列表添加,自己的助战列表没有该类型英雄,那么对应类型的助战列表也应该没有对应英雄,所以这里不再循环验证
|
||||
addHelpHero(String.valueOf(propertyName),user.getId(),CBean2Proto.heroToHelpHero(user,hero));
|
||||
addHelpHero(String.valueOf(propertyName),user.getId(), helpHeroForRedis);
|
||||
|
||||
// 配置表,获取自己设置助战奖励
|
||||
SCampTowerSetting campTowerSetting = STableManager.getConfig(SCampTowerSetting.class).get(1);
|
||||
|
|
|
@ -504,13 +504,13 @@ public class HeroLogic {
|
|||
int fiveStarNum = 0;
|
||||
for (int[] i : getHeros) {
|
||||
SSpiritAnimal ssa = SSpiritAnimal.mapConfig.get(i[0]);
|
||||
if (ssa != null && ssa.getQuality() == 5) {
|
||||
if (ssa != null && ssa.getQuality() == 7) {
|
||||
fiveStarNum++;
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(user.getId(), WelfareRedPacketType.random_pokemon.getType(), 1));
|
||||
}
|
||||
}
|
||||
if (fiveStarNum > 0) {
|
||||
Poster.getPoster().dispatchEvent(new PokemonFiveStarGetEvent(user.getId(), 5, fiveStarNum));
|
||||
Poster.getPoster().dispatchEvent(new PokemonFiveStarGetEvent(user.getId(), 7, fiveStarNum));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,8 +519,8 @@ public class HeroLogic {
|
|||
*/
|
||||
public static void fiveStarPokemonPushByCombine(User user, int itemId, int num) {
|
||||
SSpiritAnimal ssa = SSpiritAnimal.mapConfig.get(itemId);
|
||||
if (ssa != null && ssa.getQuality() == 5) {
|
||||
Poster.getPoster().dispatchEvent(new PokemonFiveStarGetEvent(user.getId(), 5, num));
|
||||
if (ssa != null && ssa.getQuality() == 7) {
|
||||
Poster.getPoster().dispatchEvent(new PokemonFiveStarGetEvent(user.getId(), 7, num));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1323,7 +1323,8 @@ public class HeroLogic {
|
|||
} else {
|
||||
user.getTeamPosManager().changeTeamInfo(teamId, heroIds);
|
||||
}
|
||||
} else if (teamId == TeamEnum.TEAM_ARENA_DEFENSE.getTeamId()) {
|
||||
}
|
||||
else if (teamId == TeamEnum.TEAM_ARENA_DEFENSE.getTeamId()) {
|
||||
long teamForce = calTeamTotalForce(user, teamId);
|
||||
//更新竞技场防御编队战力
|
||||
String key = RedisKey.getKey(RedisKey.AREDEF_TEAM_FORCE_RANK, "");
|
||||
|
@ -1525,9 +1526,7 @@ public class HeroLogic {
|
|||
//判断编队
|
||||
for (HeroInfoProto.ConsumeMaterial consumeMaterial1 : consumeMaterialsList) {
|
||||
List<String> heroIdsList = new ArrayList<>();
|
||||
consumeMaterial1.getHeroIdsList().stream()
|
||||
.filter(v -> v.getType() == 1)
|
||||
.forEach(v -> heroIdsList.add(v.getItemId()));
|
||||
consumeMaterial1.getHeroIdsList().stream().filter(v -> v.getType() == 1).forEach(v -> heroIdsList.add(v.getItemId()));
|
||||
ErrorCode err = null;
|
||||
if (!heroIdsList.isEmpty()) {
|
||||
err = ItemLogic.getInstance().checkHeroResolve(heroIdsList, user);
|
||||
|
@ -2129,31 +2128,36 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
///法宝之魂共鸣技能
|
||||
Map<Integer, Integer> faBaoGongMingSkillMap = heroVo.getFaBaoGongMingSkillMap();
|
||||
if (!faBaoGongMingSkillMap.isEmpty()) {
|
||||
Map<Integer, Integer> trumpBookStarMap = heroVo.getTrumpBookStarMap();
|
||||
if (!trumpBookStarMap.isEmpty()) {
|
||||
List<Integer> faBaoSoulSkills = new ArrayList<>();
|
||||
for (Map.Entry<Integer, Integer> entry : faBaoGongMingSkillMap.entrySet()) {
|
||||
SXiuXianSkill sXiuXianSkill = STableManager.getConfig(SXiuXianSkill.class).get(entry.getValue());
|
||||
Map<Integer, STrumpBook> trumpBookMap = STrumpBook.sTrumpBookMap;
|
||||
for (Map.Entry<Integer, Integer> entry : trumpBookStarMap.entrySet()) {
|
||||
STrumpBook trumpBook = trumpBookMap.get(entry.getKey());
|
||||
if (trumpBook == null){
|
||||
continue;
|
||||
}
|
||||
if (entry.getValue() == 0){
|
||||
continue;
|
||||
}
|
||||
int xiuxianSkillId = trumpBook.getSkillList()[entry.getValue() - 1][0];
|
||||
SXiuXianSkill sXiuXianSkill = STableManager.getConfig(SXiuXianSkill.class).get(xiuxianSkillId);
|
||||
if (sXiuXianSkill == null){
|
||||
continue;
|
||||
}
|
||||
int[] fitList = sXiuXianSkill.getFitList();
|
||||
List<Integer> integerList = Arrays.stream(sXiuXianSkill.getSkillId()).boxed().collect(Collectors.toList());
|
||||
if (fitList[0] == 0) {
|
||||
for (int skillId : sXiuXianSkill.getSkillId()) {
|
||||
faBaoSoulSkills.add(skillId);
|
||||
}
|
||||
faBaoSoulSkills.addAll(integerList);
|
||||
}
|
||||
if (fitList[0] == 1 && fitList[1] == propertyId) {
|
||||
for (int skillId : sXiuXianSkill.getSkillId()) {
|
||||
faBaoSoulSkills.add(skillId);
|
||||
}
|
||||
faBaoSoulSkills.addAll(integerList);
|
||||
}
|
||||
if (fitList[0] == 2 && fitList[1] == propertyId) {
|
||||
for (int skillId : sXiuXianSkill.getSkillId()) {
|
||||
faBaoSoulSkills.add(skillId);
|
||||
}
|
||||
faBaoSoulSkills.addAll(integerList);
|
||||
}
|
||||
}
|
||||
if (!faBaoSoulSkills.isEmpty()) {
|
||||
skillList.addAll(faBaoSoulSkills);
|
||||
}
|
||||
skillList.addAll(faBaoSoulSkills);
|
||||
}
|
||||
|
||||
// 好感度技能
|
||||
|
@ -2861,16 +2865,37 @@ public class HeroLogic {
|
|||
// ... 法宝聚灵和命格增加属性逻辑 ...
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
|
||||
// 法宝聚灵
|
||||
Map<Integer, Integer> faBaoSoulMap = heroManager.getFaBaoSoulMap();
|
||||
// 计算基础属性加成
|
||||
int addition = 0;
|
||||
int trumpStarUp = SSpecialConfig.getIntegerValue("Trump_Star_Up");
|
||||
Map<Integer, STrumpBook> trumpBookMap = STrumpBook.sTrumpBookMap;
|
||||
for (STrumpBook book : trumpBookMap.values()) {
|
||||
int trumpBookStar = heroManager.getTrumpBookStar(book.getId());
|
||||
addition += (trumpBookStar * trumpStarUp);
|
||||
}
|
||||
// 法宝聚灵
|
||||
Map<Integer, STrump> sTrumpMap = STrump.sTrumpMap;
|
||||
Map<Integer, Map<Integer, STrumpLevelupPool>> levelPoolMap = STrumpLevelupPool.levelPoolMap;
|
||||
|
||||
HashMap<Integer, Long> trumpLvAttr = new HashMap<>();
|
||||
for (Map.Entry<Integer, Integer> faBaoSoulEntry : faBaoSoulMap.entrySet()) {
|
||||
// 等级处理
|
||||
STrump trumpConfig = STrump.sTrumpMap.get(faBaoSoulEntry.getKey());
|
||||
STrumpLevelupPool lvUpProps = STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(faBaoSoulEntry.getValue());
|
||||
combinedAttribute(lvUpProps.getLvupProps(), heroAllAttribute);
|
||||
STrump trumpConfig = sTrumpMap.get(faBaoSoulEntry.getKey());
|
||||
STrumpLevelupPool lvUpProps = levelPoolMap.get(trumpConfig.getLvupPool()).get(faBaoSoulEntry.getValue());
|
||||
for (int[] lv : lvUpProps.getLvupProps()) {
|
||||
trumpLvAttr.merge(lv[0], (long) lv[1], Long::sum);
|
||||
}
|
||||
}
|
||||
for (Map.Entry<Integer, Long> entry : trumpLvAttr.entrySet()) {
|
||||
long value = Math.round(entry.getValue() * (1 + addition / 10000D));
|
||||
trumpLvAttr.put(entry.getKey(), value);
|
||||
}
|
||||
// LOGGER.info("法宝聚灵属性加成======================={}=>{}",addition,trumpLvAttr);
|
||||
combinedAttribute(trumpLvAttr, heroAllAttribute);
|
||||
|
||||
// 法宝聚灵总星级属性
|
||||
Map<Integer, STrumpStar> trumpStarMap = STableManager.getConfig(STrumpStar.class);
|
||||
// 玩家全部的总星级
|
||||
int sumStar = faBaoSoulMap.values().stream().mapToInt(v -> v).sum();
|
||||
STrumpStar trumpStar = null;
|
||||
for (STrumpStar value : trumpStarMap.values()) {
|
||||
|
@ -3916,7 +3941,7 @@ public class HeroLogic {
|
|||
totalForce += playerSkill.getFight();
|
||||
}
|
||||
}
|
||||
LOGGER.info("calTeamTotalForce uid={} 总战力={} 耗时={}", targetUser.getId(), totalForce, TimeUtils.now() - now);
|
||||
LOGGER.info("calTeamTotalForce uid={} teamId={} 总战力={} 耗时={}ms", targetUser.getId(), teamId, totalForce, TimeUtils.now() - now);
|
||||
return totalForce;
|
||||
}
|
||||
|
||||
|
@ -4520,8 +4545,7 @@ public class HeroLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
List<String> heroList = new ArrayList<>(1);
|
||||
heroList.add(heroId);
|
||||
boolean teamCheck = false;
|
||||
ErrorCode err = ItemLogic.getInstance().checkHeroResolve(heroList, user, teamCheck);
|
||||
ErrorCode err = ItemLogic.getInstance().checkHeroResolve(heroList, user, false);
|
||||
if (null != err) {
|
||||
throw new ErrorCodeException(err);
|
||||
}
|
||||
|
@ -6984,7 +7008,7 @@ public class HeroLogic {
|
|||
int result = 0;
|
||||
for (Integer id : set) {
|
||||
SEquipConfig config = configMap.get(id);
|
||||
if (config == null || config.getPotentialNew() == null) {
|
||||
if (config == null || config.getPotentialNew() == null || config.getPotentialNew().length == 0) {
|
||||
continue;
|
||||
}
|
||||
result += config.getPotentialNew()[1];
|
||||
|
@ -7074,6 +7098,33 @@ public class HeroLogic {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取法宝组合星级
|
||||
* @param user
|
||||
* @param bookId
|
||||
* @return
|
||||
*/
|
||||
public void updateTrumpBookStarLv(User user,int bookId) throws Exception {
|
||||
STrumpBook sTrumpBook = STrumpBook.sTrumpBookMap.get(bookId);
|
||||
if (sTrumpBook == null){
|
||||
return;
|
||||
}
|
||||
int[] trumpList = sTrumpBook.getTrumpList();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
int result = heroManager.getFaBaoSoulLv(trumpList[0]);
|
||||
for (int i = 1; i < trumpList.length; i++) {
|
||||
int faBaoSoulLv = heroManager.getFaBaoSoulLv(trumpList[i]);
|
||||
if (faBaoSoulLv < result){
|
||||
result = faBaoSoulLv;
|
||||
}
|
||||
}
|
||||
if (heroManager.getTrumpBookStar(bookId) == 0){
|
||||
// 触发任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.GET_TREASURE_SKILL_NUM, sTrumpBook.getQuality(), 1);
|
||||
}
|
||||
heroManager.putTrumpBookStar(bookId, result);
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static HeroLogic instance = new HeroLogic();
|
||||
}
|
||||
|
|
|
@ -154,7 +154,8 @@ public class TrainingLogic {
|
|||
cost.add(buildLevel.getCost());
|
||||
}
|
||||
else {
|
||||
int num = (int) Math.round((nowInt - architecture.getStartTime()) / 60d);
|
||||
int second = buildLevel.getTime() - (nowInt - architecture.getStartTime());
|
||||
int num = (int) Math.round(second / 60d);
|
||||
cost.add(new int[][]{{trainBuildTime[0], trainBuildTime[1] * num}});
|
||||
}
|
||||
// 验证道具数量
|
||||
|
|
|
@ -484,8 +484,9 @@ public class ItemLogic {
|
|||
|
||||
for (String id : heroIdsList) {
|
||||
Hero hero = user.getHeroManager().getHero(id);
|
||||
Training training = hero.getTraining();
|
||||
int maxLv = STrain.getMaxLv(hero.getTemplateId());
|
||||
if (hero.getTraining().getLv() == maxLv){
|
||||
if (training.getLv() == maxLv){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE, "特训满级英雄无法分解");
|
||||
}
|
||||
}
|
||||
|
@ -520,7 +521,16 @@ public class ItemLogic {
|
|||
// return tempReturn;
|
||||
// }
|
||||
|
||||
public ErrorCode checkHeroResolve(List<String> heroIdsList, User user,boolean teamCheck) {
|
||||
/**
|
||||
* 检查英雄是否符合要求
|
||||
* @param heroIdsList
|
||||
* @param user
|
||||
* @param teamCheck
|
||||
* true: 分解
|
||||
* false:归元
|
||||
* @return
|
||||
*/
|
||||
public ErrorCode checkHeroResolve(List<String> heroIdsList, User user, boolean teamCheck) {
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
if (heroIdsList.isEmpty()) {
|
||||
return ErrorCode.ITEM_DECOMPOSE_HERO_NO;
|
||||
|
@ -534,6 +544,9 @@ public class ItemLogic {
|
|||
return ErrorCode.ITEM_DECOMPOSE_HERO_LOCK;
|
||||
}
|
||||
if(teamCheck){
|
||||
if (hero.getTraining().getIsTraining() == 1){
|
||||
return ErrorCode.HERO_UN_MATCH;
|
||||
}
|
||||
int[] teamId = SSpecialConfig.getOnceArrayValue(SSpecialConfig.HERO_RESOLVE_LICENCE);
|
||||
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, heroId, teamId);
|
||||
if (!battleArray) {
|
||||
|
|
|
@ -37,10 +37,8 @@ public enum GameEvent {
|
|||
PlAY_STORY, //玩副本
|
||||
HERO_UP,//卡牌成长 0:升级 1:突破 2:升星
|
||||
TAKE_ACTIVITY_REWARD, // 领取活动奖励
|
||||
|
||||
HERO_IN_TEAM, // 上阵卡牌数量
|
||||
|
||||
ESPECIAL_EQUIP,//获得法宝
|
||||
BAUBLES_EQUIP,//获得法宝
|
||||
RECHARGE_TOTAL,//累計充值
|
||||
JADE_DYNASTY_REFRESH,//破阵诛仙任务日刷新
|
||||
JADE_DYNASTY_WEEK_REFRESH,//破阵诛仙周刷新
|
||||
|
|
|
@ -1147,9 +1147,6 @@ public class MissionLoigc {
|
|||
case FAMILY_FIGHT_ATTACK:
|
||||
count = cumulationData.familyFightCount;
|
||||
break;
|
||||
case ESPECIAL_EQUIP:
|
||||
count = cumulationData.especialEquipStar.get(missionSubType[0]);
|
||||
break;
|
||||
case FIND_STAR:
|
||||
count = cumulationData.findStar;
|
||||
break;
|
||||
|
@ -1178,10 +1175,6 @@ public class MissionLoigc {
|
|||
case REFRESH_MISSING_ROOM:
|
||||
count = cumulationData.refreshMrTimes;
|
||||
break;
|
||||
//todo
|
||||
case SPECIAL_EQUIP_LEVEL_UP:
|
||||
count = cumulationData.especialEquipMaxLeve;
|
||||
break;
|
||||
case LUCKY_WHEELS_TIMES:
|
||||
if(missionSubType[0] == 0){
|
||||
for(int value : cumulationData.luckyWheelTimes.values()){
|
||||
|
|
|
@ -83,7 +83,7 @@ public enum MissionType {
|
|||
BLOODY_KILL_NUMS(59),// 血战每日击杀人数
|
||||
ENDLESS_CONSUME_ACTION(60),//无尽消耗行动力
|
||||
FAMILY_FIGHT_ATTACK(61),//公会战进攻次数
|
||||
ESPECIAL_EQUIP(62),//拥有%s星级法宝的数量为:%s
|
||||
BAUBLES_EQUIP(62),//拥有%s星级法宝的数量为:%s
|
||||
FIND_STAR(65),//占星
|
||||
TAKE_FRIEND_GIFT(66),//领取好友友情点
|
||||
JOIN_FAMILY(69),
|
||||
|
@ -95,7 +95,7 @@ public enum MissionType {
|
|||
CARD_RANDOM_TYPE(75),// 使用普通召唤num次(十连抽num计10)
|
||||
FINISH_MISSING_ROOM(76),//完成迷宫寻宝%品质%次
|
||||
REFRESH_MISSING_ROOM(77),//刷新迷宫寻宝%s次
|
||||
SPECIAL_EQUIP_LEVEL_UP(78),//法宝提升到%s级
|
||||
BAUBLES_EQUIP_LEVEL_UP(78),//法宝提升到%s级
|
||||
|
||||
GUILD_GIVE_TIME(79),//使用level级别(0不限、1普通、2钻石小、3钻石大)的公会捐献num次
|
||||
TEN_CHALLENGE_TIME(80),//挑战十绝阵num次
|
||||
|
@ -110,7 +110,7 @@ public enum MissionType {
|
|||
EXPEDITION_FLOOR_TIMES(89),//猎妖之路通过第floor层的首领节点(每层最多一个)num次
|
||||
DECOMPOSE_TIMES(100),//献祭武将num个
|
||||
DEATH_PATH_TIMES(101),//击杀过关十绝阵num次
|
||||
JEWL_ALL_LEVE(102),//全体上阵成员法宝等级达到level(需求人数6人,不满上阵不计完成度)
|
||||
BAUBLES_ALL_LEVE(102),//全体上阵成员法宝等级达到level(需求人数6人,不满上阵不计完成度)
|
||||
|
||||
DAILY_TASK_FINISH(103),//日常任务活跃度达到num
|
||||
GUILD_HELP_TIMES(104),//公会援助他人次数达到num
|
||||
|
|
|
@ -107,7 +107,7 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.JOIN_MONSTER_ATTACK_TIMES,new JoinMonsterAttackManager());
|
||||
judges.put(MissionType.MONSTER_ATTACK_LEVEL,new DefaultDataManager());
|
||||
judges.put(MissionType.TO_BE_STRONGER,new StrongerManager());
|
||||
judges.put(MissionType.ESPECIAL_EQUIP,new EspecialStarManager());
|
||||
judges.put(MissionType.BAUBLES_EQUIP,new EspecialStarManager());
|
||||
judges.put(MissionType.FAMILY_FIGHT_ATTACK,new FamilyFightManager());
|
||||
judges.put(MissionType.FIND_STAR,new FindStarManager());
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.RECHARGE_TIMES,new RechargeTimesManager());
|
||||
judges.put(MissionType.FINISH_MISSING_ROOM,new FinishMissionRoomManager());
|
||||
judges.put(MissionType.REFRESH_MISSING_ROOM,new RefreshMissionRoomMamager());
|
||||
judges.put(MissionType.SPECIAL_EQUIP_LEVEL_UP,new EspecialEquipLeveMamager());
|
||||
judges.put(MissionType.BAUBLES_EQUIP_LEVEL_UP,new EspecialEquipLeveMamager());
|
||||
judges.put(MissionType.LUCKY_WHEELS_TIMES,new LuckyWheelTimesManager());
|
||||
judges.put(MissionType.FINISH_EXPEDITION_HERO_TIMES,new ExpeditionManager());
|
||||
judges.put(MissionType.LOGIN_TIMES,new LoginTimeManager());
|
||||
|
@ -132,7 +132,7 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.EXPEDITION_FLOOR_TIMES,new ExpeditionPassManger());
|
||||
judges.put(MissionType.DECOMPOSE_TIMES,new DecomposeTimes());
|
||||
judges.put(MissionType.DEATH_PATH_TIMES,new DeathPathTimes());
|
||||
judges.put(MissionType.JEWL_ALL_LEVE,new UpJewlDataManager());
|
||||
judges.put(MissionType.BAUBLES_ALL_LEVE,new UpAllBaublesLvDataManager());
|
||||
|
||||
judges.put(MissionType.DAILY_TASK_FINISH,new DailyTaskManager());
|
||||
judges.put(MissionType.GUILD_HELP_TIMES,new GuildHelpManager());
|
||||
|
|
|
@ -1,13 +1,26 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class EspecialEquipLeveMamager implements BaseDataManager{
|
||||
public class EspecialEquipLeveMamager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getEspecialEquipMaxLeve() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getEspecialEquipMaxLeve();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
if((int)parm[0]>data.especialEquipMaxLeve){
|
||||
data.especialEquipMaxLeve=(int)parm[0];
|
||||
int lv = (int) parm[0];
|
||||
if(lv > data.getEspecialEquipMaxLeve()){
|
||||
data.setEspecialEquipMaxLeve(lv);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
|
|
@ -1,25 +1,36 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.Baubles;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.EquipManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class EspecialStarManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
List<Baubles> baublesList = equipManager.getBaublesList();
|
||||
HashMap<Integer, Integer> map = new HashMap<>();
|
||||
for (Baubles baubles : baublesList) {
|
||||
int star = baubles.getLevel() / 10;
|
||||
map.merge(star,1,Integer::sum);
|
||||
}
|
||||
data.setEspecialEquipStar(map);
|
||||
return data.getEspecialEquipStar(cfgValue[0][0]) >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getEspecialEquipStar(missionSubType[0]);
|
||||
}
|
||||
|
||||
public class EspecialStarManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int equipStar = (int) parm[0];
|
||||
Map<Integer, Integer> especialEquipStar = data.especialEquipStar;
|
||||
if(especialEquipStar.containsKey(equipStar)){
|
||||
especialEquipStar.put(equipStar,especialEquipStar.get(equipStar)+1);
|
||||
}else{
|
||||
especialEquipStar.put(equipStar,1);
|
||||
}
|
||||
|
||||
if(equipStar>data.especialEquipMaxLeve){
|
||||
data.especialEquipMaxLeve=equipStar;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.Map;
|
|||
* Author: zsx
|
||||
* CreateDate: 2020/6/1 12:03
|
||||
*/
|
||||
public class UpJewlDataManager extends AbstractDataManager{
|
||||
public class UpAllBaublesLvDataManager extends AbstractDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
|
@ -26,14 +26,14 @@ public class UpJewlDataManager extends AbstractDataManager{
|
|||
|
||||
@Override
|
||||
public boolean isFinish(User user,CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
if(data.jewl_all_leve==cfgValue[1][0]){
|
||||
if(data.getBaubles_all_level() == cfgValue[1][0]){
|
||||
return true;
|
||||
}
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
for (Map.Entry<Integer, List<TeamPosHeroInfo>> entry:teamPosForHero.entrySet()){
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos =entry.getValue();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = entry.getValue();
|
||||
if(teamPosHeroInfos.size()!=6){
|
||||
continue;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class UpJewlDataManager extends AbstractDataManager{
|
|||
}
|
||||
}
|
||||
if(isAll){
|
||||
data.jewl_all_leve=cfgValue[1][0];
|
||||
data.setBaubles_all_level(cfgValue[1][0]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class UpJewlDataManager extends AbstractDataManager{
|
|||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.jewl_all_leve;
|
||||
return data.getBaubles_all_level();
|
||||
}
|
||||
|
||||
}
|
|
@ -200,16 +200,16 @@ public class MissionEventDistributor {
|
|||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.HERO_IN_TEAM_NUMS);
|
||||
typeList.add(MissionType.JEWL_ALL_LEVE);
|
||||
typeList.add(MissionType.BAUBLES_ALL_LEVE);
|
||||
eventEnumListMap.put(GameEvent.HERO_IN_TEAM,typeList);
|
||||
eventProcessor.put(GameEvent.HERO_IN_TEAM,new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.ESPECIAL_EQUIP);
|
||||
typeList.add(MissionType.JEWL_ALL_LEVE);
|
||||
typeList.add(MissionType.SPECIAL_EQUIP_LEVEL_UP);
|
||||
eventEnumListMap.put(GameEvent.ESPECIAL_EQUIP,typeList);
|
||||
eventProcessor.put(GameEvent.ESPECIAL_EQUIP,new CumulationDataEventProcessor());
|
||||
typeList.add(MissionType.BAUBLES_EQUIP);
|
||||
typeList.add(MissionType.BAUBLES_ALL_LEVE);
|
||||
typeList.add(MissionType.BAUBLES_EQUIP_LEVEL_UP);
|
||||
eventEnumListMap.put(GameEvent.BAUBLES_EQUIP,typeList);
|
||||
eventProcessor.put(GameEvent.BAUBLES_EQUIP,new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.REARGE_TOTAL);
|
||||
|
|
|
@ -1462,4 +1462,9 @@ public class PlayerLogic {
|
|||
LOGGER.info("封禁列表已迁移");
|
||||
}
|
||||
|
||||
public static int getCrossStartWeek(){
|
||||
long before = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
return (int) TimeUtils.AfterTimeByWeek(before, TimeUtils.now());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -295,19 +295,16 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
|
|||
}
|
||||
|
||||
private int checkIndex(ISession iSession, PacketNetData packetNetData) {
|
||||
/* if(packetNetData.getMsgId() == MessageTypeProto.MessageType.LOGIN_REQUEST_VALUE || packetNetData.getMsgId() == MessageTypeProto.MessageType.RECONNECT_REQUEST_VALUE){
|
||||
return 0;
|
||||
}*/
|
||||
int index = packetNetData.getIndex();
|
||||
|
||||
if (iSession.getIndex() >= index) {
|
||||
byte[] message = iSession.getCacheMessage(index);
|
||||
if (message == null) {
|
||||
//TODO error
|
||||
LOGGER.info("the uid={},the msg={} is processing,the index={},the sessionIndex={}", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId()), index, iSession.getIndex());
|
||||
LOGGER.error("the uid={},the msg={} is processing,the index={},the sessionIndex={}", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId()), index, iSession.getIndex());
|
||||
return 1;
|
||||
} else {
|
||||
LOGGER.info("the uid={},the msg={} reback", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId()));
|
||||
LOGGER.error("the uid={},the msg={} reback", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId()));
|
||||
iSession.writeAndFlush(message);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.thread;
|
|||
|
||||
|
||||
import com.ljsd.IManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.thread.task.*;
|
||||
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -118,6 +119,8 @@ public class ThreadManager implements IManager {
|
|||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), delayForMinute + 10, 1, TimeUnit.SECONDS));
|
||||
// 战力任务
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new ForceRankTask(), 60,5, TimeUnit.SECONDS));
|
||||
// 每小时减容用户缓存
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(UserManager::adjustCacheBasedOnCurrentLoad, 10, 60, TimeUnit.MINUTES));
|
||||
// 定时重启线程池
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new Thread(() -> {
|
||||
long lastMilis = System.currentTimeMillis();
|
||||
|
|
|
@ -170,12 +170,12 @@ public class MinuteTask extends Thread {
|
|||
LOGGER.error("Exception::=>{}", e.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
OnlineUserManager.checkOnline();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}", e.toString());
|
||||
}
|
||||
// try {
|
||||
// OnlineUserManager.checkOnline();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// LOGGER.error("Exception::=>{}", e.toString());
|
||||
// }
|
||||
|
||||
try {
|
||||
CrossRankManager.getInstance().crossRankHandle();
|
||||
|
|
|
@ -70,9 +70,8 @@ public class CBean2Proto {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param item
|
||||
* @param item 道具
|
||||
* @param itemNum 道具数量,一般是增量,-1 表示全量
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.Item getItem(Item item,long itemNum){
|
||||
if(itemNum == -1){
|
||||
|
@ -89,8 +88,6 @@ public class CBean2Proto {
|
|||
|
||||
/**
|
||||
* 获取玩家头像框列表
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public static List<CommonProto.HeadFrameList> getHeadFrameList(User user){
|
||||
List<CommonProto.HeadFrameList> headFrameLists = new ArrayList<>();
|
||||
|
@ -187,8 +184,6 @@ public class CBean2Proto {
|
|||
|
||||
/**
|
||||
* 获取玩家皮肤列表
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public static List<CommonProto.UserMountInfo> getUserMountList(User user) {
|
||||
List<CommonProto.UserMountInfo> userMountLists = new ArrayList<>();
|
||||
|
@ -213,12 +208,11 @@ public class CBean2Proto {
|
|||
user.getPlayerInfoManager().setUserMountValidTime(validTime);
|
||||
return userMountLists;
|
||||
}
|
||||
/* 获取已选择的助战列表
|
||||
* @param user
|
||||
* @return
|
||||
* @throws Exception
|
||||
|
||||
/**
|
||||
* 获取已选择的助战列表
|
||||
*/
|
||||
public static List<CommonProto.HelpFightList> getHelpFightList(User user) throws Exception {
|
||||
public static List<CommonProto.HelpFightList> getHelpHeroList(User user) throws Exception {
|
||||
List<CommonProto.HelpFightList> lists = new ArrayList<>();
|
||||
// 助战英雄列表
|
||||
String subKey = HelpHeroLogic.subKey(user.getId(),HelpHeroLogic.CHOOSE);
|
||||
|
@ -227,48 +221,95 @@ public class CBean2Proto {
|
|||
return lists;
|
||||
}
|
||||
for (HelpHero hero : helpHeroMap.values()) {
|
||||
lists.add(helpHeroProto(hero));
|
||||
lists.add(buildHelpHeroToProto(hero));
|
||||
}
|
||||
return lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编译助战状态
|
||||
* @param propertyItems 装备列表
|
||||
* @return proto对象
|
||||
*/
|
||||
private static List<CommonProto.Equip> buildHelpFightEquip(List<PropertyItem> propertyItems){
|
||||
List<CommonProto.Equip> resultEquip = new ArrayList<>();
|
||||
if (propertyItems != null && !propertyItems.isEmpty()){
|
||||
for (PropertyItem item : propertyItems) {
|
||||
if (item == null){
|
||||
continue;
|
||||
}
|
||||
resultEquip.add(getPropertyEquipProto(item));
|
||||
}
|
||||
}
|
||||
return resultEquip;
|
||||
}
|
||||
|
||||
/**
|
||||
* 助战,redis类型转proto
|
||||
*/
|
||||
public static CommonProto.HelpFightList helpHeroProto(HelpHero helpHero) throws Exception {
|
||||
public static CommonProto.HelpFightList buildHelpHeroToProto(HelpHero helpHero) throws Exception {
|
||||
User otherUser = UserManager.getUser(helpHero.getUid());
|
||||
// 魂宝灵宝
|
||||
List<CommonProto.Equip> jewels = new ArrayList<>();
|
||||
List<PropertyItem> jewel = helpHero.getJewels();
|
||||
if (jewel != null && !jewel.isEmpty()){
|
||||
jewel.forEach(item->jewels.add(getPropertyEquipProto(item)));
|
||||
}
|
||||
List<CommonProto.Equip> jewels = buildHelpFightEquip(helpHero.getJewels());
|
||||
// 法相
|
||||
List<CommonProto.Equip> faxiang = new ArrayList<>();
|
||||
List<PropertyItem> faxiangs = helpHero.getFaxiangs();
|
||||
if (faxiangs != null && !faxiangs.isEmpty()){
|
||||
faxiangs.forEach(item->faxiang.add(getPropertyEquipProto(item)));
|
||||
}
|
||||
List<CommonProto.Equip> faxiang = buildHelpFightEquip(helpHero.getFaxiangs());
|
||||
// 装备详细信息
|
||||
Hero hero = helpHero.getHero();
|
||||
List<CommonProto.Equip> equips = new ArrayList<>();
|
||||
Map<Integer, Integer> equip = helpHero.getHero().getEquipByPositionMap();
|
||||
equip.values().forEach(v->equips.add(getEquipProto(v)));
|
||||
hero.getEquipByPositionMap().values().forEach(v->equips.add(getEquipProto(v)));
|
||||
// 法宝
|
||||
CommonProto.Equip.Builder baublesProto = CommonProto.Equip.newBuilder();
|
||||
if (helpHero.getBaubles() != null){
|
||||
baublesProto = getBaublesProto(helpHero.getBaublesList(), helpHero.getBaubles()).toBuilder();
|
||||
}
|
||||
// 获取英雄信息
|
||||
return CommonProto.HelpFightList.newBuilder()
|
||||
.setUid(otherUser.getId())
|
||||
.setUserName(otherUser.getPlayerInfoManager().getNickName())
|
||||
.setGuildName(helpHero.getHelpType())
|
||||
.setTrailType(helpHero.getFunctionType().getPropertyId())
|
||||
.setHero(getHero(helpHero.getHero()))
|
||||
.setHero(getHero(hero))
|
||||
.setState(helpHero.getState())
|
||||
.addAllJewels(jewels)
|
||||
.addAllFaxiang(faxiang)
|
||||
.setFourTotal(helpHero.getFourTotalTier())
|
||||
.addAllEquips(equips)
|
||||
.setBaubles(baublesProto)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static List<PropertyItem> clonePropertyItemList(EquipManager equipManager, Set<String> infoList){
|
||||
/**
|
||||
* 助战,hero对象转redis类型
|
||||
* 存入redis时调用
|
||||
*/
|
||||
public static HelpHero buildHelpHeroToRedis(User user, Hero hero) {
|
||||
// 获取神将类型
|
||||
HelpTypeEnum type = HelpTypeEnum.getType(hero.getPropertyId());
|
||||
// 英雄镜像
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
// 魂宝灵宝镜像
|
||||
List<PropertyItem> jewels = buildPropertyItemList(equipManager, hero.getJewelInfo());
|
||||
// 法相
|
||||
List<PropertyItem> faxiangs = buildPropertyItemList(equipManager, hero.getFaxiangList());
|
||||
// 结果返回,援助类型不在这里写
|
||||
HelpHero helpHero = new HelpHero();
|
||||
helpHero.setUid(user.getId());
|
||||
helpHero.setFunctionType(type);
|
||||
helpHero.setCreatTime(TimeUtils.now());
|
||||
helpHero.setHero(hero);
|
||||
helpHero.setState(0);
|
||||
helpHero.setJewels(jewels);
|
||||
helpHero.setFaxiangs(faxiangs);
|
||||
helpHero.setFourTotalTier(user.getPlayerInfoManager().getFourChallengeTotal());
|
||||
helpHero.setBaubles(equipManager.getBaubles(hero.getBauBlesId()));
|
||||
helpHero.setBaublesList(buildBaublesList(equipManager, hero.getBauBlesId()));
|
||||
return helpHero;
|
||||
}
|
||||
|
||||
/**
|
||||
* 克隆装备信息
|
||||
*/
|
||||
public static List<PropertyItem> buildPropertyItemList(EquipManager equipManager, Set<String> infoList){
|
||||
List<PropertyItem> List = new ArrayList<>();
|
||||
if (infoList == null || infoList.isEmpty()){
|
||||
return List;
|
||||
|
@ -276,39 +317,34 @@ public class CBean2Proto {
|
|||
for (String id: infoList){
|
||||
PropertyItem item = equipManager.getEquip(id);
|
||||
if (item != null){
|
||||
List.add(item.clone());
|
||||
List.add(item);
|
||||
}
|
||||
}
|
||||
return List;
|
||||
}
|
||||
|
||||
/**
|
||||
* 助战,hero对象转redis类型
|
||||
* 存入redis时调用
|
||||
* 克隆装备信息
|
||||
*/
|
||||
public static HelpHero heroToHelpHero(User user,Hero hero) throws Exception {
|
||||
// 获取神将类型
|
||||
HelpTypeEnum type = HelpTypeEnum.getType(hero.getPropertyId());
|
||||
// 英雄镜像
|
||||
Hero heroVo = hero.clone();
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
// 魂宝灵宝镜像
|
||||
List<PropertyItem> jewels = clonePropertyItemList(equipManager, heroVo.getJewelInfo());
|
||||
// 法相
|
||||
List<PropertyItem> faxiangs = clonePropertyItemList(equipManager, heroVo.getFaxiangList());
|
||||
|
||||
// 结果返回,援助类型不在这里写
|
||||
HelpHero helpHero = new HelpHero();
|
||||
helpHero.setUid(user.getId());
|
||||
helpHero.setFunctionType(type);
|
||||
helpHero.setCreatTime(TimeUtils.now());
|
||||
helpHero.setHero(heroVo);
|
||||
helpHero.setState(0);
|
||||
helpHero.setJewels(jewels);
|
||||
helpHero.setFaxiangs(faxiangs);
|
||||
helpHero.setFourTotalTier(user.getPlayerInfoManager().getFourChallengeTotal());
|
||||
helpHero.setBaubles(equipManager.getBaubles(hero.getBauBlesId()));
|
||||
return helpHero;
|
||||
public static List<Baubles> buildBaublesList(EquipManager equipManager, String baublesId){
|
||||
List<Baubles> list = new ArrayList<>();
|
||||
// 当前法宝信息
|
||||
Baubles baublesEquip = equipManager.getBaubles(baublesId);
|
||||
if (baublesEquip == null){
|
||||
return list;
|
||||
}
|
||||
// 庇佑信息
|
||||
Set<String> blessList = baublesEquip.getBlessList();
|
||||
if (blessList != null && !blessList.isEmpty()){
|
||||
for (String id: blessList){
|
||||
Baubles item = equipManager.getBaubles(id);
|
||||
if (item == null){
|
||||
continue;
|
||||
}
|
||||
list.add(item);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static CommonProto.UserRank.Builder getOneUserRank(User everyUser, int function, com.ljsd.jieling.logic.dao.root.ArenaRecord arenaRecord){
|
||||
|
@ -323,6 +359,10 @@ public class CBean2Proto {
|
|||
.setFirstOrMini(function);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取英雄信息
|
||||
* @param hero 英雄
|
||||
*/
|
||||
public static CommonProto.Hero getHero(Hero hero){
|
||||
// 魂印
|
||||
List<CommonProto.SoulPos> soulPoss = new ArrayList<>();
|
||||
|
@ -491,6 +531,20 @@ public class CBean2Proto {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取法宝信息
|
||||
*/
|
||||
public static CommonProto.Equip getBaublesProto(List<Baubles> baublesList, Baubles bauBles){
|
||||
CommonProto.Equip.Builder builder = getPropertyEquipProto(bauBles).toBuilder();
|
||||
if (baublesList != null && !baublesList.isEmpty()){
|
||||
for (Baubles baubles : baublesList) {
|
||||
CommonProto.Equip equip = getPropertyEquipProto(baubles);
|
||||
builder.addBless(equip);
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static CommonProto.PokemonInfo getPokemon(Pokemon pokemon) {
|
||||
return CommonProto.PokemonInfo.newBuilder()
|
||||
.setId(pokemon.getId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setTempId(pokemon.getTmpId())
|
||||
|
@ -580,10 +634,10 @@ public class CBean2Proto {
|
|||
StringBuilder monsterSkillList = new StringBuilder(); //火风水地光暗
|
||||
float[] damageReduceFactor = sMonsterConfig.getElementDamageReduceFactor();
|
||||
monsterPropertyList.append(sMonsterConfig.getLevel()).append("#"); //等级
|
||||
monsterPropertyList.append(curHp).append("#"); //生命
|
||||
// 减免系数
|
||||
double downNum = MainLineOrInnerDemonFightHandler.getDownNum(uid, type);
|
||||
// 只减免前这四项
|
||||
monsterPropertyList.append(Math.round(curHp * downNum)).append("#"); //生命
|
||||
monsterPropertyList.append(Math.round(sMonsterConfig.getHp() * downNum)).append("#"); //最大生命
|
||||
monsterPropertyList.append(Math.round(sMonsterConfig.getAttack() * downNum)).append("#");//攻击力
|
||||
monsterPropertyList.append(Math.round(sMonsterConfig.getPhysicalDefence() * downNum)).append("#"); //护甲
|
||||
|
@ -640,8 +694,8 @@ public class CBean2Proto {
|
|||
|
||||
/**
|
||||
* 多对塔专用怪兽信息
|
||||
* @param tower
|
||||
* @param indexId
|
||||
* @param tower 多对塔怪兽表配置信息
|
||||
* @param indexId 位置
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("StringBufferReplaceableByString")
|
||||
|
@ -1064,9 +1118,9 @@ public class CBean2Proto {
|
|||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon(Pokemon pokemon,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon( com.ljsd.jieling.thrift.idl.Pokemon pokemon,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
}
|
||||
// public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon( com.ljsd.jieling.thrift.idl.Pokemon pokemon,int position){
|
||||
// return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
// }
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByMagicSoldier(MagicSoldier soldier){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(soldier.getId())
|
||||
|
|
|
@ -3,10 +3,7 @@ package com.ljsd.jieling.util;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
|
@ -99,16 +96,18 @@ public class DynamicLRUCache<K, V> {
|
|||
public void shrinkToFit() {
|
||||
lock.writeLock().lock();
|
||||
try {
|
||||
if (cache.size() < maxSize / 2) {
|
||||
// 减少缓存大小调整的频率
|
||||
if (cache.size() < maxSize / 2 && maxSize > 100) {
|
||||
maxSize /= 2; // 缩小缓存容量
|
||||
}
|
||||
cache.entrySet().removeIf(entry -> isEntryExpired(entry.getValue()));
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
LOGGER.info("当前用户缓存列表大小,num:{},max:{}",size(),maxSize);
|
||||
LOGGER.info("当前用户缓存列表大小,num:{},max:{}", size(), maxSize);
|
||||
}
|
||||
|
||||
|
||||
private boolean isEntryExpired(TimedCacheEntry<V> entry) {
|
||||
return System.currentTimeMillis() - entry.timestamp > expireTime;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="TrumpBook")
|
||||
|
@ -17,11 +16,10 @@ public class STrumpBook implements BaseConfig {
|
|||
|
||||
private int[][] skillList;
|
||||
|
||||
public static Map<Integer, STrumpBook> sTrumpBookMap;
|
||||
public static Map<Integer, STrumpBook> sTrumpBookMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrumpBookMap=new HashMap<>();
|
||||
sTrumpBookMap = STableManager.getConfig(STrumpBook.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ public class STableManager {
|
|||
try {
|
||||
dealParams(clazz, map, key, type, obj, prarms);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("clazz = [" + clazz + "], line = [" + line.substring(0,10) + "]"+prarms.toString() );
|
||||
LOGGER.warn("clazz = [" + clazz + "], line = [" + line.substring(0,10) + "]"+ Arrays.toString(prarms));
|
||||
throw e;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue