Merge branch 'refs/heads/master_zzxx' into master_xiyou
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/thread/task/RetrySendIndicationThread.javamaster_zzxx
commit
e926a53c36
|
|
@ -94,13 +94,13 @@ public interface BIReason {
|
|||
int SYSTERM_OPEN_REWARD = 56;//系统开放奖励
|
||||
|
||||
int HERO_BACK_REWARD = 57 ; //英雄回溯返回东西
|
||||
int EXTRA_DROP_REWARD = 58;// 额外赠送
|
||||
int EXTRA_DROP_REWARD = 58;//额外赠送
|
||||
|
||||
int VIP_LEVEL_REWARD=59;// VIP等級提升补发道具
|
||||
int VIP_LEVEL_REWARD=59;//VIP等級提升补发道具
|
||||
|
||||
int CHAMPIION_BET_REWARD = 60 ; // 巅峰赛竞猜系统赠送
|
||||
int CHAMPIION_BET_REWARD = 60 ; //巅峰赛竞猜系统赠送
|
||||
|
||||
int CHAMPIION_BET_WIN_REWARD = 60 ; // 巅峰赛竞猜赢取
|
||||
int CHAMPIION_BET_WIN_REWARD = 60 ; //巅峰赛竞猜赢取
|
||||
|
||||
int GUILD_BOSS_FIGHT_BASE_REWARD = 61;//工会boss基础奖励
|
||||
int GUILD_BOSS_FIGHT_RANDOM_REWARD = 61;//工会boss随机奖励
|
||||
|
|
@ -177,8 +177,8 @@ public interface BIReason {
|
|||
|
||||
int ENDLESS_TREASURE_REWARD = 100;//无尽秘宝获得
|
||||
int ENDLESS_RESET = 101;//无尽重置获得
|
||||
int HERO_RETURN = 102;// 神将回退
|
||||
int ITEM_RETURN = 103;// 罗浮晶石转化逐胜徽章
|
||||
int HERO_RETURN = 102;//神将回退
|
||||
int ITEM_RETURN = 103;//罗浮晶石转化逐胜徽章
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
|
@ -276,9 +276,9 @@ public interface BIReason {
|
|||
|
||||
int COMPLEX_EQUIP_CONSUME = 1051; //合成英雄
|
||||
|
||||
int SOUL_EQUIP_WEAR_CONSUME = 1052;// 穿魂印消耗
|
||||
int SOUL_EQUIP_WEAR_CONSUME = 1052;//穿魂印消耗
|
||||
|
||||
int SOUL_EQUIP_MERGE_CONSUME = 1054;// 合成魂印消耗
|
||||
int SOUL_EQUIP_MERGE_CONSUME = 1054;//合成魂印消耗
|
||||
|
||||
int JEWEL_BUILD_OR_UP_CONSUME = 1055;//宝器升级或精炼消耗
|
||||
|
||||
|
|
@ -324,16 +324,16 @@ public interface BIReason {
|
|||
|
||||
int GOOD_LUCK_CONSUME = 1079;//扭转乾坤消耗
|
||||
|
||||
int UPGRADE_GOD_TREE = 1086;// 升级神树
|
||||
int UPGRADE_GOD_TREE = 1086;//升级神树
|
||||
|
||||
int HONGMENG_UPGRIDE = 1080; // 鸿蒙碑升级消耗
|
||||
int OPEN_HONGMENG_GRAID = 1081; // 开鸿蒙阵格子消耗
|
||||
int CLEAR_HONGMENG_GRAID = 1082; // 清鸿蒙阵格子cd
|
||||
int HONGMENG_UPGRIDE = 1080; //鸿蒙碑升级消耗
|
||||
int OPEN_HONGMENG_GRAID = 1081; //开鸿蒙阵格子消耗
|
||||
int CLEAR_HONGMENG_GRAID = 1082; //清鸿蒙阵格子cd
|
||||
|
||||
int USE_HEADFRAME = 1088;// 使用头像框
|
||||
int ACTIVE_USERSKIN = 1089;// 激活玩家皮肤
|
||||
int ACTIVE_TITLE = 1090;// 激活玩家称号
|
||||
int ACTIVE_MOUNT = 1091;// 激活玩家坐骑
|
||||
int USE_HEADFRAME = 1088;//使用头像框
|
||||
int ACTIVE_USERSKIN = 1089;//激活玩家皮肤
|
||||
int ACTIVE_TITLE = 1090;//激活玩家称号
|
||||
int ACTIVE_MOUNT = 1091;//激活玩家坐骑
|
||||
int EQUIP_UPLEVEL_COST = 1092;//装备升星消耗(云游商人)
|
||||
int EQUIP_UPLEVEL_REWARD = 1093;//装备升星获得(云游商人)
|
||||
int TA_SUI_LING_XIAO = 1094;//踏碎凌霄
|
||||
|
|
@ -353,7 +353,7 @@ public interface BIReason {
|
|||
|
||||
int HERO_UP_LIKEBLE_COST=1108;//英雄提升好感度消耗
|
||||
|
||||
int TAKE_YUHENLONGDAN = 1109;// 山河社稷每日领取玉衡龙魂
|
||||
int TAKE_YUHENLONGDAN = 1109;//山河社稷每日领取玉衡龙魂
|
||||
|
||||
int GOD_DEVIL_CHANGE = 1110;//神魔功能 英雄转职
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ public interface BIReason {
|
|||
int RIDING_SWARD_REWARD = 1215;//御剑行领取奖励
|
||||
int RIDING_SWARD_BET = 1216;//御剑行押注消耗
|
||||
|
||||
int LEVEL_UP_REWARD = 1220;// 玩家升级赠与的道具
|
||||
int LEVEL_UP_REWARD = 1220;//玩家升级赠与的道具
|
||||
int PRACTICE_SKILL_UP_COST=1221;//修行技能升级消耗
|
||||
int WEEK_CARD_REWARD =1222;//周卡奖励
|
||||
|
||||
|
|
@ -407,8 +407,8 @@ public interface BIReason {
|
|||
int TRANSFORMATION_FORCE_STAR_COST= 1247;//身外化身之力消耗
|
||||
int TRANSFORMATION_CARD_ACTIVATION = 1248;//身外化身卡片升星奖励
|
||||
|
||||
int COMPARENUM_LEVEL_REWARD = 1306; // 比数字小游戏过关奖励
|
||||
int COMPARENUM_TOTAL_REWARD = 1307; // 比数字小游戏章节累计奖励
|
||||
int COMPARENUM_LEVEL_REWARD = 1306; //比数字小游戏过关奖励
|
||||
int COMPARENUM_TOTAL_REWARD = 1307; //比数字小游戏章节累计奖励
|
||||
|
||||
int ZHAIXINGGE_BAKCUP_ITEM = 1308;//摘星阁装备强化调整返还道具
|
||||
int MAXESPECIALEQUIPHANDLE = 1309; //法宝最高上限回滚处理
|
||||
|
|
@ -464,4 +464,10 @@ public interface BIReason {
|
|||
int SOLDIER_MIAN_LEVEL_REWARD = 1350;//小兵主线奖励
|
||||
int COMPARE_NUM_GAME_REWARD = 1351;//比数小游戏挂机奖励
|
||||
int MONEY_BUY_GOOD_COST = 1352;//现金点卷购买礼包消耗
|
||||
|
||||
int EVERYDAY_DISCOUNT_GET_REFRESH_COUNT = 1353;//天天折扣获得刷新次数
|
||||
int EVERYDAY_DISCOUNT_COST_REFRESH_COUNT = 1354;//天天折扣刷新消耗
|
||||
int EVERYDAY_DISCOUNT_GET_MISSION_COUNT = 1355;//天天折扣获得档位次数
|
||||
int EVERYDAY_DISCOUNT_COST_MISSION_COUNT = 1356;//天天折扣消耗档位次数
|
||||
int EVERYDAY_DISCOUNT_CLEAN_MISSION_COUNT = 1357;//天天折扣清零次数
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@ import com.ljsd.jieling.logic.activity.activityLogic.GmSingleActivityLogic;
|
|||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.arena.LuofuLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
|
|
@ -84,6 +83,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
// 罗浮争锋,领取称号奖励
|
||||
LuofuLogic.getInstance().takeTitleReward(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.LOGIN_TIMES,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_UPDATE,MissionType.LOGIN_TIMES,0);
|
||||
long now = TimeUtils.now();
|
||||
playerInfoManager.setLoginTime(now);
|
||||
|
||||
|
|
@ -228,12 +228,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
|
||||
try {
|
||||
Poster.getPoster().dispatchEvent(new HomeEvent(user.getId()));// 家园建筑解锁
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.default_id));// 惊喜礼盒
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),10023,0));// 登峰造极孙悟空
|
||||
finalActivityReset(user);// 常驻活动重置
|
||||
endLessTreasureHandler(user);// 无尽秘宝处理
|
||||
// expeditionTreasureHandler(user);// 天宫秘宝刷新
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.DAILY_TASK_FINISH,0);
|
||||
// user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.DAILY_TASK_FINISH,0);
|
||||
|
||||
if(playerInfoManager.getIsdayFirst()==0){
|
||||
playerInfoManager.setIsdayFirst(1);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
|
@ -14,19 +13,17 @@ import com.ljsd.jieling.util.ItemUtil;
|
|||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SGoodsConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.ActivityProto;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
*/
|
||||
@Component
|
||||
public class BuyGoodsToItemHandler extends BaseHandler<ActivityProto.BuyGoodsToItemRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
|
|
|
|||
|
|
@ -4,12 +4,8 @@ package com.ljsd.jieling.handler.map;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.mission.Mission;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
|
|
@ -293,7 +289,7 @@ public class MapManager extends MongoBase {
|
|||
long addValue = MathUtils.setBetweenWithMax(itemNum+recoveryTimes*recoveryItemInfo[1],0,heroTimes);
|
||||
if(addValue!=0){
|
||||
item.setItemNum(addValue);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent, BIReason.TIME_REWARD,GlobalsDef.subReason,item.getItemId(),addValue,item.getItemNum());
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent, BIReason.TIME_REWARD,GlobalsDef.subReason,item.getItemId(),addValue,item.getItemNum());
|
||||
}
|
||||
int time = lastUpdateEnergyTime + recoveryTimes*recoveryItemInfo[2];
|
||||
item.setEndingTime(time);
|
||||
|
|
@ -314,7 +310,7 @@ public class MapManager extends MongoBase {
|
|||
if (addValue != 0) {
|
||||
int curEnergy = MathUtils.setBetweenWithMax(itemNum + addValue, 0, playerInfoManager.getMaxStamina());
|
||||
item.setItemNum(Math.min(curEnergy, playerInfoManager.getMaxStamina()));
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent, BIReason.TIME_REWARD,GlobalsDef.addReason,item.getItemId(),addValue,item.getItemNum());
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent, BIReason.TIME_REWARD,GlobalsDef.addReason,item.getItemId(),addValue,item.getItemNum());
|
||||
}
|
||||
}
|
||||
setLastUpdateEnergyTime(item, updateTime, lastUpdateEnergyTime);
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import com.ljsd.jieling.logic.activity.*;
|
|||
import com.ljsd.jieling.logic.activity.activityLogic.GmActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.activityLogic.GmSingleActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.ActivityZeroRefreshEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.ZeroRefreshEvent;
|
||||
import com.ljsd.jieling.logic.activity.eventhandler.*;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
|
|
@ -457,7 +457,7 @@ public class GlobalDataManaager implements IManager {
|
|||
int day = TimeUtils.getDayOfPeriod(GameApplication.serverConfig.getCacheOpenTime(),Calendar.DAY_OF_MONTH);//当月第几天
|
||||
boolean refreshStype = TimeUtils.isSameMonth2(GameApplication.serverConfig.getCacheOpenTime(), TimeUtils.now());
|
||||
for(SDailyTasksConfig sDailyTasksConfig:config.values()){
|
||||
if(refreshStype && day >= sDailyTasksConfig.getViewDateUp() && day <=sDailyTasksConfig.getViewDataDown()){
|
||||
if(refreshStype){
|
||||
if(day >= sDailyTasksConfig.getViewDateUp() && day <=sDailyTasksConfig.getViewDataDown()){
|
||||
fBuilder.addUserMissionInfo(CommonProto.UserMissionInfo.newBuilder().setMissionId(sDailyTasksConfig.getId()).setState(0).setType(dailymissionType).setProgress(0));
|
||||
}
|
||||
|
|
@ -487,8 +487,8 @@ public class GlobalDataManaager implements IManager {
|
|||
// 道具刷新
|
||||
BuyGoodsNewLogic.refreshWelfareState(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.LOGIN_TIMES,0);
|
||||
// 惊喜礼盒,超值基金,零点逻辑(可以同用一个状态)
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.zero_init));
|
||||
// 活动零点逻辑
|
||||
Poster.getPoster().dispatchEvent(new ActivityZeroRefreshEvent(user.getId()));
|
||||
//玉虚论道每日刷新
|
||||
user.getArenaManager().setCrossYuxulundaoDailyRewad(new ArrayList<>(Arrays.asList(0,0,0)));
|
||||
//终身卡在线跨天
|
||||
|
|
|
|||
|
|
@ -160,4 +160,5 @@ public interface ActivityType {
|
|||
int GOD_MONEY_TOTLE_RECHARGE = 114;//仙晶累充
|
||||
int FENGSHEN_TREASURE_TWO = 115;//双队封神
|
||||
int FENGSHEN_TREASURE_THREE = 116;//三队封神
|
||||
int EVERY_DAY_DISCOUNT = 126;//天天0.1折扣
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ public enum ActivityTypeEnum {
|
|||
FENGSHEN_TREASURE_THREE(ActivityType.FENGSHEN_TREASURE_THREE, FengshenTreasureActivity::new),//封神奖励
|
||||
GM_DAILY_GIFT(ActivityType.GM_DAILY_GIFT, DefaultEmptyActivity::new),//gm每日礼包
|
||||
GM_WEEK_GIFT(ActivityType.GM_WEEK_GIFT, DefaultEmptyActivity::new),//gm每周礼包
|
||||
EVERY_DAY_DISCOUNT(ActivityType.EVERY_DAY_DISCOUNT, EveryDayDiscountActivity::new),//每日折扣
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,305 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorTableException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
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.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.SEveryDayGift;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 天天0.1折扣-bt版
|
||||
* 2022-9-6
|
||||
*/
|
||||
public class EveryDayDiscountActivity extends AbstractActivity {
|
||||
|
||||
private static final int countProgress = -1;
|
||||
|
||||
EveryDayDiscountActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, ActivityZeroRefreshEvent.class);
|
||||
Poster.getPoster().listenEvent(this, EveryDayDiscountNumUpdateEvent.class);
|
||||
Poster.getPoster().listenEvent(this, EveryDayDiscountUnlockEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
// 活动信息初始化
|
||||
ActivityMission mission = new ActivityMission();
|
||||
ActivityLogic.getInstance().initOtherMission(mission, new ArrayList<>());
|
||||
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||
// 任务刷新
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_TASK_REFRESH, id);
|
||||
LOGGER.info("天天0.1折扣活动-bt版...uid={},activityId={}",user.getId(), id);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断档位是否解锁
|
||||
*/
|
||||
public static boolean ifOpen(User user, int id) {
|
||||
SEveryDayGift dayGift = SEveryDayGift.map.get(id);
|
||||
if (dayGift == null){
|
||||
return false;
|
||||
}
|
||||
for (int[] ints : dayGift.getCondition()) {
|
||||
if (ints[0] == 1) { // 等级
|
||||
if (user.getPlayerInfoManager().getLevel() < ints[1]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清零次数, 并保留默认次数
|
||||
*/
|
||||
public void cleanValue(User user){
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
}
|
||||
Map<Integer, SEveryDayGift> giftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (giftMap == null){
|
||||
return;
|
||||
}
|
||||
for (SEveryDayGift dayGift : giftMap.values()) {
|
||||
int missionId = dayGift.getId();
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
if (progressInfo == null){
|
||||
continue;
|
||||
}
|
||||
int count = 0;
|
||||
int packId = ToolsUtil.getPackId(missionId);
|
||||
ActivityProgressInfo packInfo = mission.getActivityMissionMap().get(packId);
|
||||
if (packInfo != null){
|
||||
count = packInfo.getProgrss();
|
||||
}
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 1, BIReason.EVERYDAY_DISCOUNT_CLEAN_MISSION_COUNT,dayGift.getItemID(), progressInfo.getProgrss(), count));
|
||||
progressInfo.setProgrss(count);
|
||||
mission.getActivityMissionMap().put(missionId, progressInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作随机数组
|
||||
*/
|
||||
public int[][] makeRandomArray(List<SEveryDayGift> list) {
|
||||
int[][] result = new int[2][];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
SEveryDayGift dayGift = list.get(i);
|
||||
result[0][i] = dayGift.getId();
|
||||
result[1][i] = dayGift.getProbability();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user,ActivityMission activityMission, Set<Integer> filter) {
|
||||
if (activityMission == null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 库里存储的活动档位信息
|
||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||
// 策划表的配置
|
||||
Map<Integer, SEveryDayGift> dayGiftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (dayGiftMap == null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 返回对象
|
||||
List<CommonProto.ActivityInfo.MissionInfo> missionInfos = new ArrayList<>(dayGiftMap.size());
|
||||
for (SEveryDayGift dayGift : dayGiftMap.values()) {
|
||||
int missionId = dayGift.getId();
|
||||
ActivityProgressInfo progressInfo = progressInfoMap.getOrDefault(missionId, new ActivityProgressInfo());
|
||||
// 封装proto并返回
|
||||
CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
||||
.setMissionId(missionId)
|
||||
.setProgress(progressInfo.getProgrss())
|
||||
.setState(progressInfo.getState())
|
||||
.build();
|
||||
missionInfos.add(build);
|
||||
}
|
||||
return missionInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取奖励
|
||||
*/
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
// activity check
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
throw new ErrorTableException(182);// 活动不存在
|
||||
}
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
if (progressInfo == null){
|
||||
throw new ErrorTableException(183);// 档位不存在
|
||||
}
|
||||
// -1位置,表示刷新档位抽奖次数
|
||||
if (missionId == countProgress){
|
||||
Map<Integer, SEveryDayGift> dayGiftMap = SEveryDayGift.activitymap.get(id);
|
||||
if (dayGiftMap == null){
|
||||
throw new ErrorTableException(183);// 档位不存在
|
||||
}
|
||||
if (progressInfo.getProgrss() <= 0){
|
||||
throw new ErrorTableException(186);// 没有可刷新次数
|
||||
}
|
||||
ArrayList<SEveryDayGift> list = new ArrayList<>();
|
||||
for (SEveryDayGift dayGift : dayGiftMap.values()) {
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(dayGift.getId());
|
||||
if (info == null || info.getState() != 1){
|
||||
continue;
|
||||
}
|
||||
list.add(dayGift);
|
||||
}
|
||||
int[][] randomArray = makeRandomArray(list);
|
||||
int index = ToolsUtil.getRandomInt(randomArray[1]);
|
||||
int missId = randomArray[0][index];
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(missId);
|
||||
// 道具日志记录
|
||||
int itemID = dayGiftMap.get(missId).getItemID();
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 0, BIReason.EVERYDAY_DISCOUNT_GET_MISSION_COUNT,itemID, progressInfo.getProgrss(), progressInfo.getProgrss() + 1));
|
||||
info.setProgrss(info.getProgrss() + 1);
|
||||
mission.getActivityMissionMap().put(missId, info);
|
||||
// 道具日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user, 1, BIReason.EVERYDAY_DISCOUNT_COST_REFRESH_COUNT,1578, progressInfo.getProgrss(), progressInfo.getProgrss()-1));
|
||||
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);
|
||||
}
|
||||
|
||||
// 状态推送
|
||||
sendActivityProgress(session, null);
|
||||
// 打点上报
|
||||
reportTakeActivityReward(user, new int[][]{}, missionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.FightMainEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SoldierMainEvent;
|
||||
|
|
@ -133,14 +132,15 @@ public class GiveEndlessDrawActivity extends AbstractActivity {
|
|||
// activity check
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"活动信息不存在:"+id);
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
|
||||
}
|
||||
|
||||
SActivityRewardConfig rewardConfig = SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId);
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
int state = getState(user, rewardConfig, progressInfo);
|
||||
if (state != 1){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"领取失败,activityId->missionId->state, "+id+"->"+missionId+"->"+state);
|
||||
LOGGER.info("领取失败,activityId-> {}, missionId-> {} state-> {}", id,missionId,state);
|
||||
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD);
|
||||
}
|
||||
// reward
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, rewardConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ package com.ljsd.jieling.logic.activity;
|
|||
import com.ljsd.jieling.jbean.ActivityManager;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.ActivityStateChangeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import config.SActivityRewardConfig;
|
||||
|
|
@ -25,6 +22,7 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
public NewRechargeSumDayActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
||||
Poster.getPoster().listenEvent(this, ActivityZeroRefreshEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -39,18 +37,22 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
if (!(event instanceof SuperBoxEvent)) {
|
||||
return;
|
||||
}
|
||||
SuperBoxEvent superBox = (SuperBoxEvent) event;
|
||||
User user = UserManager.getUser(superBox.getUserId());
|
||||
int goodId = superBox.getGiftId();
|
||||
// 不同状态礼包信息
|
||||
if (goodId == SuperBoxEvent.zero_init){
|
||||
zeroUpdate(user);
|
||||
}else {
|
||||
User user = null;
|
||||
if (event instanceof SuperBoxEvent) {
|
||||
SuperBoxEvent superBox = (SuperBoxEvent) event;
|
||||
user = UserManager.getUser(superBox.getUserId());
|
||||
int goodId = superBox.getGiftId();
|
||||
// 不同状态礼包信息
|
||||
goodUpdate(user, goodId);
|
||||
}
|
||||
if (event instanceof ActivityZeroRefreshEvent){
|
||||
ActivityZeroRefreshEvent superBox = (ActivityZeroRefreshEvent) event;
|
||||
user = UserManager.getUser(superBox.getUserId());
|
||||
zeroUpdate(user);
|
||||
}
|
||||
if (user == null){
|
||||
return;
|
||||
}
|
||||
// 状态推送
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("superbox-超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class RechargeRewardActivity extends AbstractActivity {
|
|||
List<SActivityRewardConfig> rewardConfigList = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).stream()
|
||||
.filter(n->n.getValues()[0][0]== rewardEvent.getRechargeCount())
|
||||
.collect(Collectors.toList());
|
||||
if(rewardConfigList.size() == 0){
|
||||
if(rewardConfigList.isEmpty()){
|
||||
return ;
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.ActivityZeroRefreshEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
|
|
@ -33,6 +34,7 @@ public class SuperFundNewActivity extends AbstractActivity {
|
|||
SuperFundNewActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
||||
Poster.getPoster().listenEvent(this, ActivityZeroRefreshEvent.class);
|
||||
}
|
||||
|
||||
private static final int finish = 2;
|
||||
|
|
@ -54,18 +56,25 @@ public class SuperFundNewActivity extends AbstractActivity {
|
|||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
long now = TimeUtils.now();
|
||||
User user = null;
|
||||
// 类型验证
|
||||
if (!(event instanceof SuperBoxEvent)) {
|
||||
if (event instanceof SuperBoxEvent) {
|
||||
// 获取信息
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
user = UserManager.getUser(event1.getUserId());
|
||||
// 活动数据处理
|
||||
updateValue(user,event1.getGiftId());
|
||||
}
|
||||
if (event instanceof ActivityZeroRefreshEvent) {
|
||||
// 获取信息
|
||||
ActivityZeroRefreshEvent event1 = (ActivityZeroRefreshEvent) event;
|
||||
user = UserManager.getUser(event1.getUserId());
|
||||
// 零点刷新
|
||||
zeroRefresh(user);
|
||||
}
|
||||
if (user == null){
|
||||
return;
|
||||
}
|
||||
// 获取信息
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
// LOGGER.info("超值基金接收到监听器...uid={} activityId={}",user.getId(), id);
|
||||
// 活动数据处理
|
||||
updateValue(user,event1.getGiftId());
|
||||
// 零点刷新
|
||||
zeroRefresh(user,event1.getGiftId());
|
||||
// 状态推送
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("superbox-超值基金活动:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
|
|
@ -74,10 +83,7 @@ public class SuperFundNewActivity extends AbstractActivity {
|
|||
/**
|
||||
* 零点刷新
|
||||
*/
|
||||
private void zeroRefresh(User user, int typeId) throws Exception {
|
||||
if (typeId != SuperBoxEvent.zero_init){
|
||||
return;
|
||||
}
|
||||
private void zeroRefresh(User user) throws Exception {
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
* @Description: 活动零点刷新事件
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ActivityZeroRefreshEvent implements IEvent {
|
||||
|
||||
private int userId;
|
||||
|
||||
public ActivityZeroRefreshEvent() {
|
||||
}
|
||||
|
||||
public ActivityZeroRefreshEvent(int uid) {
|
||||
userId = uid;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
* @Description: 每日折扣次数更新活动
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EveryDayDiscountNumUpdateEvent implements IEvent {
|
||||
|
||||
private int userId;
|
||||
private int num;
|
||||
|
||||
public EveryDayDiscountNumUpdateEvent() {
|
||||
}
|
||||
|
||||
public EveryDayDiscountNumUpdateEvent(int userId, int num) {
|
||||
this.userId = userId;
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
* @Description: 每日折扣位置解锁
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EveryDayDiscountUnlockEvent implements IEvent {
|
||||
|
||||
private int userId;
|
||||
|
||||
public EveryDayDiscountUnlockEvent() {
|
||||
}
|
||||
|
||||
public EveryDayDiscountUnlockEvent(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,20 +8,11 @@ package com.ljsd.jieling.logic.activity.event;
|
|||
*/
|
||||
public class SuperBoxEvent implements IEvent {
|
||||
|
||||
/**
|
||||
* 默认状态
|
||||
*/
|
||||
public static int default_id = -1;
|
||||
/**
|
||||
* 零点刷新初始化
|
||||
*/
|
||||
public static int zero_init = -2;
|
||||
|
||||
private int userId;
|
||||
/**
|
||||
* 礼包id
|
||||
*/
|
||||
private int giftId = default_id;
|
||||
private int giftId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
|
|
@ -35,12 +26,6 @@ public class SuperBoxEvent implements IEvent {
|
|||
public SuperBoxEvent() {
|
||||
}
|
||||
|
||||
public SuperBoxEvent(int userId, int giftId) {
|
||||
this.userId = userId;
|
||||
this.giftId = giftId;
|
||||
this.num = 1;
|
||||
}
|
||||
|
||||
public SuperBoxEvent(int userId, int giftId, int num, int type) {
|
||||
this.userId = userId;
|
||||
this.giftId = giftId;
|
||||
|
|
|
|||
|
|
@ -865,6 +865,7 @@ public class ArenaLogic {
|
|||
refreshArenaOpponentList(user);
|
||||
// 任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ARENA_CHALLENGE, fightResult, myScore);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_UPDATE, MissionType.ARENA_CHALLENEGE_NUMS, myScore);
|
||||
// 校验并消耗
|
||||
checkChallenge(user, true);
|
||||
// 返回包装
|
||||
|
|
|
|||
|
|
@ -261,40 +261,14 @@ public class CumulationData {
|
|||
* 击退兽潮来袭num次
|
||||
*/
|
||||
public int exploreRepelMonster_num;
|
||||
/**
|
||||
* 击败心魔镜像num次
|
||||
*/
|
||||
public int exploreRepelXinmo_num;
|
||||
|
||||
/**
|
||||
* 拾取云梦礼num次
|
||||
*/
|
||||
public int explorePickYm_num;
|
||||
|
||||
/**
|
||||
* 探索杀敌排行历史最高名次达到num
|
||||
*/
|
||||
public int exploreKillerHistoryHigh_num;
|
||||
|
||||
/**
|
||||
* 洞府建筑升级次数
|
||||
*/
|
||||
private int homeArchitectureUpNum;
|
||||
|
||||
/**
|
||||
* 探索次数
|
||||
*/
|
||||
private int exploreNum;
|
||||
|
||||
/**
|
||||
* 罗浮争锋次数
|
||||
*/
|
||||
private int luofuFightNum;
|
||||
|
||||
/**
|
||||
* 玉虚论道段位
|
||||
*/
|
||||
private int yuxuLv;
|
||||
public int exploreRepelXinmo_num;//击败心魔镜像num次
|
||||
public int explorePickYm_num;//拾取云梦礼num次
|
||||
public int exploreKillerHistoryHigh_num;//探索杀敌排行历史最高名次达到num
|
||||
private int homeArchitectureUpNum;//洞府建筑升级次数
|
||||
private int exploreNum;//探索次数
|
||||
private int luofuFightNum;//罗浮争锋次数
|
||||
private int yuxuLv;//玉虚论道段位
|
||||
private int accumulativeRechargeNum;// 累计充值金额
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
|
|
@ -768,4 +742,16 @@ public class CumulationData {
|
|||
public void setEspecialEquipStar(Map<Integer, Integer> especialEquipStar) {
|
||||
this.especialEquipStar = especialEquipStar;
|
||||
}
|
||||
|
||||
public int getAccumulativeRechargeNum() {
|
||||
return accumulativeRechargeNum;
|
||||
}
|
||||
|
||||
public void setAccumulativeRechargeNum(int accumulativeRechargeNum) {
|
||||
this.accumulativeRechargeNum = accumulativeRechargeNum;
|
||||
}
|
||||
|
||||
public void addAccumulativeRechargeNum(int num) {
|
||||
this.accumulativeRechargeNum += num;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
|
|||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.EveryDayDiscountUnlockEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
|
|
@ -185,6 +186,7 @@ public class UserManager {
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.VIP_LEVLUP, MissionType.VIP_LEVEL,0);
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LOGIN_TIMES.getType(),1));
|
||||
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
||||
Poster.getPoster().dispatchEvent(new EveryDayDiscountUnlockEvent(user.getId()));
|
||||
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Map<String, Hero> heroMap = heroManager.getHeroMap();
|
||||
|
|
|
|||
|
|
@ -42,31 +42,27 @@ public class UserMissionManager extends MongoBase {
|
|||
|
||||
//******************************************* 任务信息初始化 ******************************************* //
|
||||
|
||||
|
||||
// private EndlessMissionType endlessMissionType = new EndlessMissionType();//无尽副本
|
||||
private MistyTripMissionType mistyTripMissionType = new MistyTripMissionType();//缥缈之旅
|
||||
private DailyMissionIdsType dailyMissionIdsType = new DailyMissionIdsType();// 每日任务
|
||||
private CumulationData dailyCumulationData = new CumulationData();// 每日任务数据
|
||||
private MissingRoomMissionType missingRoomMissionType = new MissingRoomMissionType();// 迷宫寻宝
|
||||
private DonghaiXunxianMissionType donghaiXunxianMission = new DonghaiXunxianMissionType();//东海寻仙
|
||||
private CumulationData donghaiXunxianData = new CumulationData();//东海寻仙数据
|
||||
|
||||
private VipMissionIdsType vipMissionIdsType = new VipMissionIdsType();
|
||||
private BeginerTaskIdsType beginerTaskIdsType=new BeginerTaskIdsType();
|
||||
private TreasureMissionType treasureMissionIdsType=new TreasureMissionType();
|
||||
private ServenMissionIdsType sevenHappyMissionType =new ServenMissionIdsType();
|
||||
private BloodyMissionIdsType bloodyMissionIdsType =new BloodyMissionIdsType();
|
||||
|
||||
private AchieveMissionIdsType achievementMissionTypMap = new AchieveMissionIdsType();
|
||||
private JadeDynastyMissionType jadeDynastyMissionType = new JadeDynastyMissionType();//破阵诛仙任务
|
||||
private CowFlySkyMissionType cowFlySkyMissionType = new CowFlySkyMissionType();// 牛气冲天活动任务
|
||||
// private EndlessMissionType endlessMissionType = new EndlessMissionType();//无尽副本
|
||||
private MistyTripMissionType mistyTripMissionType = new MistyTripMissionType();//缥缈之旅
|
||||
private HomeMissionType homeMissionType = new HomeMissionType();//家园任务
|
||||
|
||||
private ExploreMissionType exploreMissionType = new ExploreMissionType();//探索
|
||||
private EveryDayDiscountType everyDayDiscountType = new EveryDayDiscountType();//天天0.1任务
|
||||
|
||||
//数据累加项
|
||||
private CumulationData cumulationData = new CumulationData();
|
||||
|
||||
private CumulationData dailyCumulationData = new CumulationData();// 每日任务数据
|
||||
private CumulationData donghaiXunxianData = new CumulationData();//东海寻仙数据
|
||||
private CumulationData beginCumulationData = new CumulationData();
|
||||
private CumulationData treasureCumulationData = new CumulationData();
|
||||
private CumulationData treasureWeekCumulationData = new CumulationData();
|
||||
|
|
@ -77,14 +73,10 @@ public class UserMissionManager extends MongoBase {
|
|||
private CumulationData jadeDynastyWeekCumulationData = new CumulationData();//破阵诛仙周数据
|
||||
private CumulationData mistyTripCumulationData = new CumulationData();//缥缈之旅数据
|
||||
private CumulationData cowFlyCumulationData = new CumulationData();//牛气冲天数据
|
||||
private CumulationData everyDayDiscountCumulationData = new CumulationData();//天天0.1任务数据
|
||||
|
||||
/**
|
||||
* 奖励处理任务
|
||||
* @param user
|
||||
* @param gameEvent
|
||||
* @param missionTypeEnumListMap
|
||||
* @param parm
|
||||
* @throws Exception
|
||||
*/
|
||||
public void rewardMission(User user,GameEvent gameEvent,Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap,Object...parm) throws Exception {
|
||||
switch (gameEvent){
|
||||
|
|
@ -173,11 +165,6 @@ public class UserMissionManager extends MongoBase {
|
|||
|
||||
/**
|
||||
* TODO: 2023/7/20 记录任务进度 这个方法需要修改
|
||||
* @param user
|
||||
* @param missionType
|
||||
* @param missionTypeEnumListMap
|
||||
* @param parm
|
||||
* @throws Exception
|
||||
*/
|
||||
public void calCumulationDataResult(User user, MissionType missionType, Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, Object...parm) throws Exception {
|
||||
|
||||
|
|
@ -571,6 +558,24 @@ public class UserMissionManager extends MongoBase {
|
|||
updateString("donghaiXunxianData",donghaiXunxianData);
|
||||
}
|
||||
|
||||
public EveryDayDiscountType getEveryDayDiscountType() {
|
||||
return everyDayDiscountType;
|
||||
}
|
||||
|
||||
public void setEveryDayDiscountType(EveryDayDiscountType everyDayDiscountType) {
|
||||
this.everyDayDiscountType = everyDayDiscountType;
|
||||
updateString("everyDayDiscountType",everyDayDiscountType);
|
||||
}
|
||||
|
||||
public CumulationData getEveryDayDiscountCumulationData() {
|
||||
return everyDayDiscountCumulationData;
|
||||
}
|
||||
|
||||
public void setEveryDayDiscountCumulationData(CumulationData everyDayDiscountCumulationData) {
|
||||
this.everyDayDiscountCumulationData = everyDayDiscountCumulationData;
|
||||
updateString("everyDayDiscountCumulationData",everyDayDiscountCumulationData);
|
||||
}
|
||||
|
||||
public DonghaiXunxianMissionType getDonghaiXunxianMission() {
|
||||
return donghaiXunxianMission;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,7 @@ public enum GameEvent {
|
|||
EXPLORE,//探索
|
||||
EXPLORE_REWARD,//探索奖励
|
||||
|
||||
EVERY_DAY_TASK_REFRESH,//每日任务初始化
|
||||
EVERY_DAY_UPDATE,//每日任务更新
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ public enum GameMisionType {
|
|||
MISTY_TRIP_MISSION(13),//缥缈之旅
|
||||
HOME_MISSION(14),//家园任务
|
||||
DONGHAIXUNXIAN_MISSION(15),//东海寻仙
|
||||
|
||||
EXPLORE(16),//探索
|
||||
EVERY_DAY_DISCOUNT(17),//天天0.1折扣
|
||||
;
|
||||
private final int type;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,11 +58,12 @@ public class MissionLoigc {
|
|||
getAchieveMission(user,missionList);
|
||||
getJadeDynastyMission(user, missionList);
|
||||
getCowFlySkyMission(user,missionList);
|
||||
getEndlessMission(user,missionList);
|
||||
// getEndlessMission(user,missionList);
|
||||
getMistyTripMission(user,missionList);
|
||||
getHomeMission(user,missionList);
|
||||
getDonghaiXunxianMission(user,missionList);
|
||||
getExploreMission(user,missionList);
|
||||
getEveryDayDiscountMission(user, missionList);
|
||||
// 此方法必须放在最后,对所有获取到的任务进行处理
|
||||
// checkMissionTime(missionList);
|
||||
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
|
||||
|
|
@ -99,8 +100,6 @@ public class MissionLoigc {
|
|||
|
||||
/**
|
||||
* 获取东海寻仙任务信息
|
||||
* @param user
|
||||
* @param missionList
|
||||
*/
|
||||
public static void getDonghaiXunxianMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
DonghaiXunxianMissionType missionType = user.getUserMissionManager().getDonghaiXunxianMission();
|
||||
|
|
@ -447,8 +446,6 @@ public class MissionLoigc {
|
|||
|
||||
/**
|
||||
* 获取家园任务信息
|
||||
* @param user
|
||||
* @param missionList
|
||||
*/
|
||||
public static void getHomeMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
HomeMissionType missionType = user.getUserMissionManager().getHomeMissionType();
|
||||
|
|
@ -483,10 +480,51 @@ public class MissionLoigc {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取天天0.1折扣任务信息
|
||||
*/
|
||||
public static void getEveryDayDiscountMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
EveryDayDiscountType missionType = user.getUserMissionManager().getEveryDayDiscountType();
|
||||
// 进行中
|
||||
Set<Integer> doingMissionIds = missionType.getDoingMissionIds();
|
||||
// 可领取
|
||||
Set<Integer> finishMissionIds = missionType.getFinishMissionIds();
|
||||
// 已领取
|
||||
BitSet rewardedMissionIds = missionType.getRewardedMissionIds();
|
||||
|
||||
CumulationData cumulationData = user.getUserMissionManager().getEveryDayDiscountCumulationData();
|
||||
Collection<SEveryDayGiftTask> values = SEveryDayGiftTask.map.values();
|
||||
for (SEveryDayGiftTask task : values) {
|
||||
int id = task.getId();
|
||||
int[] value = task.getTaskValue()[1];
|
||||
CommonProto.UserMissionInfo.Builder info = null;
|
||||
if (doingMissionIds.contains(id)){
|
||||
info = CommonProto.UserMissionInfo.newBuilder();
|
||||
info.setState(MissionState.DOING.getState());
|
||||
int doingProgress = getDoingProgress(user, cumulationData, task.getTaskType(), value);
|
||||
info.setProgress(doingProgress);
|
||||
}
|
||||
if (finishMissionIds.contains(id)){
|
||||
info = CommonProto.UserMissionInfo.newBuilder();
|
||||
info.setState(MissionState.FINISH.getState());
|
||||
info.setProgress(value[0]);
|
||||
}
|
||||
if (rewardedMissionIds.get(id)){
|
||||
info = CommonProto.UserMissionInfo.newBuilder();
|
||||
info.setState(MissionState.REWARD.getState());
|
||||
info.setProgress(value[0]);
|
||||
}
|
||||
if (info == null){
|
||||
continue;
|
||||
}
|
||||
info.setMissionId(id);
|
||||
info.setType(GameMisionType.EVERY_DAY_DISCOUNT.getType());
|
||||
missionList.add(info.build());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取牛气冲天活动任务信息
|
||||
* @param user
|
||||
* @param missionList
|
||||
*/
|
||||
public static void getCowFlySkyMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
CowFlySkyMissionType missionType = user.getUserMissionManager().getCowFlySkyMissionType();
|
||||
|
|
@ -521,7 +559,7 @@ public class MissionLoigc {
|
|||
}
|
||||
}
|
||||
|
||||
public static void getEndlessMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
// public static void getEndlessMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
// EndlessMissionType missionType = user.getUserMissionManager().getEndlessMissionType();
|
||||
//
|
||||
// // 进行中
|
||||
|
|
@ -568,7 +606,7 @@ public class MissionLoigc {
|
|||
// missionList.add(info.build());
|
||||
// }
|
||||
// });
|
||||
}
|
||||
// }
|
||||
|
||||
public static void getMistyTripMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
|
|
@ -602,7 +640,7 @@ public class MissionLoigc {
|
|||
Set<Integer> finishMissionIds = dailyMissionIdsType.getFinishMissionIds();
|
||||
Map<Integer, SExploreTask> config = STableManager.getConfig(SExploreTask.class);
|
||||
int type = GameMisionType.EXPLORE.getType();
|
||||
if (doingMissionIds.size() == 0 && finishMissionIds.size() == 0) {
|
||||
if (doingMissionIds.isEmpty() && finishMissionIds.isEmpty()) {
|
||||
Set<Integer> arro = STableManager.getConfig(SExploreTask.class).keySet();
|
||||
doingMissionIds.clear();
|
||||
finishMissionIds.clear();
|
||||
|
|
@ -624,8 +662,6 @@ public class MissionLoigc {
|
|||
}
|
||||
/**
|
||||
* 获取天宫寻宝任务列表
|
||||
* @param user
|
||||
* @param missionList
|
||||
*/
|
||||
public static void getMissingRoomMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
|
|
@ -695,26 +731,13 @@ public class MissionLoigc {
|
|||
|
||||
/**
|
||||
* 领取任务奖励
|
||||
* @param session
|
||||
* @param type
|
||||
* @param missionId
|
||||
* @throws Exception
|
||||
* 基本对应到 com.ljsd.jieling.logic.dao.UserMissionManager#rewardMission(com.ljsd.jieling.logic.dao.root.User, com.ljsd.jieling.logic.mission.GameEvent, java.util.Map, java.lang.Object...)
|
||||
*/
|
||||
public static void takeMissionReward(ISession session,int type,int missionId) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
List<MissionStateChangeInfo> missionStateChangeInfos = null;
|
||||
// 家园任务
|
||||
if (type == GameMisionType.HOME_MISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMissionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.HOME_TASK_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMissionTypeListMap.get(GameMisionType.HOME_MISSION);
|
||||
}
|
||||
// 东海寻仙
|
||||
if (type == GameMisionType.DONGHAIXUNXIAN_MISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMissionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.DONGHAIXUNXIAN_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMissionTypeListMap.get(GameMisionType.DONGHAIXUNXIAN_MISSION);
|
||||
}
|
||||
//BLOODY 任务
|
||||
if(type == GameMisionType.BLOODYMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.BLOODY_MISSION_REWARD, missionId);
|
||||
|
|
@ -729,25 +752,6 @@ public class MissionLoigc {
|
|||
ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),missionId,GameMisionType.BLOODYMISSION.toString());
|
||||
return;
|
||||
}
|
||||
//vip 任务
|
||||
if(type == GameMisionType.VIPMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.VIP_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.VIPMISSION);
|
||||
}
|
||||
//日常 任务
|
||||
if(type == GameMisionType.DAILYMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.DAILY_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.DAILYMISSION);
|
||||
SDailyTasksConfig sDailyTasksConfig = SDailyTasksConfig.getSDailyTasksConfigById(missionId);
|
||||
if(sDailyTasksConfig.getType() == MissionType.FINSIH_DAYILY_TIMES.getMissionTypeValue() && missionStateChangeInfos !=null && !missionStateChangeInfos.isEmpty()){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.TAKE_DAILY_BOX_TIMES);
|
||||
}
|
||||
}
|
||||
//新手 任务
|
||||
if(type == GameMisionType.BEGINNERMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.BEGINNER_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.BEGINNERMISSION);
|
||||
}
|
||||
//副本 任务
|
||||
if(type == GameMisionType.COPYMISSION.getType()){
|
||||
Set<Integer> takeCopyMisionRewards = user.getMapManager().getTakeCopyMisionRewards();
|
||||
|
|
@ -774,31 +778,45 @@ public class MissionLoigc {
|
|||
|
||||
// 藏宝任务
|
||||
if(type == GameMisionType.TREASUREMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.TREASURE_MISSION_REWARD, missionId);
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.TREASURE_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.TREASUREMISSION);
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserTaskEvent,type,missionId);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
ItemUtil.treasureLevelUp(user);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).setTreasureScore(user.getPlayerInfoManager().getTreasureLevel()).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 破阵诛仙任务/主题活动任务
|
||||
if(type == GameMisionType.JADE_DYNASTY_MISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.JADE_DYNASTY_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.JADE_DYNASTY_MISSION);
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserTaskEvent,type,missionId);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
return;
|
||||
}
|
||||
|
||||
// 家园任务
|
||||
if (type == GameMisionType.HOME_MISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMissionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.HOME_TASK_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMissionTypeListMap.get(GameMisionType.HOME_MISSION);
|
||||
}
|
||||
// 东海寻仙
|
||||
if (type == GameMisionType.DONGHAIXUNXIAN_MISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMissionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.DONGHAIXUNXIAN_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMissionTypeListMap.get(GameMisionType.DONGHAIXUNXIAN_MISSION);
|
||||
}
|
||||
//vip 任务
|
||||
if(type == GameMisionType.VIPMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.VIP_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.VIPMISSION);
|
||||
}
|
||||
//日常 任务
|
||||
if(type == GameMisionType.DAILYMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.DAILY_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.DAILYMISSION);
|
||||
SDailyTasksConfig sDailyTasksConfig = SDailyTasksConfig.getSDailyTasksConfigById(missionId);
|
||||
if(sDailyTasksConfig.getType() == MissionType.FINSIH_DAYILY_TIMES.getMissionTypeValue() && missionStateChangeInfos !=null && !missionStateChangeInfos.isEmpty()){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.TAKE_DAILY_BOX_TIMES);
|
||||
}
|
||||
}
|
||||
//新手 任务
|
||||
if(type == GameMisionType.BEGINNERMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.BEGINNER_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.BEGINNERMISSION);
|
||||
}
|
||||
|
||||
// 牛气冲天 活动任务
|
||||
if (type == GameMisionType.COWFLYSKYMISSION.getType()){
|
||||
|
|
@ -814,7 +832,7 @@ public class MissionLoigc {
|
|||
|
||||
// 天宫寻宝 任务
|
||||
if(type==GameMisionType.MISSINGROOMMISSION.getType()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.MISSING_ROOM_MISSION_REWARD, missionId);
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.MISSING_ROOM_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.MISSINGROOMMISSION);
|
||||
}
|
||||
|
||||
|
|
@ -833,73 +851,69 @@ public class MissionLoigc {
|
|||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.EXPLORE);
|
||||
}
|
||||
|
||||
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(missionId),type);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("mission can not get reward"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键领取任务奖励
|
||||
* @param session
|
||||
* @param type
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void takeMissionRewardOnekey(ISession session,int type) throws Exception{
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
List<MissionStateChangeInfo> missionStateChangeInfos = new ArrayList<MissionStateChangeInfo>();
|
||||
//日常 任务
|
||||
//List<int[][]>rewardList = new ArrayList<int[][]>();
|
||||
Map <Integer,Integer> rewardMap =new HashMap<Integer,Integer>();
|
||||
if(type == GameMisionType.DAILYMISSION.getType()){
|
||||
for(int missionId:SDailyTasksConfig.config.keySet()){
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap =
|
||||
userMissionManager.onGameEvent(user, GameEvent.DAILY_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos.addAll(gameMisionTypeListMap.get(GameMisionType.DAILYMISSION));
|
||||
SDailyTasksConfig sDailyTasksConfig = SDailyTasksConfig.getSDailyTasksConfigById(missionId);
|
||||
if(sDailyTasksConfig.getType() == MissionType.FINSIH_DAYILY_TIMES.getMissionTypeValue() && !missionStateChangeInfos.isEmpty()){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.TAKE_DAILY_BOX_TIMES);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(!missionStateChangeInfos.isEmpty()){
|
||||
//奖励汇总
|
||||
PlayerInfoProto.TakeMissionRewardResponse.Builder res= PlayerInfoProto.TakeMissionRewardResponse.newBuilder();
|
||||
for(MissionStateChangeInfo info:missionStateChangeInfos){
|
||||
if(info.getRewwardGroups()!=null){
|
||||
for(int[] reward:info.getRewwardGroups()){
|
||||
if(rewardMap.containsKey(reward[0])){
|
||||
rewardMap.put(reward[0],rewardMap.get(reward[0])+reward[1]);
|
||||
}else{
|
||||
rewardMap.put(reward[0],reward[1]);
|
||||
}
|
||||
res.addRewardId(info.getMissionId());
|
||||
}
|
||||
}
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(info.getMissionId()),type);
|
||||
}
|
||||
int[][] itemArr = rewardMap.entrySet().stream().map(n->new int[] {n.getKey(),n.getValue()}).toArray(int[][]::new);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, itemArr, BIReason.TAKE_MISSION_REWARD);
|
||||
res.setDrop(drop);
|
||||
//ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(missionId),type);
|
||||
//PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,res.build(),true);
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("mission can not get reward"));
|
||||
}
|
||||
|
||||
}
|
||||
// public static void takeMissionRewardOnekey(ISession session,int type) throws Exception{
|
||||
// int uid = session.getUid();
|
||||
// User user = UserManager.getUser(uid);
|
||||
// UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
// List<MissionStateChangeInfo> missionStateChangeInfos = new ArrayList<MissionStateChangeInfo>();
|
||||
// //日常 任务
|
||||
// //List<int[][]>rewardList = new ArrayList<int[][]>();
|
||||
// Map <Integer,Integer> rewardMap =new HashMap<Integer,Integer>();
|
||||
// if(type == GameMisionType.DAILYMISSION.getType()){
|
||||
// for(int missionId:SDailyTasksConfig.config.keySet()){
|
||||
// Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap =
|
||||
// userMissionManager.onGameEvent(user, GameEvent.DAILY_MISSION_REWARD, missionId);
|
||||
// missionStateChangeInfos.addAll(gameMisionTypeListMap.get(GameMisionType.DAILYMISSION));
|
||||
// SDailyTasksConfig sDailyTasksConfig = SDailyTasksConfig.getSDailyTasksConfigById(missionId);
|
||||
// if(sDailyTasksConfig.getType() == MissionType.FINSIH_DAYILY_TIMES.getMissionTypeValue() && !missionStateChangeInfos.isEmpty()){
|
||||
// user.getUserMissionManager().onGameEvent(user,GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.TAKE_DAILY_BOX_TIMES);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// if(!missionStateChangeInfos.isEmpty()){
|
||||
// //奖励汇总
|
||||
// PlayerInfoProto.TakeMissionRewardResponse.Builder res= PlayerInfoProto.TakeMissionRewardResponse.newBuilder();
|
||||
// for(MissionStateChangeInfo info:missionStateChangeInfos){
|
||||
// if(info.getRewwardGroups()!=null){
|
||||
// for(int[] reward:info.getRewwardGroups()){
|
||||
// if(rewardMap.containsKey(reward[0])){
|
||||
// rewardMap.put(reward[0],rewardMap.get(reward[0])+reward[1]);
|
||||
// }else{
|
||||
// rewardMap.put(reward[0],reward[1]);
|
||||
// }
|
||||
// res.addRewardId(info.getMissionId());
|
||||
// }
|
||||
// }
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(info.getMissionId()),type);
|
||||
// }
|
||||
// int[][] itemArr = rewardMap.entrySet().stream().map(n->new int[] {n.getKey(),n.getValue()}).toArray(int[][]::new);
|
||||
// CommonProto.Drop.Builder drop = ItemUtil.drop(user, itemArr, BIReason.TAKE_MISSION_REWARD);
|
||||
// res.setDrop(drop);
|
||||
// //ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(missionId),type);
|
||||
// //PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
// MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,res.build(),true);
|
||||
// }else{
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("mission can not get reward"));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 根据不同的任务类型(missiontype)获取任务的完成数量
|
||||
*
|
||||
* 已经有了映射关系 不应再ifelse 现100及1以后的类型 进度完成状态及进度迁移到类型处理器中
|
||||
*/
|
||||
public static int getDoingProgress(User user,CumulationData cumulationData, int missionTypeId, int[] missionSubType){
|
||||
|
|
@ -940,12 +954,6 @@ public class MissionLoigc {
|
|||
case POKEMON_ALL_FORCE:
|
||||
count = HeroLogic.getInstance().calAllPokenmonForce(user);
|
||||
break;
|
||||
case ARENA_CHALLENEGE_NUMS:
|
||||
count = cumulationData.getArenaFightNums();
|
||||
break;
|
||||
case ARENA_SCORE:
|
||||
count = (int) cumulationData.getArenaScore();
|
||||
break;
|
||||
case USER_LEVEL:
|
||||
count = user.getPlayerInfoManager().getLevel();
|
||||
break;
|
||||
|
|
@ -1271,11 +1279,6 @@ public class MissionLoigc {
|
|||
|
||||
/**
|
||||
* 天宫探险加锁
|
||||
* @param session
|
||||
* @param missionId
|
||||
* @param operation
|
||||
* @param messageType
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void missiongRoomLock(ISession session,int missionId,int operation, MessageTypeProto.MessageType messageType) throws Exception{
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ public enum MissionType {
|
|||
XIAOYAOYOU_CONSUME_NUM(164),//逍遥游消耗云游值num点
|
||||
FABAO_DRAW_NUM(165),//法宝抽卡次数
|
||||
SOLDIER_LAYER(166),//小兵层数
|
||||
RECHARGE_ACCUMULATIVE_NUM(167),//累计充值金额
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ArenaChallengeManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
int fightResult = (int) parm[0];
|
||||
if(missionType == MissionType.ARENA_SCORE){
|
||||
long myscore = (long)parm[1];
|
||||
if(myscore > data.getArenaScore()){
|
||||
data.setArenaScore(myscore);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
if(fightResult==-999){
|
||||
return result;
|
||||
}
|
||||
if(missionType == MissionType.ARENA_FIGHTSUCCES_TIMES){
|
||||
if(fightResult==1){
|
||||
data.arenaFightsuccesTimes++;
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}else if(missionType == MissionType.ARENA_CHALLENEGE_NUMS){
|
||||
data.setArenaFightNums(data.getArenaFightNums()+1);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
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 ArenaChallengeNumManager extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
data.setArenaFightNums(data.getArenaFightNums()+1);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getArenaFightNums();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.getArenaFightNums() >= value[1][0];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
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 ArenaFightSuccessNumManager extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int fightResult = (int) parm[0];
|
||||
if (fightResult != 1){
|
||||
return null;
|
||||
}
|
||||
data.arenaFightsuccesTimes++;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.arenaFightsuccesTimes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.arenaFightsuccesTimes >= value[1][0];
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
public class ArenaScoreManager extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
long myscore = (long) parm[1];
|
||||
if(myscore > data.getArenaScore()){
|
||||
data.setArenaScore(myscore);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return (int) data.getArenaScore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.getArenaScore() >= value[1][0];
|
||||
}
|
||||
}
|
||||
|
|
@ -27,8 +27,8 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.POKEMON_FORCE ,new DefaultDataManager());
|
||||
judges.put(MissionType.POKEMON_ALL_FORCE ,new DefaultDataManager());
|
||||
|
||||
judges.put(MissionType.ARENA_CHALLENEGE_NUMS,new ArenaChallengeManager());
|
||||
judges.put(MissionType.ARENA_SCORE,new ArenaChallengeManager());
|
||||
judges.put(MissionType.ARENA_CHALLENEGE_NUMS,new ArenaChallengeNumManager());
|
||||
judges.put(MissionType.ARENA_SCORE,new ArenaScoreManager());
|
||||
|
||||
judges.put(MissionType.ARENA_RANK,new ArenaRankManager());
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.GENERAL_STORY_TIMES,new FightPlayDataManager());
|
||||
|
||||
judges.put(MissionType.HERO_LEVLE_TIMES,new HeroLevelUpManager());
|
||||
judges.put(MissionType.ARENA_FIGHTSUCCES_TIMES,new ArenaChallengeManager());
|
||||
judges.put(MissionType.ARENA_FIGHTSUCCES_TIMES,new ArenaFightSuccessNumManager());
|
||||
|
||||
judges.put(MissionType.FINSIH_DAYILY_TIMES,new FinishDailyManager());
|
||||
judges.put(MissionType.TAKE_ADVENTUREREWARD_TIMES,new TakeAdventureTimesManager());
|
||||
|
|
@ -210,6 +210,8 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.EXPLORE_REPELXINMO_NUM,new ExploreRepelXinmoManager());
|
||||
judges.put(MissionType.EXPLORE_PICKYM_NUM,new ExplorePickYmManager());
|
||||
judges.put(MissionType.EXPLORE_ENEMYHISTORYHIGH_NUM,new ExploreEnemyHistoryHighManager());
|
||||
|
||||
judges.put(MissionType.RECHARGE_ACCUMULATIVE_NUM,new RechargeAccumulativeNumManager());//每日累充
|
||||
}
|
||||
|
||||
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class EndlessOpenPercentManager extends AbstractDataManager {
|
|||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
data.mapOpenPercent = (int)parm[1];
|
||||
return new CumulationData.Result(missionType);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* 每日累充
|
||||
*/
|
||||
public class RechargeAccumulativeNumManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
return data.getAccumulativeRechargeNum() >= cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.getAccumulativeRechargeNum();
|
||||
}
|
||||
|
||||
@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.addAccumulativeRechargeNum(count);
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ljsd.jieling.logic.mission.event;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.UserMissionManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.GameMisionType;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.mission.main.EveryDayDiscountType;
|
||||
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务
|
||||
* 天天0.1折的消耗类
|
||||
*/
|
||||
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);
|
||||
}
|
||||
userMissionManager.setEveryDayDiscountType(everyDayDiscountType);
|
||||
userMissionManager.setEveryDayDiscountCumulationData(cumulationData);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.ljsd.jieling.logic.mission.event;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.UserMissionManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.GameMisionType;
|
||||
import com.ljsd.jieling.logic.mission.main.EveryDayDiscountType;
|
||||
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
||||
import config.SEveryDayGiftTask;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 天天0.1折任务刷新事件
|
||||
*/
|
||||
public class EveryDayDiscountRefreshEventProcess implements BaseGameEventProcessor {
|
||||
@Override
|
||||
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception {
|
||||
UserMissionManager missionManager = user.getUserMissionManager();
|
||||
EveryDayDiscountType everyDayDiscountType = missionManager.getEveryDayDiscountType();
|
||||
// 初始化任务
|
||||
int activityId = (Integer)parm[0];
|
||||
Map<Integer, SEveryDayGiftTask> taskMap = SEveryDayGiftTask.activitymap.get(activityId);
|
||||
everyDayDiscountType.getDoingMissionIds().clear();
|
||||
everyDayDiscountType.getFinishMissionIds().clear();
|
||||
everyDayDiscountType.getRewardedMissionIds().clear();
|
||||
everyDayDiscountType.getDoingMissionIds().addAll(taskMap.keySet());
|
||||
missionManager.setEveryDayDiscountType(everyDayDiscountType);
|
||||
missionManager.setEveryDayDiscountCumulationData(new CumulationData());
|
||||
}
|
||||
}
|
||||
|
|
@ -59,6 +59,7 @@ public class MissionEventDistributor {
|
|||
eventProcessor.put(GameEvent.MISTY_TRIP_REFRESH,new MistyTripRefreshEventProcess());//缥缈之旅刷新开始
|
||||
eventProcessor.put(GameEvent.MISSING_ROOM_REFRESH,new MissingRefreshEventProcess());// 迷宫寻宝任务刷新
|
||||
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipRefreshEventProcess());//vip刷新
|
||||
eventProcessor.put(GameEvent.EVERY_DAY_TASK_REFRESH,new EveryDayDiscountRefreshEventProcess());//天天0.1折任务
|
||||
|
||||
|
||||
// 领取奖励
|
||||
|
|
@ -84,6 +85,14 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.HOME_TASK_UPDATE,typeList);
|
||||
eventProcessor.put(GameEvent.HOME_TASK_UPDATE,new CumulationDataEventProcessor());
|
||||
|
||||
// 天天0.1折修改
|
||||
typeList.add(MissionType.LOGIN_TIMES);
|
||||
typeList.add(MissionType.DAILY_TASK_FINISH);
|
||||
typeList.add(MissionType.ARENA_CHALLENEGE_NUMS);
|
||||
typeList.add(MissionType.RECHARGE_ACCUMULATIVE_NUM);
|
||||
eventEnumListMap.put(GameEvent.EVERY_DAY_UPDATE,typeList);
|
||||
eventProcessor.put(GameEvent.EVERY_DAY_UPDATE,new EveryDayDiscountDataEventProcessor());
|
||||
|
||||
// 用户升级
|
||||
eventProcessor.put(GameEvent.USER_LEVELUP,new UserLevelEventProcessor());
|
||||
|
||||
|
|
@ -263,6 +272,7 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.put(GameMisionType.HOME_MISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.DONGHAIXUNXIAN_MISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.EXPLORE, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.EVERY_DAY_DISCOUNT, new ArrayList<>());
|
||||
} else {
|
||||
missionTypeEnumListMap.get(GameMisionType.VIPMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.DAILYMISSION).clear();
|
||||
|
|
@ -280,6 +290,7 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.get(GameMisionType.HOME_MISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.DONGHAIXUNXIAN_MISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.EXPLORE).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.EVERY_DAY_DISCOUNT).clear();
|
||||
}
|
||||
threadMissionChangeList.set(missionTypeEnumListMap);
|
||||
}
|
||||
|
|
@ -421,7 +432,7 @@ public class MissionEventDistributor {
|
|||
if (processor == null) {
|
||||
return null;
|
||||
}
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap = threadMissionChangeList.get();
|
||||
Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap = threadMissionChangeList.get();
|
||||
try {
|
||||
if(missionTypeEnumListMap == null){
|
||||
missionTypeEnumListMap = new HashMap<>(1);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public abstract class AbstractMissionType {
|
|||
|
||||
public void rewardMission(int missionId, List<MissionStateChangeInfo> missionTypeEnumListMap){
|
||||
if (!finishMissionIds.contains(missionId)) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
finishMissionIds.remove(missionId);
|
||||
rewardedMissionIds.set(missionId);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class DailyMissionIdsType extends AbstractMissionType{
|
|||
int[][] reward = sDailyTasksConfigById.getReward();
|
||||
//添加戒灵秘宝奖励
|
||||
MissionStateChangeInfo stateChangeInfo;
|
||||
if(ActivityLogic.getInstance().getActivityStatusByType(user,ActivityType.TREASURE).size()!=0){
|
||||
if(!ActivityLogic.getInstance().getActivityStatusByType(user, ActivityType.TREASURE).isEmpty()){
|
||||
int[][] mazePoint = sDailyTasksConfigById.getMazePoint();
|
||||
int[][] ints = new int[reward.length + mazePoint.length][];
|
||||
System.arraycopy(reward, 0, ints, 0, reward.length);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ljsd.jieling.logic.mission.main;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.EveryDayDiscountNumUpdateEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.MissionState;
|
||||
import com.ljsd.jieling.logic.mission.data.AbstractDataManager;
|
||||
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
||||
import config.SEveryDayGiftTask;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 天天0.1折扣任务
|
||||
*/
|
||||
public class EveryDayDiscountType extends AbstractMissionType {
|
||||
|
||||
@Override
|
||||
public void openMission(User user, int missionId, List<MissionStateChangeInfo> missionTypeEnumList) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] reward(int missionId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) throws Exception {
|
||||
Map<Integer, SEveryDayGiftTask> taskMap = SEveryDayGiftTask.taskmap.get(result.subType.getMissionTypeValue());
|
||||
if (taskMap == null){
|
||||
return;
|
||||
}
|
||||
for (SEveryDayGiftTask task : taskMap.values()) {
|
||||
// 任务子id
|
||||
int id = task.getId();
|
||||
// 不在执行中
|
||||
if(!getDoingMissionIds().contains(id)){
|
||||
continue;
|
||||
}
|
||||
AbstractDataManager dataManager = (AbstractDataManager) DataManagerDistributor.getMissTypeData(result.subType);
|
||||
// 获取任务进度
|
||||
int num = dataManager.getProcess(user, cumulationData, task.getTaskValue()[1]);
|
||||
// 是否完成
|
||||
boolean isFinish = dataManager.isFinish(user, cumulationData, task.getTaskValue(), num);
|
||||
if (!isFinish) {
|
||||
// 未完成
|
||||
MissionStateChangeInfo doingInfo = new MissionStateChangeInfo(id, MissionState.DOING, num);
|
||||
missionStateChangeInfos.add(doingInfo);
|
||||
continue;
|
||||
}
|
||||
// 清除旧信息(进行中)
|
||||
missionStateChangeInfos.removeIf(v->v.getMissionId()==id);
|
||||
// 添加新信息(可领取)
|
||||
MissionStateChangeInfo finishInfo = new MissionStateChangeInfo(id,MissionState.FINISH, task.getReward());
|
||||
missionStateChangeInfos.add(finishInfo);
|
||||
// 任务列表更新
|
||||
getDoingMissionIds().remove(id);
|
||||
getFinishMissionIds().add(id);
|
||||
|
||||
// 直接完成领取
|
||||
rewardMission(id, missionStateChangeInfos);
|
||||
Poster.getPoster().dispatchEvent(new EveryDayDiscountNumUpdateEvent(user.getId(),task.getReward()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ public class ServenMissionIdsType extends AbstractMissionType{
|
|||
boolean isFinish;
|
||||
int doingProgress;
|
||||
BaseDataManager missTypeData = DataManagerDistributor.getMissTypeData(MissionType.findByMissionId(sTaskConfig.getTaskType()));
|
||||
if(missTypeData instanceof AbstractDataManager ){
|
||||
if(missTypeData instanceof AbstractDataManager){
|
||||
doingProgress = ((AbstractDataManager) missTypeData).getProcess(user,cumulationData,sTaskConfig.getTaskValue()[0]);
|
||||
isFinish=((AbstractDataManager) missTypeData).isFinish(user,cumulationData, sTaskConfig.getTaskValue());
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
|||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
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.store.newRechargeInfo.NewRechargeInfo;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
|
|
@ -64,11 +65,11 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
|
||||
|
||||
private static final String test_buy_order = "test_buy_order";
|
||||
private static final String gm_modifier = "gm_modifier";
|
||||
private static final String vouchers_order = "vouchers_order";
|
||||
private static final String support_order = "support_order";
|
||||
private static final String money_order = "money_order";
|
||||
private static final String test_buy_order = "test_buy_order";// 本地测试购买
|
||||
private static final String gm_modifier = "gm_modifier";// gm商店购买
|
||||
private static final String vouchers_order = "vouchers_order";//代金卷购买
|
||||
private static final String support_order = "support_order";//后台扶持购买
|
||||
private static final String money_order = "money_order";//现金点券购买
|
||||
|
||||
//获取充值总金额,结合前面的
|
||||
public static double getAllAmount(User user){
|
||||
|
|
@ -177,17 +178,58 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
|
||||
/**
|
||||
* 是否花费人民币购买
|
||||
* 充值礼包 额外处理
|
||||
* @param user 用户
|
||||
* @param orderId 订单号
|
||||
* @param giftId 礼包id
|
||||
* @param amount 金额
|
||||
* @param list 额外掉落
|
||||
*/
|
||||
private static boolean isRmbBuy(String orderId){
|
||||
return !gm_modifier.equals(orderId) && !test_buy_order.equals(orderId) && !support_order.equals(orderId) && !vouchers_order.equals(orderId);
|
||||
}
|
||||
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));
|
||||
|
||||
/**
|
||||
* 是否计算充值
|
||||
*/
|
||||
private static boolean isRechargeBuy(String orderId){
|
||||
return !gm_modifier.equals(orderId) && !money_order.equals(orderId);
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(giftId);
|
||||
// 测试购买 || 扶持购买
|
||||
if (orderId.equals(test_buy_order) || orderId.equals(support_order)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),amount));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),giftId,orderId));
|
||||
// 额外掉落
|
||||
if (config.getGainCrystal() != null && config.getGainCrystal().length > 0){
|
||||
list.add(config.getGainCrystal());
|
||||
}
|
||||
// 天天任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_UPDATE, MissionType.RECHARGE_ACCUMULATIVE_NUM, amount);
|
||||
}
|
||||
// 代金券购买
|
||||
else if (orderId.equals(vouchers_order)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),amount));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),giftId,orderId));
|
||||
}
|
||||
// 现金点券支付
|
||||
else if (orderId.equals(money_order)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),amount));
|
||||
}
|
||||
// rmb充值
|
||||
else{
|
||||
// 记录真实充值
|
||||
user.getPlayerInfoManager().getNewRechargeInfo().addRealityRmb(amount);
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),amount));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),giftId,orderId));
|
||||
// 额外掉落
|
||||
if (config.getGainCrystal() != null && config.getGainCrystal().length > 0){
|
||||
list.add(config.getGainCrystal());
|
||||
}
|
||||
// 天天任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_UPDATE, MissionType.RECHARGE_ACCUMULATIVE_NUM, amount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -246,18 +288,6 @@ public class BuyGoodsNewLogic {
|
|||
rechargeHandler.getBag(user, gId).addBuyTimes(1);
|
||||
}
|
||||
}
|
||||
|
||||
List<int[][]> list = bag.getDropByBag();
|
||||
// 购买礼包额外补助
|
||||
int[][] gainFame = config.getGainFame();
|
||||
if (gainFame != null && gainFame.length > 0){
|
||||
list.add(gainFame);
|
||||
}
|
||||
// gm购买礼包不参与补助
|
||||
int[][] gainCrystal = config.getGainCrystal();
|
||||
if (isRechargeBuy(orderId) && gainCrystal != null && gainCrystal.length > 0){
|
||||
list.add(gainCrystal);
|
||||
}
|
||||
//处理特权
|
||||
activePrivilege(user,config);
|
||||
// 校验
|
||||
|
|
@ -275,15 +305,15 @@ public class BuyGoodsNewLogic {
|
|||
sendGiftGoodsWithoutJudge(uid);
|
||||
// 推送礼包
|
||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId);
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1));
|
||||
// gm充值不进行单笔充值活动
|
||||
if (isRechargeBuy(orderId)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),(int)price));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),goodsId,orderId));
|
||||
// 基础掉落
|
||||
List<int[][]> list = bag.getDropByBag();
|
||||
// 购买礼包额外补助
|
||||
int[][] gainFame = config.getGainFame();
|
||||
if (gainFame != null && gainFame.length > 0){
|
||||
list.add(gainFame);
|
||||
}
|
||||
// 相关处理
|
||||
rechargeHandler(user, orderId, config.getId(), (int) config.getPrice(), list);
|
||||
// 发货
|
||||
sendGoodsByType(user,config,list);
|
||||
// 通知前端
|
||||
|
|
@ -295,11 +325,6 @@ public class BuyGoodsNewLogic {
|
|||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert(SErrorCodeEerverConfig.errorMap.get(mail[1]).getkey(), new Object[]{config.getName()}, new int[]{1}, "#");
|
||||
MailLogic.getInstance().sendMail(uid,title,content,"",TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
if(price > 0 && isRmbBuy(orderId)) {
|
||||
rechargeInfo.addRealityRmb(price);// 记录真实充值
|
||||
}
|
||||
|
||||
// 更新入库
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE, PlayerInfoProto.RechargeSuccessIndication.newBuilder().setOrderId(orderId).build(), true);
|
||||
|
|
@ -677,10 +702,6 @@ public class BuyGoodsNewLogic {
|
|||
|
||||
/**
|
||||
* 获取全部礼包发送前端
|
||||
* @param uid
|
||||
* @param giftGoodsInfoList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean getGoodsBagInfo(int uid,List<CommonProto.GiftGoodsInfo> giftGoodsInfoList) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
|
|
|
|||
|
|
@ -646,9 +646,10 @@ public class StoreLogic {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
String format = MessageFormat.format("购买商品退出,未知的条件类型,请联系策划确认,uid:{0},storeId:{1},itemId:{2},itemNum:{3}", user.getId(), storeId,itemId,itemNum);
|
||||
LOGGER.error(format);
|
||||
return false;
|
||||
// String format = MessageFormat.format("购买商品退出,未知的条件类型,请联系策划确认,uid:{0},storeId:{1},itemId:{2},itemNum:{3}", user.getId(), storeId,itemId,itemNum);
|
||||
// LOGGER.error(format);
|
||||
// return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 限购次数验证
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class FileConverter {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String inputFilePath = "D:\\Code\\jieling_server\\serverlogic\\src\\main\\java\\com\\ljsd\\jieling\\globals\\BIReason.java"; // 替换为你的 1.java 文件路径
|
||||
String outputFilePath = "D:\\Code\\jieling_server\\conf\\hotswap\\reason.txt"; // 替换为你的输出文件路径
|
||||
|
||||
convertFile(inputFilePath, outputFilePath);
|
||||
}
|
||||
|
||||
public static void convertFile(String inputFilePath, String outputFilePath) {
|
||||
File inputFile = new File(inputFilePath);
|
||||
File outputFile = new File(outputFilePath);
|
||||
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(inputFile));
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile, false))) { // false to overwrite
|
||||
|
||||
String line;
|
||||
Pattern pattern = Pattern.compile("int\\s+\\w+\\s*=\\s*(\\d+);\\s*//(.+)");
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
Matcher matcher = pattern.matcher(line);
|
||||
|
||||
if (matcher.find()) {
|
||||
String number = matcher.group(1);
|
||||
String description = matcher.group(2);
|
||||
writer.write(number + "#" + description);
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("File conversion and overwriting completed successfully!");
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("An error occurred during file conversion: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -759,6 +759,7 @@ public class ItemUtil {
|
|||
break;
|
||||
case Global.DAILY_TASK_REMOVE_ITEM:
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.DAILY_TASK_FINISH, (int) itemNum);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EVERY_DAY_UPDATE, MissionType.DAILY_TASK_FINISH, (int) itemNum);
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
|
@ -930,9 +931,8 @@ public class ItemUtil {
|
|||
|
||||
// 玩家升级, 埋点推送和任务处理
|
||||
if (playerInfoManager.getLevel() > oldLevel) {
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum.LEVEL_UP.getType(),oldLevel,playerInfoManager.getLevel()-oldLevel,playerInfoManager.getLevel());
|
||||
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,MissionType.USER_LEVEL,oldLevel+1,playerInfoManager.getLevel());
|
||||
Poster.getPoster().dispatchEvent(new EveryDayDiscountUnlockEvent(user.getId()));
|
||||
}
|
||||
|
||||
// 家园建筑解锁
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ public class ToolsUtil {
|
|||
return timeLong + TimeUtils.DAY * dayOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机数
|
||||
* @param array 数组
|
||||
* @return 随机数
|
||||
*/
|
||||
public static int getRandomInt(int[] array){
|
||||
int sum = Arrays.stream(array).sum();
|
||||
|
||||
|
|
@ -202,6 +207,14 @@ public class ToolsUtil {
|
|||
return -1; // 如果没有找到匹配的元素,则返回 -1
|
||||
}
|
||||
|
||||
public static int getPackId(int id){
|
||||
return 100000 + id;
|
||||
}
|
||||
|
||||
public static int getOriginId(int id){
|
||||
return id % 100000;
|
||||
}
|
||||
|
||||
/**
|
||||
* type 需要小于10
|
||||
*/
|
||||
|
|
@ -209,10 +222,6 @@ public class ToolsUtil {
|
|||
return type * 100000 + id;
|
||||
}
|
||||
|
||||
public static int getOriginId(int id){
|
||||
return id % 100000;
|
||||
}
|
||||
|
||||
public static int[] getOriginIds(int id){
|
||||
int[] result = new int[2];
|
||||
result[0] = Integer.parseInt(String.valueOf(String.valueOf(id).charAt(0)));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="EveryDayGift")
|
||||
public class SEveryDayGift implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int globalActivity;
|
||||
|
||||
private int rechargeID;
|
||||
|
||||
private int[][] condition;
|
||||
|
||||
private int probability;
|
||||
|
||||
private int limit;
|
||||
|
||||
private int maxLimit;
|
||||
|
||||
private int itemID;
|
||||
|
||||
public static Map<Integer, SEveryDayGift> map = new HashMap<>();
|
||||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGift>> activitymap = 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);
|
||||
}
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getGlobalActivity() {
|
||||
return globalActivity;
|
||||
}
|
||||
|
||||
public int getRechargeID() {
|
||||
return rechargeID;
|
||||
}
|
||||
|
||||
public int[][] getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public int getProbability() {
|
||||
return probability;
|
||||
}
|
||||
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public int getMaxLimit() {
|
||||
return maxLimit;
|
||||
}
|
||||
|
||||
public int getItemID() {
|
||||
return itemID;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="EveryDayGiftTask")
|
||||
public class SEveryDayGiftTask implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int globalActivity;
|
||||
|
||||
private int taskType;
|
||||
|
||||
private int[][] taskValue;
|
||||
|
||||
private int reward;
|
||||
|
||||
private int[] jump;
|
||||
|
||||
private int addNumber;
|
||||
|
||||
public static Map<Integer, SEveryDayGiftTask> map = new HashMap<>();
|
||||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGiftTask>> activitymap = new HashMap<>();
|
||||
|
||||
public static Map<Integer, Map<Integer, SEveryDayGiftTask>> taskmap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SEveryDayGiftTask.class);
|
||||
for (SEveryDayGiftTask task : map.values()) {
|
||||
activitymap.put(task.getGlobalActivity(), new HashMap<>());
|
||||
activitymap.get(task.getGlobalActivity()).put(task.getId(), task);
|
||||
|
||||
taskmap.put(task.getTaskType(), new HashMap<>());
|
||||
taskmap.get(task.getTaskType()).put(task.getId(), task);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getGlobalActivity() {
|
||||
return globalActivity;
|
||||
}
|
||||
|
||||
public int getTaskType() {
|
||||
return taskType;
|
||||
}
|
||||
|
||||
public int[][] getTaskValue() {
|
||||
return taskValue;
|
||||
}
|
||||
|
||||
public int getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int[] getJump() {
|
||||
return jump;
|
||||
}
|
||||
|
||||
public int getAddNumber() {
|
||||
return addNumber;
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
|||
private int type;
|
||||
private double price;
|
||||
private int[][] otherBuy;
|
||||
private int[][] OtherBuy1;
|
||||
private int[][] otherBuy1;
|
||||
private int[][] firstMultiple;
|
||||
private int[] continuedMultiple;
|
||||
private int[][] baseReward;
|
||||
|
|
@ -128,7 +128,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
|||
}
|
||||
|
||||
public int[][] getOtherBuy1() {
|
||||
return OtherBuy1;
|
||||
return otherBuy1;
|
||||
}
|
||||
|
||||
public int getAccumulativeRecharge() { return accumulativeRecharge; }
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ public class STableManager {
|
|||
map.put(id, obj);
|
||||
} catch (NoSuchFieldException e) {
|
||||
LOGGER.error("读表报错,表name:{},异常:{}",clazz.getSimpleName(),e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue