Merge branch 'refs/heads/master_zzxx' into master_xiyou
commit
52f28057e8
|
|
@ -470,4 +470,6 @@ public interface BIReason {
|
|||
int EVERYDAY_DISCOUNT_GET_MISSION_COUNT = 1355;//天天折扣获得档位次数
|
||||
int EVERYDAY_DISCOUNT_COST_MISSION_COUNT = 1356;//天天折扣消耗档位次数
|
||||
int EVERYDAY_DISCOUNT_CLEAN_MISSION_COUNT = 1357;//天天折扣清零次数
|
||||
|
||||
int TRAINGING_SPEED_ITEM_COST = 1358;//特训加速道具消耗
|
||||
}
|
||||
|
|
@ -33,5 +33,4 @@ public class TakeActivityRewardHandler extends BaseHandler<PlayerInfoProto.TakeA
|
|||
user.getUserMissionManager().onGameEvent(user,GameEvent.TAKE_ACTIVITY_REWARD,activityId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.ljsd.jieling.handler.BaseHandler;
|
|||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.EveryDayDiscountUnlockEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.ShanHeSheJiTuStarEvent;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
|
|
@ -117,7 +118,7 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
user.getHardStageManager().updateString("chapterMap." + nodeConfig.getChapter(), chapterMap.get(nodeConfig.getChapter()));
|
||||
}
|
||||
} else if (nodeConfig.getStageType() == 1 || nodeConfig.getStageType() == 3) {
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误!!"));
|
||||
}
|
||||
if (nodeConfig.getStageType() == 1) {
|
||||
|
|
@ -214,6 +215,7 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
//排行榜章节
|
||||
int hardStageId = SHardStage.getStageIdByChapterAndSection(user.getHardStageManager().getCurChapter(), user.getHardStageManager().getCurNode());
|
||||
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 1, hardStageId));
|
||||
Poster.getPoster().dispatchEvent(new EveryDayDiscountUnlockEvent(user.getId()));
|
||||
|
||||
ItemUtil.dropByGroup(user, dropList.stream().mapToInt(Integer::intValue).toArray(), drop, 1, BIReason.HARD_STAGE_GET);
|
||||
fightStartResponse.setDrop(drop);
|
||||
|
|
|
|||
|
|
@ -1772,6 +1772,7 @@ public class MapLogic {
|
|||
* 7:达到指定英雄等级及数量
|
||||
* 8:主角等级
|
||||
* 9: 小兵关卡条件
|
||||
* 10:开服天数
|
||||
*/
|
||||
public boolean checkMainLevelOpen(User user, int[][] openRule) throws Exception {
|
||||
boolean isOpen = true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ljsd.jieling.handler.training;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.TrainingLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 特训道具加速
|
||||
*/
|
||||
@Component
|
||||
public class TrainingPropSpeedHandler extends BaseHandler<HeroInfoProto.TrainingPropSpeedRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.TrainingPropSpeedRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.TrainingPropSpeedRequest proto) throws Exception {
|
||||
TrainingLogic.getInstance().trainingPropSpeed(iSession, proto);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.db.redis.RedisKey;
|
|||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.exception.ErrorTableException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.handler.activity.BlessInfoConfig;
|
||||
|
|
@ -23,6 +24,8 @@ import com.ljsd.jieling.logic.dao.SecretBoxManager;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.item.ItemLog;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
|
||||
|
|
@ -2004,4 +2007,66 @@ public class ActivityLogic implements IEventHandler{
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 天天0.1折购买校验
|
||||
*/
|
||||
public void EveryDayDiscountBuyCheck(User user, int goodId, int update) throws ErrorTableException {
|
||||
long now = TimeUtils.now();
|
||||
Map<Integer, SEveryDayGift> giftMap = SEveryDayGift.giftactivitymap.get(goodId);
|
||||
if (giftMap == null || giftMap.isEmpty()){
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<Integer, SEveryDayGift> entry : giftMap.entrySet()) {
|
||||
Integer activityId = entry.getKey();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(activityId);
|
||||
if (mission == null){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数退出,玩家没有活动信息,uid:{},活动id:{},耗时:{}",user.getId(), activityId,TimeUtils.now()-now);
|
||||
continue;
|
||||
}
|
||||
EveryDayDiscountBuyCheckAndUpdate(user, activityId, entry.getValue().getId(), update);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 天天0.1折购买校验并消耗
|
||||
*/
|
||||
public void EveryDayDiscountBuyCheckAndUpdate(User user, int activityId, int missionId, int update) throws ErrorTableException {
|
||||
long now = TimeUtils.now();
|
||||
SEveryDayGift dayGift = SEveryDayGift.map.get(missionId);
|
||||
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(activityId);
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
if (progressInfo == null){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数退出,没有商品信息,uid:{},活动id:{},商品id:{},耗时:{}",user.getId(), activityId, missionId, TimeUtils.now()-now);
|
||||
throw new ErrorTableException(183);// 档位不存在
|
||||
}
|
||||
if (progressInfo.getState() != 1){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数退出,商品为解锁,uid:{},活动id:{},商品id:{},耗时:{}",user.getId(), activityId, missionId, TimeUtils.now()-now);
|
||||
throw new ErrorTableException(184);// 档位未解锁
|
||||
}
|
||||
if (progressInfo.getProgrss() <= 0){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数退出,商品够吗次数不足,uid:{},活动id:{},商品id:{},耗时:{}",user.getId(), activityId, missionId, TimeUtils.now()-now);
|
||||
throw new ErrorTableException(185);// 购买次数不足
|
||||
}
|
||||
// 消耗
|
||||
if (update == 1){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数消耗,uid:{},活动id:{},商品id:{}",user.getId(), activityId, missionId);
|
||||
// 消耗默认次数
|
||||
if (progressInfo.getProgrss() == dayGift.getLimit()){
|
||||
int packId = ToolsUtil.getPackId(missionId);
|
||||
ActivityProgressInfo packInfo = mission.getActivityMissionMap().get(packId);
|
||||
if (packInfo != null && packInfo.getProgrss() > 0){
|
||||
packInfo.setProgrss(packInfo.getProgrss() - 1);
|
||||
mission.getActivityMissionMap().put(packId,packInfo);
|
||||
}
|
||||
}
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 1, BIReason.EVERYDAY_DISCOUNT_COST_MISSION_COUNT,dayGift.getItemID(), progressInfo.getProgrss(), progressInfo.getProgrss()-1));
|
||||
progressInfo.setProgrss(progressInfo.getProgrss() - 1);
|
||||
// 更新数据库
|
||||
mission.getActivityMissionMap().put(missionId,progressInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.activity;
|
|||
|
||||
import com.ljsd.jieling.exception.ErrorTableException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
|
|
@ -18,10 +19,7 @@ import rpc.protocols.CommonProto;
|
|||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
|
|
@ -37,6 +35,7 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
Poster.getPoster().listenEvent(this, ActivityZeroRefreshEvent.class);
|
||||
Poster.getPoster().listenEvent(this, EveryDayDiscountNumUpdateEvent.class);
|
||||
Poster.getPoster().listenEvent(this, EveryDayDiscountUnlockEvent.class);
|
||||
Poster.getPoster().listenEvent(this, EveryDayDiscountBuyCheckEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,110 +51,65 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
User user = null;
|
||||
|
||||
// 任务完成刷新次数
|
||||
if (event instanceof EveryDayDiscountNumUpdateEvent){
|
||||
EveryDayDiscountNumUpdateEvent event1 = (EveryDayDiscountNumUpdateEvent) event;
|
||||
user = UserManager.getUser(event1.getUserId());
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
}
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(countProgress);
|
||||
if (progressInfo == null){
|
||||
progressInfo = new ActivityProgressInfo();
|
||||
}
|
||||
int count = progressInfo.getProgrss();
|
||||
progressInfo.setProgrss(count + event1.getNum());
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 0, BIReason.EVERYDAY_DISCOUNT_GET_REFRESH_COUNT,1578, count, progressInfo.getProgrss()));
|
||||
progressInfo.setState(1);
|
||||
mission.getActivityMissionMap().put(countProgress, progressInfo);
|
||||
}
|
||||
|
||||
// 每日刷新
|
||||
if (event instanceof ActivityZeroRefreshEvent) {
|
||||
ActivityZeroRefreshEvent event1 = (ActivityZeroRefreshEvent) event;
|
||||
user = UserManager.getUser(event1.getUserId());
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_TASK_REFRESH, id);
|
||||
cleanValue(user);
|
||||
}
|
||||
|
||||
// 位置解锁
|
||||
if (event instanceof EveryDayDiscountUnlockEvent) {
|
||||
Map<Integer, SEveryDayGift> giftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (giftMap == null){
|
||||
LOGGER.error("天天0.1折扣活动,活动id未找到对应档位:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
EveryDayDiscountUnlockEvent event1 = (EveryDayDiscountUnlockEvent) event;
|
||||
user = UserManager.getUser(event1.getUserId());
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
}
|
||||
for (SEveryDayGift dayGift : giftMap.values()) {
|
||||
int missionId = dayGift.getId();
|
||||
int defaultCount = dayGift.getLimit();
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(missionId);
|
||||
if (info != null){
|
||||
continue;
|
||||
}
|
||||
boolean open = ifOpen(user, missionId);
|
||||
if (!open){
|
||||
continue;
|
||||
}
|
||||
info = new ActivityProgressInfo();
|
||||
info.setProgrss(defaultCount);
|
||||
info.setState(1);
|
||||
mission.getActivityMissionMap().put(missionId, info);
|
||||
// 默认开启次数存储
|
||||
int packId = ToolsUtil.getPackId(missionId);
|
||||
ActivityProgressInfo storage = new ActivityProgressInfo();
|
||||
storage.setProgrss(defaultCount);
|
||||
storage.setState(1);
|
||||
mission.getActivityMissionMap().put(packId, storage);
|
||||
}
|
||||
}
|
||||
if (user == null) {
|
||||
LOGGER.error("天天0.1折扣活动未知监听退出:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
// 状态推送
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("天天0.1折扣活动:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
finishMissionUpdate(event);
|
||||
// 清零次数
|
||||
cleanValue(event);
|
||||
// 解锁商品位置
|
||||
unlockGoodPosition(event);
|
||||
// 购买检查
|
||||
buyCheckAndUpdate(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断档位是否解锁
|
||||
* 任务完成刷新次数
|
||||
*/
|
||||
public static boolean ifOpen(User user, int id) {
|
||||
SEveryDayGift dayGift = SEveryDayGift.map.get(id);
|
||||
if (dayGift == null){
|
||||
return false;
|
||||
public void finishMissionUpdate(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
if (!(event instanceof EveryDayDiscountNumUpdateEvent)) {
|
||||
return;
|
||||
}
|
||||
for (int[] ints : dayGift.getCondition()) {
|
||||
if (ints[0] == 1) { // 等级
|
||||
if (user.getPlayerInfoManager().getLevel() < ints[1]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
EveryDayDiscountNumUpdateEvent event1 = (EveryDayDiscountNumUpdateEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
LOGGER.error("天天0.1折扣活动,任务完成刷新抽奖次数退出,玩家任务信息为空:{},uid:{},耗时:{}",id, user.getId(), TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(countProgress);
|
||||
if (progressInfo == null){
|
||||
progressInfo = new ActivityProgressInfo();
|
||||
}
|
||||
int count = progressInfo.getProgrss();
|
||||
progressInfo.setProgrss(count + event1.getNum());
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 0, BIReason.EVERYDAY_DISCOUNT_GET_REFRESH_COUNT,1578, count, progressInfo.getProgrss()));
|
||||
progressInfo.setState(1);
|
||||
mission.getActivityMissionMap().put(countProgress, progressInfo);
|
||||
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("天天0.1折扣活动,任务完成刷新抽奖次数:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清零次数, 并保留默认次数
|
||||
*/
|
||||
public void cleanValue(User user){
|
||||
public void cleanValue(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
if (!(event instanceof ActivityZeroRefreshEvent)) {
|
||||
return;
|
||||
}
|
||||
ActivityZeroRefreshEvent event1 = (ActivityZeroRefreshEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_TASK_REFRESH, id);
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
LOGGER.error("天天0.1折扣活动,清零次数退出,玩家任务信息为空:{},uid:{},耗时:{}",id, user.getId(), TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
Map<Integer, SEveryDayGift> giftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (giftMap == null){
|
||||
LOGGER.error("天天0.1折扣活动,清零次数退出,天天礼包表无活动信息:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
for (SEveryDayGift dayGift : giftMap.values()) {
|
||||
|
|
@ -175,17 +129,98 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
progressInfo.setProgrss(count);
|
||||
mission.getActivityMissionMap().put(missionId, progressInfo);
|
||||
}
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("天天0.1折扣活动,清零次数:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁商品位置
|
||||
*/
|
||||
public void unlockGoodPosition(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
if (!(event instanceof EveryDayDiscountUnlockEvent)) {
|
||||
return;
|
||||
}
|
||||
Map<Integer, SEveryDayGift> giftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (giftMap == null){
|
||||
LOGGER.error("天天0.1折扣活动,解锁商品位置退出,活动id未找到对应档位:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
EveryDayDiscountUnlockEvent event1 = (EveryDayDiscountUnlockEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
LOGGER.error("天天0.1折扣活动,解锁商品位置退出,玩家任务信息为空:{},uid:{},耗时:{}",id, user.getId(), TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
for (SEveryDayGift dayGift : giftMap.values()) {
|
||||
int missionId = dayGift.getId();
|
||||
int defaultCount = dayGift.getLimit();
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(missionId);
|
||||
if (info != null){
|
||||
continue;
|
||||
}
|
||||
boolean open = ifOpen(user, missionId);
|
||||
if (!open){
|
||||
continue;
|
||||
}
|
||||
info = new ActivityProgressInfo();
|
||||
info.setProgrss(defaultCount);
|
||||
info.setState(1);
|
||||
mission.getActivityMissionMap().put(missionId, info);
|
||||
// 默认开启次数存储
|
||||
int packId = ToolsUtil.getPackId(missionId);
|
||||
ActivityProgressInfo storage = new ActivityProgressInfo();
|
||||
storage.setProgrss(defaultCount);
|
||||
storage.setState(1);
|
||||
mission.getActivityMissionMap().put(packId, storage);
|
||||
}
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("天天0.1折扣活动,解锁商品位置:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查验购买次数
|
||||
*/
|
||||
public void buyCheckAndUpdate(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
if (!(event instanceof EveryDayDiscountBuyCheckEvent)) {
|
||||
return;
|
||||
}
|
||||
EveryDayDiscountBuyCheckEvent event1 = (EveryDayDiscountBuyCheckEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
int giftId = event1.getGiftId();
|
||||
int updateState = event1.getUpdateState();
|
||||
SEveryDayGift dayGift = SEveryDayGift.activitygiftmap.getOrDefault(id, new HashMap<>()).get(giftId);
|
||||
if (dayGift == null){
|
||||
LOGGER.error("天天0.1折扣活动,查验购买次数退出,EveryDayGift未找到对应档位:{},礼包id:{},耗时:{}",id,giftId,TimeUtils.now()-now);
|
||||
return;
|
||||
}
|
||||
ActivityLogic.getInstance().EveryDayDiscountBuyCheckAndUpdate(user,id,dayGift.getId(),updateState);
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("天天0.1折扣活动,查验购买次数:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断档位是否解锁
|
||||
*/
|
||||
public static boolean ifOpen(User user, int id) throws Exception {
|
||||
SEveryDayGift dayGift = SEveryDayGift.map.get(id);
|
||||
if (dayGift == null){
|
||||
return false;
|
||||
}
|
||||
return MapLogic.getInstance().checkMainLevelOpen(user, dayGift.getCondition());
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作随机数组
|
||||
*/
|
||||
public int[][] makeRandomArray(List<SEveryDayGift> list) {
|
||||
int[][] result = new int[2][];
|
||||
int[][] result = new int[list.size()][2];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
SEveryDayGift dayGift = list.get(i);
|
||||
result[0][i] = dayGift.getId();
|
||||
result[1][i] = dayGift.getProbability();
|
||||
result[i][0] = dayGift.getId();
|
||||
result[i][1] = dayGift.getProbability();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -215,6 +250,14 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
.build();
|
||||
missionInfos.add(build);
|
||||
}
|
||||
// 可刷新次数
|
||||
ActivityProgressInfo progressInfo = progressInfoMap.getOrDefault(countProgress, new ActivityProgressInfo());
|
||||
CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
||||
.setMissionId(countProgress)
|
||||
.setProgress(progressInfo.getProgrss())
|
||||
.setState(progressInfo.getState())
|
||||
.build();
|
||||
missionInfos.add(build);
|
||||
return missionInfos;
|
||||
}
|
||||
|
||||
|
|
@ -250,9 +293,12 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
}
|
||||
list.add(dayGift);
|
||||
}
|
||||
if (list.size() <= 0){
|
||||
throw new ErrorTableException(183);// 档位不存在
|
||||
}
|
||||
int[][] randomArray = makeRandomArray(list);
|
||||
int index = ToolsUtil.getRandomInt(randomArray[1]);
|
||||
int missId = randomArray[0][index];
|
||||
int missId = randomArray[index][0];
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(missId);
|
||||
// 道具日志记录
|
||||
int itemID = dayGiftMap.get(missId).getItemID();
|
||||
|
|
@ -264,41 +310,11 @@ public class EveryDayDiscountActivity extends AbstractActivity {
|
|||
progressInfo.setProgrss(progressInfo.getProgrss() - 1);
|
||||
mission.getActivityMissionMap().put(missionId, progressInfo);
|
||||
}
|
||||
// 其他档位id,消耗次数
|
||||
else {
|
||||
SEveryDayGift dayGift = SEveryDayGift.map.get(missionId);
|
||||
if (dayGift == null){
|
||||
throw new ErrorTableException(183);// 档位不存在
|
||||
}
|
||||
if (progressInfo.getState() != 1){
|
||||
throw new ErrorTableException(184);// 档位未解锁
|
||||
}
|
||||
if (progressInfo.getProgrss() <= 0){
|
||||
throw new ErrorTableException(185);// 购买次数不足
|
||||
}
|
||||
// 消耗默认次数
|
||||
if (progressInfo.getProgrss() == dayGift.getLimit()){
|
||||
int packId = ToolsUtil.getPackId(missionId);
|
||||
ActivityProgressInfo packInfo = mission.getActivityMissionMap().get(packId);
|
||||
if (packInfo != null && packInfo.getProgrss() > 0){
|
||||
packInfo.setProgrss(packInfo.getProgrss() - 1);
|
||||
mission.getActivityMissionMap().put(packId,packInfo);
|
||||
}
|
||||
}
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 1, BIReason.EVERYDAY_DISCOUNT_COST_MISSION_COUNT,dayGift.getItemID(), progressInfo.getProgrss(), progressInfo.getProgrss()-1));
|
||||
progressInfo.setProgrss(progressInfo.getProgrss() - 1);
|
||||
// 更新数据库
|
||||
mission.getActivityMissionMap().put(missionId,progressInfo);
|
||||
// 协议返回
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
}
|
||||
|
||||
// 协议返回
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
// 状态推送
|
||||
sendActivityProgress(session, null);
|
||||
// 打点上报
|
||||
reportTakeActivityReward(user, new int[][]{}, missionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
* @Description: 每日折扣购买检验
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EveryDayDiscountBuyCheckEvent implements IEvent {
|
||||
|
||||
private int userId;//uid
|
||||
private int giftId;//礼包id
|
||||
private int updateState;//0 不消耗 1消耗
|
||||
|
||||
public EveryDayDiscountBuyCheckEvent() {
|
||||
}
|
||||
|
||||
public EveryDayDiscountBuyCheckEvent(int userId, int giftId, int updateState) {
|
||||
this.userId = userId;
|
||||
this.giftId = giftId;
|
||||
this.updateState = updateState;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public int getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public int getUpdateState() {
|
||||
return updateState;
|
||||
}
|
||||
}
|
||||
|
|
@ -207,9 +207,11 @@ public class ArenaLogic {
|
|||
|
||||
if (ifUpdate){
|
||||
// 免费特权
|
||||
PlayerLogic.getInstance().checkAndUpdate(user, battleFree, 1);
|
||||
// 道具校验
|
||||
ItemUtil.itemCost(user, new int[][]{sArenaSetting.getCost()}, BIReason.ARENA_CHALLENGE_CONSUME, 0);
|
||||
boolean update = PlayerLogic.getInstance().checkAndUpdate(user, battleFree, 1);
|
||||
if (!update){
|
||||
// 道具校验
|
||||
ItemUtil.itemCost(user, new int[][]{sArenaSetting.getCost()}, BIReason.ARENA_CHALLENGE_CONSUME, 0);
|
||||
}
|
||||
}else {
|
||||
// 免费特权
|
||||
boolean vipUpdate = PlayerLogic.getInstance().check(user, battleFree, 1);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class HardStageManager extends MongoBase {
|
|||
}
|
||||
|
||||
public Map<Integer, HardStageChapter> getChapterMap(User user) throws Exception {
|
||||
if (null == chapterMap || chapterMap.size() <1) {
|
||||
if (null == chapterMap || chapterMap.isEmpty()) {
|
||||
Map<Integer, HardStageChapter> map = initChapterMap(user);
|
||||
setChapterMap(map);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.hero;
|
|||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.exception.ErrorTableException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
|
|
@ -13,12 +14,14 @@ import com.ljsd.jieling.network.session.ISession;
|
|||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -113,7 +116,7 @@ public class TrainingLogic {
|
|||
int archId = proto.getArchId();
|
||||
TrainingArchitecture architecture = getTrainingArchitecture(user, archId);
|
||||
if (architecture == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "建筑未解锁!");
|
||||
throw new ErrorTableException(190);//建筑未解锁
|
||||
}
|
||||
|
||||
STrainBuild trainBuild = STrainBuild.getMap().get(archId);
|
||||
|
|
@ -187,7 +190,7 @@ public class TrainingLogic {
|
|||
|
||||
TrainingArchitecture architecture = getTrainingArchitecture(user, architectureId);
|
||||
if (architecture == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "建筑未解锁!");
|
||||
throw new ErrorTableException(190);//建筑未解锁
|
||||
}
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
Set<Integer> heroIds = STrain.getTrainByHeroMap().keySet();
|
||||
|
|
@ -243,6 +246,65 @@ public class TrainingLogic {
|
|||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.TrainingResponse_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特训道具加速
|
||||
*/
|
||||
public void trainingPropSpeed(ISession iSession, HeroInfoProto.TrainingPropSpeedRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
int archId = proto.getArchId();
|
||||
int itemId = proto.getItemId();
|
||||
int num = proto.getNum();
|
||||
|
||||
TrainingArchitecture architecture = getTrainingArchitecture(user, archId);
|
||||
if (architecture == null){
|
||||
throw new ErrorTableException(190);//建筑未解锁
|
||||
}
|
||||
if (StringUtil.isEmpty(architecture.getHeroId())){
|
||||
throw new ErrorTableException(191);//特训建筑中没有英雄在特训
|
||||
}
|
||||
STrainBuild trainBuild = STrainBuild.getMap().get(archId);
|
||||
STrainBuildLevel buildLevel = STrainBuildLevel.getPoolMap().get(trainBuild.getLvupCostPool()).get(architecture.getLv());
|
||||
if (buildLevel == null || buildLevel.getCost() == null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL, "未找到对应等级的建筑!");
|
||||
}
|
||||
Map<Integer, Long> selected = ToolsUtil.selectCostItem(buildLevel.getCost());
|
||||
if (!selected.containsKey(itemId)){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);//物品不足
|
||||
}
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Hero hero = heroManager.getHero(architecture.getHeroId());
|
||||
if (hero == null){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_NO_HERO);//英雄不存在
|
||||
}
|
||||
boolean checkCost = ItemUtil.checkCost(user, new int[][]{{itemId, num}});
|
||||
if (!checkCost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);//物品不足
|
||||
}
|
||||
Training training = hero.getTraining();
|
||||
int gain = buildLevel.getGain();
|
||||
int exp = (int) (selected.get(itemId) * gain);
|
||||
// 攻击
|
||||
if (buildLevel.getPosition() == 1){
|
||||
training.addAttackExp(exp);
|
||||
}
|
||||
// 防御
|
||||
if (buildLevel.getPosition() == 2){
|
||||
training.addDefenseExp(exp);
|
||||
}
|
||||
// 生命
|
||||
if (buildLevel.getPosition() == 3){
|
||||
training.addHpExp(exp);
|
||||
}
|
||||
hero.setTraining(training);
|
||||
ItemUtil.itemCost(user, new int[][]{{itemId, num}}, BIReason.TRAINGING_SPEED_ITEM_COST, 1);
|
||||
|
||||
CommonProto.HeroTraining trainingProto = CBean2Proto.getTrainingProto(hero);
|
||||
CommonProto.TrainingArchitectureInfo architectureProto = CBean2Proto.getTrainingArchitectureProto(architecture);
|
||||
HeroInfoProto.TrainingResponse.Builder builder = HeroInfoProto.TrainingResponse.newBuilder();
|
||||
builder.setTraining(trainingProto).setInfo(architectureProto);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.TrainingPropSpeedResponse_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特训解锁技能
|
||||
* 消耗 主角礼物,变身卡,灵兽,神兵,英雄
|
||||
|
|
|
|||
|
|
@ -1167,9 +1167,6 @@ public class MissionLoigc {
|
|||
case FRIEND_APPLY:
|
||||
count = cumulationData.friendApplyCount;
|
||||
break;
|
||||
case LOGIN_TIMES:
|
||||
count = cumulationData.loginTimesDay.get(missionSubType[0]);
|
||||
break;
|
||||
case REARGE_TOTAL:
|
||||
count = cumulationData.rechargeTotal;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -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 LoginTimeManager implements BaseDataManager{
|
||||
public class LoginTimeManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int dayTh = (int) parm[1];
|
||||
data.loginTimesDay.put(dayTh, data.loginTimesDay.getOrDefault(dayTh,0) + 1);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return getProcess(user, data, cfgValue[0]) >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.loginTimesDay.getOrDefault(missionSubType[0], 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,15 +19,14 @@ import java.util.Map;
|
|||
public class EveryDayDiscountDataEventProcessor implements BaseGameEventProcessor{
|
||||
@Override
|
||||
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception {
|
||||
List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event);
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
EveryDayDiscountType everyDayDiscountType = userMissionManager.getEveryDayDiscountType();
|
||||
CumulationData cumulationData = userMissionManager.getEveryDayDiscountCumulationData();
|
||||
|
||||
List<MissionStateChangeInfo> missionStateChangeInfos = misionTypeListMap.get(GameMisionType.EVERY_DAY_DISCOUNT);
|
||||
for (MissionType type : typeList) {
|
||||
CumulationData.Result result = cumulationData.updateData(type, parm);
|
||||
everyDayDiscountType.calCumulationDataResult(user,result,missionStateChangeInfos,cumulationData);
|
||||
}
|
||||
MissionType missionType = (MissionType) parm[0];
|
||||
CumulationData.Result result = cumulationData.updateData(missionType, parm);
|
||||
everyDayDiscountType.calCumulationDataResult(user,result,missionStateChangeInfos,cumulationData);
|
||||
userMissionManager.setEveryDayDiscountType(everyDayDiscountType);
|
||||
userMissionManager.setEveryDayDiscountCumulationData(cumulationData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ public class MissionEventDistributor {
|
|||
eventProcessor.put(GameEvent.HOME_TASK_UPDATE,new CumulationDataEventProcessor());
|
||||
|
||||
// 天天0.1折修改
|
||||
typeList.clear();
|
||||
typeList.add(MissionType.LOGIN_TIMES);
|
||||
typeList.add(MissionType.DAILY_TASK_FINISH);
|
||||
typeList.add(MissionType.ARENA_CHALLENEGE_NUMS);
|
||||
|
|
@ -410,6 +411,10 @@ public class MissionEventDistributor {
|
|||
SExploreTask exploreTask = STableManager.getConfig(SExploreTask.class).get(missionStateChangeInfo.getMissionId());
|
||||
progress = exploreTask.getValues()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.EVERY_DAY_DISCOUNT){
|
||||
SEveryDayGiftTask task = SEveryDayGiftTask.map.get(missionStateChangeInfo.getMissionId());
|
||||
progress = task.getTaskValue()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.SEVENMISSION){
|
||||
STreasureTaskConfig sTreasureTaskConfig = STreasureTaskConfig.sTreasureTaskConfigMap.get(missionStateChangeInfo.getMissionId());
|
||||
if(sTreasureTaskConfig.getTaskType() != MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
||||
|
|
|
|||
|
|
@ -188,6 +188,8 @@ public class BuyGoodsNewLogic {
|
|||
private static void rechargeHandler(User user, String orderId, int giftId, int amount, List<int[][]> list) throws Exception {
|
||||
// 其他礼包活动
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),giftId,1,1));
|
||||
// 天天零点1折购买消耗
|
||||
Poster.getPoster().dispatchEvent(new EveryDayDiscountBuyCheckEvent(user.getId(),giftId,1));
|
||||
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(giftId);
|
||||
// 测试购买 || 扶持购买
|
||||
|
|
@ -1062,9 +1064,6 @@ public class BuyGoodsNewLogic {
|
|||
|
||||
/**
|
||||
* 礼包购买判断
|
||||
* @param session
|
||||
* @param goodsId
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void checkBuyGoods(ISession session,int goodsId) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
|
@ -1080,11 +1079,15 @@ public class BuyGoodsNewLogic {
|
|||
throw new ErrorTableException(104,"礼包已购买");
|
||||
}
|
||||
|
||||
// 天天礼包活动查验购买
|
||||
ActivityLogic.getInstance().EveryDayDiscountBuyCheck(user, goodsId, 0);
|
||||
|
||||
//生成cp订单号
|
||||
String order = "0";
|
||||
if(config.getPrice() > 0){
|
||||
order = KeyGenUtils.produceIdByModule(UUIDEnum.ORDER, user.getId());
|
||||
}
|
||||
|
||||
PlayerInfoProto.CheckBuyGoodsResponse response = PlayerInfoProto.CheckBuyGoodsResponse.newBuilder().setOrderId(order).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHECK_BUY_GOODS_RESPONSE_VALUE,response);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -422,7 +422,12 @@ public class StoreLogic {
|
|||
if(rewardId==0){
|
||||
continue;
|
||||
}
|
||||
itemNumMap.put(rewardId, 0);
|
||||
int rewardNum = 0;
|
||||
SStoreConfig storeItem = SStoreConfig.getStoreItem(storeId, rewardId);
|
||||
if (storeItem.getRelatedtoVIP() == 1){
|
||||
rewardNum = user.getPlayerInfoManager().getVipInfo().getOrDefault(storeItem.getLimit(), new VipInfo()).getCount();
|
||||
}
|
||||
itemNumMap.put(rewardId, rewardNum);
|
||||
}
|
||||
return itemNumMap;
|
||||
}
|
||||
|
|
@ -670,11 +675,7 @@ public class StoreLogic {
|
|||
if(limit > buyTimes){
|
||||
//判断购买物品数量是否超出可购数量
|
||||
int canBuyTimes = limit - buyTimes;
|
||||
if(itemNum > canBuyTimes) {
|
||||
check = false;
|
||||
}else{
|
||||
check = true;
|
||||
}
|
||||
check = itemNum <= canBuyTimes;
|
||||
}else{
|
||||
check = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,4 +229,20 @@ public class ToolsUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static Map<Integer, Long> selectCostItem(int[][] costItems) {
|
||||
HashMap<Integer, Long> map = new HashMap<>();
|
||||
if (costItems == null){
|
||||
return map;
|
||||
}
|
||||
for (int[] costItem : costItems){
|
||||
int itemId = costItem[0];
|
||||
int itemNum = costItem[1];
|
||||
if (itemId == 0 || itemNum == 0){
|
||||
continue;
|
||||
}
|
||||
map.put(itemId, map.getOrDefault(itemId, 0L) + itemNum);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,22 @@ public class SEveryDayGift implements BaseConfig {
|
|||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGift>> activitymap = new HashMap<>();
|
||||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGift>> activitygiftmap = new HashMap<>();
|
||||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGift>> giftactivitymap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SEveryDayGift.class);
|
||||
for (SEveryDayGift value : map.values()) {
|
||||
activitymap.putIfAbsent(value.globalActivity, new HashMap<>());
|
||||
activitymap.get(value.globalActivity).put(value.id, value);
|
||||
activitymap.putIfAbsent(value.getGlobalActivity(), new HashMap<>());
|
||||
activitymap.get(value.getGlobalActivity()).put(value.getId(), value);
|
||||
|
||||
activitygiftmap.putIfAbsent(value.getGlobalActivity(), new HashMap<>());
|
||||
activitygiftmap.get(value.getGlobalActivity()).put(value.getRechargeID(), value);
|
||||
|
||||
giftactivitymap.putIfAbsent(value.getRechargeID(), new HashMap<>());
|
||||
giftactivitymap.get(value.getRechargeID()).put(value.getGlobalActivity(), value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ public class SEveryDayGiftTask implements BaseConfig {
|
|||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SEveryDayGiftTask.class);
|
||||
for (SEveryDayGiftTask task : map.values()) {
|
||||
activitymap.put(task.getGlobalActivity(), new HashMap<>());
|
||||
activitymap.putIfAbsent(task.getGlobalActivity(), new HashMap<>());
|
||||
activitymap.get(task.getGlobalActivity()).put(task.getId(), task);
|
||||
|
||||
taskmap.put(task.getTaskType(), new HashMap<>());
|
||||
taskmap.putIfAbsent(task.getTaskType(), new HashMap<>());
|
||||
taskmap.get(task.getTaskType()).put(task.getId(), task);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class STrainBuildLevel implements BaseConfig {
|
|||
|
||||
private int time;
|
||||
|
||||
private int[][] speedUp;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
@ -84,5 +85,7 @@ public class STrainBuildLevel implements BaseConfig {
|
|||
return time;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getSpeedUp() {
|
||||
return speedUp;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue