Merge branch 'master_test_gn' into master_prb_gn
commit
ae47b63edd
|
|
@ -333,9 +333,11 @@ public class RedisKey {
|
|||
|
||||
public static final String SERVER_LEVEL_RANK = "SERVER_LEVEL_RANK";
|
||||
|
||||
public static final String SERVER_SPLIT_INFO = "SERVER_SPLIT_INFO";
|
||||
public static final String SERVER_SPLIT_INFO = "SERVER_SPLIT_INFO";// 游戏服跨服分组id缓存
|
||||
|
||||
public static final String CROSS_SERVER_GROUP = "CROSS_SERVER_GROUP";
|
||||
public static final String SERVER_STATE = "SERVER_STATE";// 服务器状态缓存
|
||||
|
||||
public static final String CROSS_SERVER_GROUP = "CROSS_SERVER_GROUP";// gm跨服分组id缓存
|
||||
|
||||
public static final String SERVER_SPLIT_MAIL_INFO = "SERVER_SPLIT_MAIL_INFO";
|
||||
|
||||
|
|
|
|||
|
|
@ -407,4 +407,7 @@ public interface BIReason {
|
|||
int TRANSFORMATION_FORCE_STAR_COST= 1247;//身外化身之力消耗
|
||||
int TRANSFORMATION_CARD_ACTIVATION = 1248;//身外化身卡片升星奖励
|
||||
|
||||
int COMPARENUM_LEVEL_REWARD = 1306; // 比数字小游戏过关奖励
|
||||
int COMPARENUM_TOTAL_REWARD = 1307; // 比数字小游戏章节累计奖励
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.ljsd.jieling.handler.comparenum;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCompareNumChapter;
|
||||
import config.SCompareNumSetting;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class CompareNumBonusHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.COMPARENUM_BONUS_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.CompareNumBonusRequest request = PlayerInfoProto.CompareNumBonusRequest.parseFrom(bytes);
|
||||
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int rewardId = request.getRewardId();
|
||||
|
||||
if (user.getPlayerInfoManager().getCompareNumRewardInfo().contains(rewardId)) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("already get bonus"));
|
||||
}
|
||||
|
||||
int chapter = rewardId / 1000;
|
||||
int levelNum = rewardId % 1000;
|
||||
|
||||
int curLevelId = user.getPlayerInfoManager().getCompareNumLevelId();
|
||||
|
||||
SCompareNumSetting mainCfg = SCompareNumSetting.getConfig(curLevelId);
|
||||
if (mainCfg == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid cfg data"));
|
||||
}
|
||||
|
||||
if (mainCfg.getChapter() < chapter) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("chapter not enough"));
|
||||
}
|
||||
|
||||
SCompareNumChapter chapterCfg = SCompareNumChapter.getConfig(chapter);
|
||||
if (chapterCfg == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid chapterCfg data"));
|
||||
}
|
||||
|
||||
int[][] rewardInfo = chapterCfg.getReward();
|
||||
|
||||
PlayerInfoProto.CompareNumBonusResponse.Builder response = PlayerInfoProto.CompareNumBonusResponse.newBuilder();
|
||||
if (mainCfg.getChapter() == chapter) {
|
||||
for (int[] reward: rewardInfo) {
|
||||
if (reward[0] == levelNum) {
|
||||
if (levelNum > SCompareNumSetting.getChapterNumById(curLevelId, user.getPlayerInfoManager().isCompareNumEndGame())) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("passport not enough"));
|
||||
}
|
||||
int[] dropList = new int[1];
|
||||
dropList[0] = reward[1];
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropList,1,0, BIReason.COMPARENUM_TOTAL_REWARD);
|
||||
response.setDrop(drop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mainCfg.getChapter() > chapter) {
|
||||
for (int[] reward: rewardInfo) {
|
||||
if (reward[0] == levelNum) {
|
||||
int[] dropList = new int[1];
|
||||
dropList[0] = reward[1];
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropList,1,0, BIReason.COMPARENUM_TOTAL_REWARD);
|
||||
response.setDrop(drop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (response.hasDrop()) {
|
||||
Set<Integer> info = user.getPlayerInfoManager().getCompareNumRewardInfo();
|
||||
info.add(rewardId);
|
||||
user.getPlayerInfoManager().setCompareNumRewardInfo(info);
|
||||
|
||||
|
||||
PlayerInfoProto.CompareNumDataIndication.Builder indication = PlayerInfoProto.CompareNumDataIndication.newBuilder();
|
||||
indication.setLevelId(user.getPlayerInfoManager().getCompareNumLevelId());
|
||||
indication.setCompleteNum(SCompareNumSetting.getChapterNumById(user.getPlayerInfoManager().getCompareNumLevelId(), user.getPlayerInfoManager().isCompareNumEndGame()));
|
||||
for (int id : user.getPlayerInfoManager().getCompareNumRewardInfo()) {
|
||||
indication.addRewardIdArr(id);
|
||||
}
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(session.getUid());
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.COMPARENUM_DATA_INDICATION_VALUE, indication.build(), true);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.COMPARENUM_BONUS_RESPONSE_VALUE,
|
||||
response.build(), true);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
package com.ljsd.jieling.handler.comparenum;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCompareNumChapter;
|
||||
import config.SCompareNumSetting;
|
||||
import config.SMainLevelConfig;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.TreeMap;
|
||||
|
||||
|
||||
public class CompareNumEndGameHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.COMPARENUM_END_GAME_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.CompareNumEndGameRequest request = PlayerInfoProto.CompareNumEndGameRequest.parseFrom(bytes);
|
||||
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int levelId = request.getLevelId();
|
||||
int result = request.getResult();
|
||||
|
||||
PlayerInfoProto.CompareNumEndGameResponse.Builder response = PlayerInfoProto.CompareNumEndGameResponse.newBuilder();
|
||||
if(result == 0){
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.COMPARENUM_END_GAME_RESPONSE_VALUE,
|
||||
response.build(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
int curLevelId = user.getPlayerInfoManager().getCompareNumLevelId();
|
||||
if (curLevelId <= 0 || curLevelId < levelId) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid CompareNumLevelId"));
|
||||
}
|
||||
|
||||
SCompareNumSetting cfg = SCompareNumSetting.getConfig(levelId);
|
||||
if (cfg == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid cfg data"));
|
||||
}
|
||||
|
||||
SCompareNumChapter chapterCfg = SCompareNumChapter.getConfig(cfg.getChapter());
|
||||
if (chapterCfg == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid chaptercfg data"));
|
||||
}
|
||||
|
||||
int lastId = (int)((TreeMap)SCompareNumSetting.getCompareNumSettingMap()).lastEntry().getKey();
|
||||
if (curLevelId != lastId && user.getPlayerInfoManager().isCompareNumEndGame()) {
|
||||
user.getPlayerInfoManager().setCompareNumEndGame(false);
|
||||
}
|
||||
/*
|
||||
章节解锁条件
|
||||
1.玩家等级
|
||||
2.通关普通副本关卡
|
||||
*/
|
||||
for (int[] limit: chapterCfg.getLimit()) {
|
||||
|
||||
if (limit[0] == 1) {
|
||||
if (limit[1] > user.getPlayerInfoManager().getLevel()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid level"));
|
||||
}
|
||||
}
|
||||
else if (limit[0] == 2) {
|
||||
SMainLevelConfig mineMainLevelConfig = SMainLevelConfig.fightPreMap.get(user.getMainLevelManager().getFightId());
|
||||
if (mineMainLevelConfig != null && mineMainLevelConfig.getDifficulty() == 1) {
|
||||
if (limit[1] > user.getMainLevelManager().getFightId()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid FightId"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (curLevelId == levelId) {
|
||||
|
||||
/**
|
||||
关卡解锁条件
|
||||
1.前置关卡
|
||||
2.玩家等级
|
||||
3.通关普通副本关卡
|
||||
*/
|
||||
for (int[] limit: cfg.getLevelLimit()) {
|
||||
if (limit[0] == 1) {
|
||||
if (limit[1] > user.getPlayerInfoManager().getLevel()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid level"));
|
||||
}
|
||||
}
|
||||
else if (limit[0] == 2) {
|
||||
SMainLevelConfig mineMainLevelConfig = SMainLevelConfig.fightPreMap.get(user.getMainLevelManager().getFightId());
|
||||
if (mineMainLevelConfig != null && mineMainLevelConfig.getDifficulty() == 1) {
|
||||
if (limit[1] > user.getMainLevelManager().getFightId()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid FightId"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!user.getPlayerInfoManager().isCompareNumEndGame()) {
|
||||
int nextId = 0;
|
||||
if (lastId == curLevelId) {
|
||||
nextId = curLevelId;
|
||||
user.getPlayerInfoManager().setCompareNumEndGame(true);
|
||||
}
|
||||
else {
|
||||
nextId = curLevelId + 1;
|
||||
SCompareNumSetting nextCfg = SCompareNumSetting.getConfig(nextId);
|
||||
if (nextCfg == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid nextCfg data"));
|
||||
}
|
||||
}
|
||||
|
||||
user.getPlayerInfoManager().setCompareNumLevelId(nextId);
|
||||
user.getPlayerInfoManager().setCompareNumLevelTime(TimeUtils.nowInt());
|
||||
|
||||
PlayerInfoProto.CompareNumDataIndication.Builder indication = PlayerInfoProto.CompareNumDataIndication.newBuilder();
|
||||
indication.setLevelId(user.getPlayerInfoManager().getCompareNumLevelId());
|
||||
indication.setCompleteNum(SCompareNumSetting.getChapterNumById(user.getPlayerInfoManager().getCompareNumLevelId(), user.getPlayerInfoManager().isCompareNumEndGame()));
|
||||
for (int rewardId: user.getPlayerInfoManager().getCompareNumRewardInfo()) {
|
||||
indication.addRewardIdArr(rewardId);
|
||||
}
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(session.getUid());
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.COMPARENUM_DATA_INDICATION_VALUE, indication.build(), true);
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, cfg.getPassReward(), BIReason.COMPARENUM_LEVEL_REWARD);
|
||||
response.setDrop(drop);
|
||||
response.setNextId(nextId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.COMPARENUM_END_GAME_RESPONSE_VALUE,
|
||||
response.build(), true);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.ljsd.jieling.handler.comparenum;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCompareNumSetting;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class CompareNumInfoHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.COMPARENUM_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.CompareNumInfoRequest request = PlayerInfoProto.CompareNumInfoRequest.parseFrom(bytes);
|
||||
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int chapterId = request.getChapterId();
|
||||
|
||||
List<SCompareNumSetting> list = SCompareNumSetting.getListByChapter(chapterId);
|
||||
if (list == null) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("invalid chapterId"));
|
||||
}
|
||||
|
||||
Set<Integer> userIds = new HashSet<>();
|
||||
List<Integer> friends = user.getFriendManager().getFriends();
|
||||
userIds.addAll(friends);
|
||||
GuildInfo guildInfo = GuilidManager.getGuildInfo(user.getPlayerInfoManager().getGuildId());
|
||||
if (guildInfo != null) {
|
||||
for (Set<Integer> items : guildInfo.getMembers().values()) {
|
||||
userIds.addAll(items);
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<Integer, List<CommonProto.CompareNumLevelUserInfo>> userInfoMap = new HashMap<>();
|
||||
for (int uid: userIds) {
|
||||
User friend = UserManager.getUser(uid);
|
||||
int levelId = friend.getPlayerInfoManager().getCompareNumLevelId();
|
||||
SCompareNumSetting cfg = SCompareNumSetting.getConfig(levelId);
|
||||
if (cfg != null && cfg.getChapter() == chapterId) {
|
||||
CommonProto.CompareNumLevelUserInfo info = CommonProto.CompareNumLevelUserInfo.newBuilder()
|
||||
.setUid(friend.getId())
|
||||
.setHeadFrame(friend.getPlayerInfoManager().getHeadFrame())
|
||||
.setTime(friend.getPlayerInfoManager().getCompareNumLevelTime())
|
||||
.build();
|
||||
userInfoMap.computeIfAbsent(levelId, n -> new ArrayList<>()).add(info);
|
||||
}
|
||||
}
|
||||
|
||||
PlayerInfoProto.CompareNumInfoResponse.Builder response = PlayerInfoProto.CompareNumInfoResponse.newBuilder();
|
||||
response.setLevelId(user.getPlayerInfoManager().getCompareNumLevelId());
|
||||
|
||||
CommonProto.CompareNumLevelInfo.Builder levelInfo = CommonProto.CompareNumLevelInfo.newBuilder();
|
||||
for (Map.Entry<Integer, List<CommonProto.CompareNumLevelUserInfo>> entry: userInfoMap.entrySet()) {
|
||||
levelInfo.setLevelId(entry.getKey());
|
||||
entry.getValue().sort(Comparator.comparingInt(CommonProto.CompareNumLevelUserInfo::getTime));
|
||||
levelInfo.addAllUserInfo(entry.getValue());
|
||||
response.addLevelInfo(levelInfo);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.COMPARENUM_INFO_RESPONSE_VALUE,
|
||||
response.build(), true);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.handler.comparenum;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCompareNumSetting;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
public class GetCompareInfoHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_COMPARENUM_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
PlayerManager player = user.getPlayerInfoManager();
|
||||
|
||||
PlayerInfoProto.GetCompareNumInfoResponse.Builder response = PlayerInfoProto.GetCompareNumInfoResponse.newBuilder();
|
||||
|
||||
if (user.getPlayerInfoManager().getCompareNumLevelId() == 0) {
|
||||
user.getPlayerInfoManager().setCompareNumLevelId(1);
|
||||
}
|
||||
|
||||
response.setLevelId(player.getCompareNumLevelId())
|
||||
.setCompleteNum(SCompareNumSetting.getChapterNumById(player.getCompareNumLevelId(), player.isCompareNumEndGame()))
|
||||
.addAllRewardIdArr(player.getCompareNumRewardInfo());
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.GET_COMPARENUM_INFO_RESPONSE_VALUE, response.build(), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,8 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
|
@ -95,6 +97,8 @@ public class UpPracticeLevelHandler extends BaseHandler<HeroInfoProto.UpPractice
|
|||
}
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
||||
// 特权任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.XIUXING_UP, MissionType.XIUXING_LEVEL, 0);
|
||||
// 升级返回
|
||||
HeroInfoProto.UpPracticeLevelResponse build = HeroInfoProto.UpPracticeLevelResponse.newBuilder().setPracticeLevel(xiuXian2.getId()).build();
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.UpPracticeLevelResponse_VALUE,build,true);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ 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;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MapInfoProto;
|
||||
|
|
@ -480,6 +482,10 @@ public class JourneyMap {
|
|||
arrivePath.setMapPointId(0);
|
||||
user.getMapManager().updateJourneyInfoByMapId(mapId,pathInfo);
|
||||
ItemUtil.itemCost(user,map,BIReason.JOURNEY_DO_CONSUME,1);
|
||||
|
||||
//消耗云游值任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.XIAOYAOYOU_CONSUME, MissionType.XIAOYAOYOU_CONSUME_NUM, consume[1]);
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build(),true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCompareNumSetting;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/10/28 17:35:00
|
||||
* @Description: 比数小游戏 命令: comparenum 角色id levelId
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class Cmd_comparenum extends GmRoleAbstract {
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
User user = getUser();
|
||||
PlayerManager player = user.getPlayerInfoManager();
|
||||
|
||||
int levelId = Integer.parseInt(args[0]);
|
||||
|
||||
player.setCompareNumLevelId(levelId);
|
||||
player.setCompareNumLevelTime(TimeUtils.nowInt());
|
||||
|
||||
PlayerInfoProto.CompareNumDataIndication.Builder indication = PlayerInfoProto.CompareNumDataIndication.newBuilder();
|
||||
indication.setLevelId(player.getCompareNumLevelId());
|
||||
indication.setCompleteNum(SCompareNumSetting.getChapterNumById(player.getCompareNumLevelId(), player.isCompareNumEndGame()));
|
||||
indication.addAllRewardIdArr(player.getCompareNumRewardInfo());
|
||||
|
||||
ISession session = OnlineUserManager.sessionMap.get(user.getId());
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.COMPARENUM_DATA_INDICATION_VALUE, indication.build(), true);
|
||||
|
||||
LOGGER.info(user.getId() + "的关卡ID已设为:" + levelId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -336,10 +336,17 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
*/
|
||||
public List<String> getCrossServersByGroup(){
|
||||
int group = getCrossGroup();
|
||||
// 跨服分组id
|
||||
Map<String, Integer> values = RedisUtil.getInstence().getMapValues(RedisKey.SERVER_SPLIT_INFO, "", String.class, Integer.class);
|
||||
// 服务器状态
|
||||
Map<String, String> serverStates = RedisUtil.getInstence().getMapValues(RedisKey.SERVER_STATE, "", String.class, String.class);
|
||||
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (Map.Entry<String, Integer> entry : values.entrySet()) {
|
||||
if (entry.getValue() == group){
|
||||
// 获取服务器状态
|
||||
String serverStatesOrDefault = serverStates.getOrDefault(entry.getValue(), "1");
|
||||
// "-2"表示未运营,此类服务器不参与分组
|
||||
if (entry.getValue() == group && !"-2".equals(serverStatesOrDefault)){
|
||||
list.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
|
|
@ -292,6 +294,10 @@ public class SituationLogic {
|
|||
}
|
||||
// 埋点报送
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_SKY_REALM.getType(), sRaceTowerConfig.getType(),id,combat_results,dropResult);
|
||||
|
||||
// 副本挑战任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.INSTANCE_ZONES_CHALLENGE, MissionType.XUANYUAN_INSTANCE_ZONES_NUM, 1);
|
||||
|
||||
BuyGoodsNewLogic.openPush(session, user, PushRechargeType.XIANYUAN_BAOJING.getType(), sRaceTowerConfig.getQuality(), 1);
|
||||
// BuyGoodsNewLogic.openPush(session, user, PushRechargeType.XIANYUAN_BAOJING.getType(), sRaceTowerConfig.getQuality(), 1);
|
||||
// user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ 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 com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
|
|
@ -297,6 +299,10 @@ public class ChallengeLogic {
|
|||
builder.setType(type);
|
||||
LOGGER.info("type :"+type);
|
||||
}
|
||||
|
||||
// 副本挑战任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.INSTANCE_ZONES_CHALLENGE, MissionType.CHALLENGE_INSTANCE_ZONES_NUM, 1);
|
||||
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.CHALLENGE_RESPONSE.getNumber(), builder.build(), true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,7 +237,26 @@ public class CumulationData {
|
|||
* 激活quality品质的法宝聚灵技能num个
|
||||
*/
|
||||
public Map<Integer, Integer> activate_treasure_skill_num = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 进行num次挑战副本
|
||||
*/
|
||||
private int challengeInstanceZonesNum;
|
||||
/**
|
||||
* 进行num次轩辕宝境
|
||||
*/
|
||||
private int xuanyuanInstanceZonesNum;
|
||||
/**
|
||||
* 十绝挑战num次
|
||||
*/
|
||||
private int shijueInstanceZonesNum;
|
||||
/**
|
||||
* 进行num次七界试炼
|
||||
*/
|
||||
private int qijieInstanceZonesNum;
|
||||
/**
|
||||
* 逍遥有消耗云游值num点
|
||||
*/
|
||||
private int xiaoyaoyouConsumeNum;
|
||||
|
||||
//探索
|
||||
/**
|
||||
|
|
@ -663,4 +682,64 @@ public class CumulationData {
|
|||
public void setExploreKillerHistoryHigh_num(int exploreKillerHistoryHigh_num) {
|
||||
this.exploreKillerHistoryHigh_num = exploreKillerHistoryHigh_num;
|
||||
}
|
||||
|
||||
public int getChallengeInstanceZonesNum() {
|
||||
return challengeInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void setChallengeInstanceZonesNum(int challengeInstanceZonesNum) {
|
||||
this.challengeInstanceZonesNum = challengeInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void addChallengeInstanceZonesNum(int num) {
|
||||
this.challengeInstanceZonesNum += num;
|
||||
}
|
||||
|
||||
public int getXuanyuanInstanceZonesNum() {
|
||||
return xuanyuanInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void setXuanyuanInstanceZonesNum(int xuanyuanInstanceZonesNum) {
|
||||
this.xuanyuanInstanceZonesNum = xuanyuanInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void addXuanyuanInstanceZonesNum(int num) {
|
||||
this.xuanyuanInstanceZonesNum += num;
|
||||
}
|
||||
|
||||
public int getShijueInstanceZonesNum() {
|
||||
return shijueInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void setShijueInstanceZonesNum(int num) {
|
||||
this.shijueInstanceZonesNum = num;
|
||||
}
|
||||
|
||||
public void addShijueInstanceZonesNum(int num) {
|
||||
this.shijueInstanceZonesNum += num;
|
||||
}
|
||||
|
||||
public int getQijieInstanceZonesNum() {
|
||||
return qijieInstanceZonesNum;
|
||||
}
|
||||
|
||||
public void setQijieInstanceZonesNum(int num) {
|
||||
this.qijieInstanceZonesNum = num;
|
||||
}
|
||||
|
||||
public void addQijieInstanceZonesNum(int num) {
|
||||
this.qijieInstanceZonesNum += num;
|
||||
}
|
||||
|
||||
public int getXiaoyaoyouConsumeNum() {
|
||||
return xiaoyaoyouConsumeNum;
|
||||
}
|
||||
|
||||
public void setXiaoyaoyouConsumeNum(int xiaoyaoyouConsumeNum) {
|
||||
this.xiaoyaoyouConsumeNum = xiaoyaoyouConsumeNum;
|
||||
}
|
||||
|
||||
public void addXiaoyaoyouConsumeNum(int num) {
|
||||
this.xiaoyaoyouConsumeNum += num;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,16 @@ public class PlayerManager extends MongoBase {
|
|||
// 是否是首次开启四灵
|
||||
private boolean openFourChallenge = false;
|
||||
|
||||
|
||||
// 数字小游戏
|
||||
private int compareNumLevelId;
|
||||
|
||||
private Set<Integer> compareNumRewardInfo = new HashSet<>();
|
||||
|
||||
private int compareNumLevelTime;
|
||||
|
||||
private boolean compareNumEndGame;
|
||||
|
||||
/**
|
||||
* 开启的七界层数, key: 七届类型, value: 最高层数
|
||||
*/
|
||||
|
|
@ -1468,4 +1478,40 @@ public class PlayerManager extends MongoBase {
|
|||
this.treasureReplica = treasureReplica;
|
||||
updateString("treasureReplica",treasureReplica);
|
||||
}
|
||||
|
||||
public int getCompareNumLevelId() {
|
||||
return compareNumLevelId;
|
||||
}
|
||||
|
||||
public void setCompareNumLevelId(int compareNumLevelId) {
|
||||
this.compareNumLevelId = compareNumLevelId;
|
||||
updateString("compareNumLevelId", this.compareNumLevelId);
|
||||
}
|
||||
|
||||
public Set<Integer> getCompareNumRewardInfo() {
|
||||
return compareNumRewardInfo;
|
||||
}
|
||||
|
||||
public void setCompareNumRewardInfo(Set<Integer> compareNumRewardInfo) {
|
||||
this.compareNumRewardInfo = compareNumRewardInfo;
|
||||
updateString("compareNumRewardInfo", this.compareNumRewardInfo);
|
||||
}
|
||||
|
||||
public int getCompareNumLevelTime() {
|
||||
return compareNumLevelTime;
|
||||
}
|
||||
|
||||
public void setCompareNumLevelTime(int compareNumLevelTime) {
|
||||
this.compareNumLevelTime = compareNumLevelTime;
|
||||
updateString("compareNumLevelTime", this.compareNumLevelTime);
|
||||
}
|
||||
|
||||
public boolean isCompareNumEndGame() {
|
||||
return compareNumEndGame;
|
||||
}
|
||||
|
||||
public void setCompareNumEndGame(boolean compareNumEndGame) {
|
||||
this.compareNumEndGame = compareNumEndGame;
|
||||
updateString("compareNumEndGame", this.compareNumEndGame);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ public class HeroLogic {
|
|||
heroManager.putWishStar(type, randomStar);
|
||||
/* ======================= 中不中心愿 ======================= */
|
||||
// 获取钻石抽奖抽中五星的次数
|
||||
boolean randomBol = (num - 1) % 3 == 0;
|
||||
boolean randomBol = (num - 1) % 5 == 0;
|
||||
LOGGER.info("*************************************是否中心愿;num:{},random:{}", num, randomBol);
|
||||
if (!randomBol) {
|
||||
// 不到次数,不走心愿
|
||||
|
|
|
|||
|
|
@ -139,6 +139,12 @@ public enum GameEvent {
|
|||
NEW_HERO_ZHAOMU,//新将招募次数
|
||||
TRUMP_GACHA,//天地洪炉
|
||||
|
||||
XIUXING_UP,//修行境界升级
|
||||
|
||||
XIAOYAOYOU_CONSUME,//逍遥游消耗
|
||||
|
||||
INSTANCE_ZONES_CHALLENGE,//副本挑战
|
||||
|
||||
HOME_TASK_INIT,//家园任务初始化
|
||||
HOME_TASK_UPDATE,//家园任务更新进度
|
||||
HOME_TASK_REWARD,// 家园任务奖励
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
package com.ljsd.jieling.logic.mission;
|
||||
|
||||
public enum GameMisionType {
|
||||
VIPMISSION(1),
|
||||
DAILYMISSION(2),
|
||||
COPYMISSION(3),
|
||||
TREASUREMISSION(4),
|
||||
SEVENMISSION(5),
|
||||
BEGINNERMISSION(6),
|
||||
BLOODYMISSION(7),
|
||||
MISSINGROOMMISSION(8),
|
||||
ACHIEVEMISSION(9),
|
||||
JADE_DYNASTY_MISSION(10),//破阵诛仙任务
|
||||
public enum GameMisionType {
|
||||
VIPMISSION(1),//vip任务
|
||||
DAILYMISSION(2),//每日任务
|
||||
COPYMISSION(3),//精英副本成就任务
|
||||
TREASUREMISSION(4),//管你是谁的宝藏
|
||||
SEVENMISSION(5),//七日狂欢
|
||||
BEGINNERMISSION(6),//主线任务
|
||||
BLOODYMISSION(7),//血战任务
|
||||
MISSINGROOMMISSION(8),//迷宫寻宝任务
|
||||
ACHIEVEMISSION(9),//所有成就任务
|
||||
JADE_DYNASTY_MISSION(10),//主题活动任务
|
||||
COWFLYSKYMISSION(11),//牛气冲天
|
||||
ENDLESS_MISSION(12),
|
||||
ENDLESS_MISSION(12),//无限挑战
|
||||
MISTY_TRIP_MISSION(13),//缥缈之旅
|
||||
HOME_MISSION(14),//家园任务
|
||||
DONGHAIXUNXIAN_MISSION(15),//东海寻仙
|
||||
|
||||
EXPLORE(16),//探索
|
||||
;
|
||||
private int type;
|
||||
|
|
|
|||
|
|
@ -1282,7 +1282,7 @@ public class MissionLoigc {
|
|||
break;
|
||||
case NEW_HERO_ZHAOMU:
|
||||
//新将招募次数
|
||||
count = cumulationData.daily_challenge_count;
|
||||
count = cumulationData.new_hero_zhaomu;
|
||||
break;
|
||||
case DAILY_CHALLENGE_COUNT:
|
||||
//副本挑战次数
|
||||
|
|
|
|||
|
|
@ -176,6 +176,13 @@ public enum MissionType {
|
|||
EXPLORE_PICKYM_NUM(157),//拾取云梦礼num次
|
||||
EXPLORE_ENEMYHISTORYHIGH_NUM(158),//探索杀敌排行历史最高名次达到num
|
||||
|
||||
XIUXING_LEVEL(159),//修行境界达到num(num为xiuxian表ID)
|
||||
CHALLENGE_INSTANCE_ZONES_NUM(160),//进行num次挑战副本
|
||||
XUANYUAN_INSTANCE_ZONES_NUM(161),//进行num次轩辕宝境
|
||||
SHIJUE_INSTANCE_ZONES_NUM(162),//十绝挑战num次
|
||||
QIJIE_INSTANCE_ZONES_NUM(163),//进行num次七界试炼
|
||||
XIAOYAOYOU_CONSUME_NUM(164),//逍遥游消耗云游值num点
|
||||
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
@ -200,164 +207,4 @@ public enum MissionType {
|
|||
return map.get(missionTypeId);
|
||||
}
|
||||
|
||||
//fix 扩展麻烦
|
||||
// public static MissionType findByMissionId(int missionTypeId){
|
||||
// switch (missionTypeId){
|
||||
// case 1:
|
||||
// return RECRUITMENT_RANDOM_HEROES;
|
||||
// case 2:
|
||||
// return COLLECT_QUALITY_HERO;
|
||||
// case 3:
|
||||
// return HERO_LEVLE_COUNT;
|
||||
// case 4:
|
||||
// return POKEMON_ADVANCED;
|
||||
// case 5:
|
||||
// return POKEMON_FORCE;
|
||||
// case 6:
|
||||
// return POKEMON_ALL_FORCE;
|
||||
// case 7:
|
||||
// return ARENA_CHALLENEGE_NUMS;
|
||||
// case 8:
|
||||
// return ARENA_SCORE;
|
||||
// case 9:
|
||||
// return USER_LEVEL;
|
||||
// case 10:
|
||||
// return USER_FORCE;
|
||||
// case 11:
|
||||
// return USER_CONSUMER_GEM;
|
||||
// case 12:
|
||||
// return USER_WORKSHOP_LEVEL;
|
||||
// case 13:
|
||||
// return USER_GET_EQUIP_QUALITY;
|
||||
// case 14:
|
||||
// return LEVEL_STORY_PASS;
|
||||
// case 15:
|
||||
// return GENERAL_STORY_PASS;
|
||||
// case 16:
|
||||
// return HERO_STORY_PASS;
|
||||
// case 17:
|
||||
// return KILL_INVASIONBOSS;
|
||||
// case 18:
|
||||
// return SECRETBOX_TIMES;
|
||||
// case 19:
|
||||
// return EQUIP_FORCE_NUMS;
|
||||
// case 20:
|
||||
// return BUY_GOLD_TIMES;
|
||||
// case 21:
|
||||
// return BUY_STAMINA_TIMES;
|
||||
// case 22:
|
||||
// return WORKSHOP_CREATE_EQUIP_NUMS;
|
||||
// case 23:
|
||||
// return GENERAL_STORY_TIMES;
|
||||
// case 24:
|
||||
// return HERO_STORY_TIMES;
|
||||
// case 25:
|
||||
// return LEVEL_STORY_TIMES;
|
||||
// case 26:
|
||||
// return HERO_LEVLE_TIMES;
|
||||
// case 27:
|
||||
// return TAKE_ADVENTUREREWARD_TIMES;
|
||||
// case 28:
|
||||
// return ARENA_FIGHTSUCCES_TIMES;
|
||||
// case 29:
|
||||
// return FINSIH_DAYILY_TIMES;
|
||||
// case 30:
|
||||
// return RING_FIREA_DVANCED;
|
||||
// case 31:
|
||||
// return COPY_STORY_LEVLE;
|
||||
// case 32:
|
||||
// return COPY_STORY_TIMES;
|
||||
// case 33:
|
||||
// return ELEMENT_RANDOM_TIMES;
|
||||
// case 34:
|
||||
// return HERO_STORY_PLAY_TIMES;
|
||||
// case 35:
|
||||
// return INVASIONBOSS_PLAY_TIMES;
|
||||
// case 36:
|
||||
// return FAST_ADVENTUREREWARD_TIMES;
|
||||
// case 37:
|
||||
// return ARENA_RANK;
|
||||
// case 38:
|
||||
// return SENVER_HAPPY;
|
||||
// case 39:
|
||||
// return HERO_BREAK_TIMES;
|
||||
// case 40:
|
||||
// return TAKE_CHAPTER_REWARD_TIMES;
|
||||
// case 41:
|
||||
// return HERO_UP_STAR_TIMES;
|
||||
// case 42:
|
||||
// return VIP_LEVEL;
|
||||
// case 43:
|
||||
// return TAKE_ONLINE_REWARD_TIMES;
|
||||
// case 44:
|
||||
// return TAKE_SENVEN_LOGIN_REWARD_TIMES;
|
||||
// case 45:
|
||||
// return TAKE_DAILY_BOX_TIMES;
|
||||
// case 46:
|
||||
// return HERO_WEAR_EQUIP_TIMES;
|
||||
// case 47:
|
||||
// return SYNTHESIS_HERO_STAR_TIMES;
|
||||
// case 48:
|
||||
// return USER_CONSUMER_STAMINA;
|
||||
// case 49:
|
||||
// return COLLECT_DIFFERENT_HEROS;
|
||||
// case 50:
|
||||
// return ONE_HERO_UP_STAR_TIMES;
|
||||
// case 51:
|
||||
// return HERO_IN_TEAM_NUMS;
|
||||
// case 52:
|
||||
// return BUY_GROCERY_TIMES;
|
||||
// case 53:
|
||||
// return FRIEND_NUMS;
|
||||
// case 54:
|
||||
// return GIVE_FRIEND_STAMIN_TIMES;
|
||||
// case 55:
|
||||
// return HERO_UP_SOME_STAR_TIMES;
|
||||
// case 56:
|
||||
// return JOIN_MONSTER_ATTACK_TIMES;//参与兽潮来袭的次数
|
||||
// case 57:
|
||||
// return MONSTER_ATTACK_LEVEL;//兽潮来袭到达x层
|
||||
// case 58:
|
||||
// return TO_BE_STRONGER;
|
||||
// case 59:
|
||||
// return BLOODY_KILL_NUMS;
|
||||
// case 60:
|
||||
// return ENDLESS_CONSUME_ACTION;
|
||||
// case 61:
|
||||
// return FAMILY_FIGHT_ATTACK;
|
||||
// case 62:
|
||||
// return ESPECIAL_EQUIP;
|
||||
// case 65:
|
||||
// return FIND_STAR;
|
||||
// case 66:
|
||||
// return TAKE_FRIEND_GIFT;
|
||||
// case 69:
|
||||
// return JOIN_FAMILY;
|
||||
// case 71:
|
||||
// return FRIEND_APPLY;
|
||||
// case 72:
|
||||
// return COMHERO_STORY_PASS;
|
||||
// case 73:
|
||||
// return LOGIN_TIMES;
|
||||
// case 74:
|
||||
// return REARGE_TOTAL;
|
||||
// case 76:
|
||||
// return FINISH_MISSING_ROOM;
|
||||
// case 77:
|
||||
// return REFRESH_MISSING_ROOM;
|
||||
// case 78:
|
||||
// return SPECIAL_EQUIP_LEVEL_UP;
|
||||
// case 83:
|
||||
// return LUCKY_WHEELS_TIMES;
|
||||
// case 84:
|
||||
// return FINISH_EXPEDITION_HERO_TIMES;
|
||||
// case 86:
|
||||
// return SEVEN_GIFT_BUY;
|
||||
// case 87:
|
||||
// return FINISIN_DAILY_CHALLENGE_TIMES;
|
||||
// default:
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 进行num次挑战副本
|
||||
*/
|
||||
public class ChallengeInstanceZonesNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getChallengeInstanceZonesNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getChallengeInstanceZonesNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
int count = (int) parm[1];
|
||||
data.addChallengeInstanceZonesNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -192,6 +192,13 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.GET_TREASURE_SKILL_NUM,new TreasureSkillNumManager());//激活quality品质的法宝聚灵技能num个
|
||||
judges.put(MissionType.HAVE_ID_STAR_LV_POKEMON_NUM,new IdStarLvPokemonNumManager());//拥有指定ID的star星级level等级的灵兽num个
|
||||
|
||||
judges.put(MissionType.XIUXING_LEVEL,new XiuXingLvManager());//修行境界达到num(num为xiuxian表ID)
|
||||
judges.put(MissionType.CHALLENGE_INSTANCE_ZONES_NUM,new ChallengeInstanceZonesNumManager());//进行num次挑战副本
|
||||
judges.put(MissionType.XUANYUAN_INSTANCE_ZONES_NUM,new XuanyuanInstanceZonesNumManager());//进行num次轩辕宝境
|
||||
judges.put(MissionType.SHIJUE_INSTANCE_ZONES_NUM,new shijueInstanceZonesNumManager());//十绝挑战num次
|
||||
judges.put(MissionType.QIJIE_INSTANCE_ZONES_NUM,new qijieInstanceZonesNumManager());//进行num次七界试炼
|
||||
judges.put(MissionType.XIAOYAOYOU_CONSUME_NUM,new XiaoyaoyouConsumeNumManager());// 逍遥有消耗云游值num点
|
||||
|
||||
//探索
|
||||
judges.put(MissionType.EXPLORE_FOOD_NUM,new ExploreFoodManager());
|
||||
judges.put(MissionType.EXPLORE_ENEMY_NUM,new ExploreEnemyManager());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 逍遥有消耗云游值num点
|
||||
*/
|
||||
public class XiaoyaoyouConsumeNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getXiaoyaoyouConsumeNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getXiaoyaoyouConsumeNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
int count = (int) parm[1];
|
||||
data.addXiaoyaoyouConsumeNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 修行境界达到num
|
||||
*/
|
||||
public class XiuXingLvManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
int level = user.getHeroManager().getPracticeLevel();
|
||||
return level >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return user.getHeroManager().getPracticeLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 进行num次轩辕宝境
|
||||
*/
|
||||
public class XuanyuanInstanceZonesNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getXuanyuanInstanceZonesNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getXuanyuanInstanceZonesNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
int count = (int) parm[1];
|
||||
data.addXuanyuanInstanceZonesNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 进行num次七界试炼
|
||||
*/
|
||||
public class qijieInstanceZonesNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getQijieInstanceZonesNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getQijieInstanceZonesNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
int count = (int) parm[1];
|
||||
data.addQijieInstanceZonesNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 十绝挑战num次
|
||||
*/
|
||||
public class shijueInstanceZonesNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getShijueInstanceZonesNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getShijueInstanceZonesNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
int count = (int) parm[1];
|
||||
data.addShijueInstanceZonesNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -93,6 +93,7 @@ public class MissionEventDistributor {
|
|||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.VIP_LEVEL);
|
||||
typeList.add(MissionType.VIP_LEVEL);
|
||||
eventEnumListMap.put(GameEvent.VIP_LEVLUP,typeList);
|
||||
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
|
||||
|
||||
|
|
@ -585,13 +586,31 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.DAILY_CHALLENGE_COUNT, typeList);
|
||||
eventProcessor.put(GameEvent.DAILY_CHALLENGE_COUNT, new CumulationDataEventProcessor());
|
||||
|
||||
//修行境界达到num(num为xiuxian表ID)
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.XIUXING_LEVEL);
|
||||
eventEnumListMap.put(GameEvent.XIUXING_UP, typeList);
|
||||
eventProcessor.put(GameEvent.XIUXING_UP, new DefaultMissionUpdateProcessor());
|
||||
|
||||
// 逍遥有消耗云游值num点
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.XIAOYAOYOU_CONSUME_NUM);
|
||||
eventEnumListMap.put(GameEvent.XIAOYAOYOU_CONSUME, typeList);
|
||||
eventProcessor.put(GameEvent.XIAOYAOYOU_CONSUME, new DefaultMissionUpdateProcessor());
|
||||
|
||||
// 副本挑战,包含(挑战副本,轩辕宝镜,十绝阵,七界试炼)等
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.CHALLENGE_INSTANCE_ZONES_NUM);
|
||||
typeList.add(MissionType.XUANYUAN_INSTANCE_ZONES_NUM);
|
||||
typeList.add(MissionType.SHIJUE_INSTANCE_ZONES_NUM);
|
||||
typeList.add(MissionType.QIJIE_INSTANCE_ZONES_NUM);
|
||||
eventEnumListMap.put(GameEvent.INSTANCE_ZONES_CHALLENGE, typeList);
|
||||
eventProcessor.put(GameEvent.INSTANCE_ZONES_CHALLENGE, new DefaultMissionUpdateProcessor());
|
||||
|
||||
}
|
||||
|
||||
public static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =
|
||||
new ThreadLocal<>();
|
||||
private static final ThreadLocal<Boolean> threadUseFlag =
|
||||
new ThreadLocal<Boolean>();
|
||||
public static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList = new ThreadLocal<>();
|
||||
private static final ThreadLocal<Boolean> threadUseFlag = new ThreadLocal<Boolean>();
|
||||
|
||||
public static List<MissionStateChangeInfo> getMissionStateChangeInfo(GameMisionType gameMisionType){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap = threadMissionChangeList.get();
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public class PlayerLogic {
|
|||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.SAVE_NEW_PLAYER_GUIDE_POINT_RESPONSE_VALUE,null,true);
|
||||
}
|
||||
|
||||
public String getRandomName2() {
|
||||
public String getRandomName2() throws Exception {
|
||||
String name = "";
|
||||
Map<Integer, String> surnameMap = SRandomName.getSurnameMap();
|
||||
Map<Integer, String> nameMap = SRandomName.getNameMap();
|
||||
|
|
@ -143,7 +143,7 @@ public class PlayerLogic {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String[] getRandomNameWithPreAndPost() {
|
||||
public String[] getRandomNameWithPreAndPost() throws Exception {
|
||||
String name ;
|
||||
Map<Integer, String> surnameMap = SRandomName.getSurnameMap();
|
||||
Map<Integer, String> nameMap = SRandomName.getNameMap();
|
||||
|
|
@ -157,7 +157,8 @@ public class PlayerLogic {
|
|||
while (checkNameShield(name));
|
||||
return new String[]{name,pre,post};
|
||||
}
|
||||
private boolean checkNameShield(String name) {
|
||||
|
||||
private boolean checkNameShield(String name) throws Exception {
|
||||
return SensitivewordFilter.isContaintSensitiveWord(name, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ public class CrossRankManager {
|
|||
// 获取本地服排行榜数据
|
||||
Set<ZSetOperations.TypedTuple<String>> range =
|
||||
RedisUtil.getInstence().getZsetreverseRangeWithScores(localKey,"",0,100, false);
|
||||
if (range == null || range.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
// 批量放入跨服排行榜
|
||||
RedisUtil.getInstence().zsetAddAall(key,range);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
|||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
|
|
@ -270,6 +272,10 @@ public class SevenWorldLogic {
|
|||
// 战斗数据
|
||||
builder.setResult(fightResult.getResult());
|
||||
builder.setFightData(fightResult.getFightData());
|
||||
|
||||
// 副本挑战任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.INSTANCE_ZONES_CHALLENGE, MissionType.QIJIE_INSTANCE_ZONES_NUM, 1);
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.thrift.idl.RPCRequestIFace;
|
||||
import com.ljsd.jieling.thrift.pool.ClientAdapterPo;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -32,7 +34,7 @@ public class SensitivewordFilter {
|
|||
* @return 若包含返回true,否则返回false
|
||||
* @version 1.0
|
||||
*/
|
||||
public static boolean isContaintSensitiveWord(String txt, int matchType) {
|
||||
public static boolean isContaintSensitiveWord(String txt, int matchType) throws Exception {
|
||||
boolean hasDirtyWords = isContaintSensitiveWordThrift(txt, matchType);
|
||||
return hasDirtyWords;
|
||||
}
|
||||
|
|
@ -118,11 +120,11 @@ public class SensitivewordFilter {
|
|||
* @return,如果存在,则返回敏感词字符的长度,不存在返回0
|
||||
* @version 1.0
|
||||
*/
|
||||
private static boolean isContaintSensitiveWordThrift(String userName, int type){
|
||||
private static boolean isContaintSensitiveWordThrift(String userName, int type) throws ErrorCodeException {
|
||||
Object o = RedisUtil.getInstence().get(SENSIT_WORD_FILTER_KEY);
|
||||
if (o == null) {
|
||||
LOGGER.info("getSensitiveWord 敏感字检测服未开启");
|
||||
return true;
|
||||
LOGGER.error("getSensitiveWord 敏感字检测服未开启");
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"敏感字检测服未开启");
|
||||
}
|
||||
String address = (String) o;
|
||||
String[] split = address.split("\\:");
|
||||
|
|
@ -131,13 +133,13 @@ public class SensitivewordFilter {
|
|||
try {
|
||||
rPCClient = ClientAdapterPo.getClientAdapterPo(serviceKey);
|
||||
if (rPCClient == null) {
|
||||
return true;
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"敏感字检测服rpc获取信息为null");
|
||||
}
|
||||
boolean result = rPCClient.getClient().isContaintSensitiveWord(userName, type);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
LOGGER.info("getSensitiveWord callback=>",e);
|
||||
return true;
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"敏感字检测服异常");
|
||||
}finally {
|
||||
if (rPCClient != null){
|
||||
rPCClient.returnObject(serviceKey);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,24 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ShieldedWordUtils {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ShieldedWordUtils.class);
|
||||
|
||||
public static boolean checkName(User user , String name,boolean validateSpecStr,ChatContentType chatContentType,User friend) {
|
||||
return checkName(user,name,validateSpecStr,chatContentType);
|
||||
|
||||
}
|
||||
public static boolean checkName(User user , String name,boolean validateSpecStr,ChatContentType chatContentType){
|
||||
boolean result = true;
|
||||
boolean result;
|
||||
if(validateSpecStr){
|
||||
result = validateUserName(name);
|
||||
if(!result){
|
||||
|
|
@ -21,7 +26,12 @@ public class ShieldedWordUtils {
|
|||
}
|
||||
}
|
||||
|
||||
result = isContaintSensitiveWord(name);
|
||||
try {
|
||||
result = isContaintSensitiveWord(name);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("检查名称,报错:"+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
if(result){
|
||||
return false;
|
||||
}
|
||||
|
|
@ -47,7 +57,7 @@ public class ShieldedWordUtils {
|
|||
return matcher.matches();
|
||||
}
|
||||
|
||||
public static boolean isContaintSensitiveWord(String userName){
|
||||
public static boolean isContaintSensitiveWord(String userName) throws Exception{
|
||||
boolean hasDirtyWords = SensitivewordFilter.isContaintSensitiveWord(userName, 1);
|
||||
return hasDirtyWords;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="CompareNumBuild")
|
||||
public class SCompareNumBuild implements BaseConfig {
|
||||
|
||||
private int iD;
|
||||
|
||||
private int[] checkpointsID;
|
||||
|
||||
private int[][] formula;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getID() {
|
||||
return iD;
|
||||
}
|
||||
|
||||
public int[] getCheckpointsID() {
|
||||
return checkpointsID;
|
||||
}
|
||||
|
||||
public int[][] getFormula() {
|
||||
return formula;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="CompareNumChaper")
|
||||
public class SCompareNumChapter implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
private int[][] limit;
|
||||
private int[][] reward;
|
||||
|
||||
private static Map<Integer, SCompareNumChapter> sCompareNumChapterMap = new HashMap<>();
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sCompareNumChapterMap = STableManager.getConfig(SCompareNumChapter.class);
|
||||
}
|
||||
|
||||
public static SCompareNumChapter getConfig(int id) {
|
||||
return sCompareNumChapterMap.get(id);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int[][] getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="CompareNumItem")
|
||||
public class SCompareNumItem implements BaseConfig {
|
||||
|
||||
private int iD;
|
||||
|
||||
private int type;
|
||||
|
||||
private int monsterType;
|
||||
|
||||
private int monsterAttackRange;
|
||||
|
||||
private int combatEffectiveness;
|
||||
|
||||
private int access;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getID() {
|
||||
return iD;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getMonsterType() {
|
||||
return monsterType;
|
||||
}
|
||||
|
||||
public int getMonsterAttackRange() {
|
||||
return monsterAttackRange;
|
||||
}
|
||||
|
||||
public int getCombatEffectiveness() {
|
||||
return combatEffectiveness;
|
||||
}
|
||||
|
||||
public int getAccess() {
|
||||
return access;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Table(name ="CompareNumSetting")
|
||||
public class SCompareNumSetting implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
private int chapter;
|
||||
private int[][] levelLimit;
|
||||
private int[] buildID;
|
||||
private int[][] passReward;
|
||||
private int repeat;
|
||||
|
||||
private static Map<Integer, SCompareNumSetting> sCompareNumSettingMap = new HashMap<>();
|
||||
private static Map<Integer, List<SCompareNumSetting>> chapter2List = new HashMap<>();
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sCompareNumSettingMap = STableManager.getConfig(SCompareNumSetting.class);
|
||||
for (SCompareNumSetting cfg: sCompareNumSettingMap.values()) {
|
||||
chapter2List.computeIfAbsent(cfg.chapter, v -> new ArrayList<>()).add(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getChapterNumById(int id, boolean isEndGame) {
|
||||
int count = 0;
|
||||
SCompareNumSetting cfg = sCompareNumSettingMap.get(id);
|
||||
if (cfg != null) {
|
||||
List<SCompareNumSetting> list = chapter2List.get(cfg.getChapter());
|
||||
if (list != null && list.size() > 0) {
|
||||
SCompareNumSetting info = list.get(0);
|
||||
if (info != null) {
|
||||
int lastId = (int)((TreeMap)SCompareNumSetting.getCompareNumSettingMap()).lastEntry().getKey();
|
||||
if (lastId == id && isEndGame) {
|
||||
count = id - info.getId() + 1;
|
||||
}
|
||||
else {
|
||||
count = id - info.getId();
|
||||
}
|
||||
if (count < 0) {
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// public static int[][] getRewardInfoByChapter(int chapter) {
|
||||
// List<SCompareNumSetting> list = chapter2List.get(chapter);
|
||||
// if (list != null && list.size() > 0) {
|
||||
// SCompareNumSetting info = list.get(0);
|
||||
// if (info != null) {
|
||||
// return info.getReward();
|
||||
// }
|
||||
// }
|
||||
// return new int[0][];
|
||||
// }
|
||||
|
||||
public static SCompareNumSetting getConfig(int id) {
|
||||
return sCompareNumSettingMap.get(id);
|
||||
}
|
||||
|
||||
public static Map<Integer, SCompareNumSetting> getCompareNumSettingMap() {
|
||||
return sCompareNumSettingMap;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getChapter() {
|
||||
return chapter;
|
||||
}
|
||||
|
||||
public int[][] getLevelLimit() {
|
||||
return levelLimit;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getPassReward() {
|
||||
return passReward;
|
||||
}
|
||||
|
||||
public int getRepeat() {
|
||||
return repeat;
|
||||
}
|
||||
|
||||
|
||||
public static List<SCompareNumSetting> getListByChapter(int chapterId) {
|
||||
return chapter2List.get(chapterId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue