合并分支
commit
94f9847844
|
@ -137,6 +137,7 @@ public class TimeUtils {
|
|||
|
||||
public static final TimeZone TIME_ZONE;
|
||||
|
||||
private static final String ymdhms_Format_new = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static final String Stand_CeHua_Data_format = "yyyyMMdd HHmmss";
|
||||
|
||||
|
@ -294,6 +295,12 @@ public class TimeUtils {
|
|||
return new SimpleDateFormat(ymdFormat).format(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳字符串yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
public static String getTimeStamp2(Long time) {
|
||||
return new SimpleDateFormat(ymdhms_Format_new).format(new Date(time));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 是否是同一天
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.network.NetManager;
|
||||
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
|
||||
import config.SGameSetting;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
@ -100,13 +102,16 @@ public class GameApplication {
|
|||
serverConfigTmp.setOpenTime(format);
|
||||
serverConfigTmp.setCacheOpenTime(serverOenTime);
|
||||
serverConfigTmp.setId(1);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
||||
}else{
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String openTime = serverConfigTmp.getOpenTime();
|
||||
Date date = simpleDateFormat.parse(openTime);
|
||||
serverConfigTmp.setCacheOpenTime(date.getTime());
|
||||
}
|
||||
int version = STableManager.getConfig(SGameSetting.class).get(1).getWookbookVersion();
|
||||
serverConfigTmp.setVersion(version);
|
||||
serverConfigTmp.setRestartTime(TimeUtils.getTimeStamp2(TimeUtils.now()));
|
||||
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
||||
serverConfig = serverConfigTmp;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -11,8 +12,11 @@ import org.springframework.stereotype.Component;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
|
@ -38,9 +42,16 @@ public class GetWishDrawCardInfoHandler extends BaseHandler<HeroInfoProto.choice
|
|||
if (proto != null && proto.getInfoListCount() > 0){
|
||||
HeroLogic.getInstance().updateWishDrawCardInfo(user,proto.getInfoListList());
|
||||
}
|
||||
|
||||
// 返回
|
||||
// 心愿信息
|
||||
List<CommonProto.wishDrawCardInfo> wishCard = CBean2Proto.getWishCard(user);
|
||||
return HeroInfoProto.choiceWishHeroResponse.newBuilder().addAllInfoList(wishCard).build();
|
||||
// 开服时间
|
||||
int openTime = HeroLogic.getInstance().getServerOpenTimeByWishCard();
|
||||
Set<Integer> heroList = new HashSet<>();
|
||||
if (openTime > 0){
|
||||
heroList = HeroLogic.getInstance().getWishOpenHeroList(user);
|
||||
}
|
||||
// 更新的英雄列表
|
||||
return HeroInfoProto.choiceWishHeroResponse.newBuilder()
|
||||
.addAllInfoList(wishCard).setServerOpenTime(openTime).addAllHeroList(heroList).build();
|
||||
}
|
||||
}
|
|
@ -87,19 +87,30 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
int gid = 0;
|
||||
String channle_id = "";
|
||||
String bundle_id = "";
|
||||
String pack_Id = "";
|
||||
String channelS = loginRequest.getChannelS();
|
||||
String[] splitChannelS = channelS.split("#");
|
||||
if(splitChannelS.length==1){
|
||||
// if(!StringUtil.isEmpty(splitChannelS[0])){
|
||||
// pid = Integer.valueOf(splitChannelS[0]);
|
||||
// }
|
||||
}else if (splitChannelS.length>=2){
|
||||
}else if (splitChannelS.length==2){
|
||||
if(!StringUtil.isEmpty(splitChannelS[0])){
|
||||
channle_id = splitChannelS[0];
|
||||
}
|
||||
if(!StringUtil.isEmpty(splitChannelS[1])){
|
||||
bundle_id = splitChannelS[1];
|
||||
}
|
||||
}else if(splitChannelS.length==3){
|
||||
if(!StringUtil.isEmpty(splitChannelS[0])){
|
||||
channle_id = splitChannelS[0];
|
||||
}
|
||||
if(!StringUtil.isEmpty(splitChannelS[1])){
|
||||
bundle_id = splitChannelS[1];
|
||||
}
|
||||
if(!StringUtil.isEmpty(splitChannelS[2])){
|
||||
pack_Id = splitChannelS[1];
|
||||
}
|
||||
}
|
||||
|
||||
//临时代码 等前端出新包后删除2019 11 29
|
||||
|
@ -126,9 +137,9 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
if(split.length>=2){
|
||||
String openId = split[0];
|
||||
String chanel = split[1];
|
||||
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId);
|
||||
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
||||
}
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId);
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
||||
|
||||
user.getPlayerInfoManager().setLastDeviceId(loginRequest.getDeviceIdS());
|
||||
// String newToken = UserManager.getNewToken(userId);
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.ljsd.jieling.logic.dao.GuilidManager;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SGodSacrificeSetting;
|
||||
import manager.STableManager;
|
||||
|
@ -100,6 +101,8 @@ public class CommitShejiActivityItemRequestHandler extends BaseHandler<ActivityP
|
|||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, _result, BIReason.SHEJI_ACTIVITY);
|
||||
guildInfo.setGuildSheJiScore(score+guildInfo.getGuildSheJiScore());
|
||||
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,score,proto.getItemId(),proto.getItemNum()));
|
||||
//社稷捐献次数
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.SHEJI_DONATE,1);
|
||||
return ActivityProto.CommitShejiActivityItemResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,6 +196,8 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
}
|
||||
}
|
||||
}
|
||||
//参与奖励
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_PARTICIPATION_REWARD,1);
|
||||
//排行榜章节
|
||||
int hardStageId = SHardStage.getStageIdByChapterAndSection(user.getHardStageManager().getCurChapter(), user.getHardStageManager().getCurNode());
|
||||
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 1, hardStageId));
|
||||
|
|
|
@ -3151,6 +3151,7 @@ public class MapLogic {
|
|||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getType(),sDailyChallengeConfig.getMonsterId(),MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),new Date(),"",0,itemIdList,itemNumList,type==1?"挑战":"扫荡",isFailed?"失败":"通过");
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE_COUNT,1);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
|
||||
}
|
||||
|
||||
|
@ -3420,24 +3421,30 @@ public class MapLogic {
|
|||
EndlessTreasureReward worldTreasureReward = user.getMapManager().getEndlessTreasureReward();
|
||||
//检测一下刷新
|
||||
flushEndlessTreasure(user);
|
||||
MapInfoProto.EndlessTreasureInfoResponse.Builder response = MapInfoProto.EndlessTreasureInfoResponse.newBuilder();
|
||||
// if(worldTreasureReward.getFirstStartTime()!=0&&worldTreasureReward.getFirstStartTime()<=TimeUtils.nowInt()&&worldTreasureReward.getCreateTime()>TimeUtils.now()/1000){
|
||||
Map<Integer, Integer> rewardStatusMap = worldTreasureReward.getRewardStatusMap();
|
||||
Map<Integer, SEndlessTreasure> worldBossTreasureStaticConfig = STableManager.getConfig(SEndlessTreasure.class);
|
||||
List<MapInfoProto.EndlessTreasureRewardState> states = new ArrayList<>(100);
|
||||
worldBossTreasureStaticConfig.forEach((k,v)->{
|
||||
MapInfoProto.EndlessTreasureRewardState.Builder builder = MapInfoProto.EndlessTreasureRewardState.newBuilder().setId(k).setState(rewardStatusMap.getOrDefault(k,0));
|
||||
states.add(builder.build());
|
||||
});
|
||||
response.addAllTreasureRewardState(states);
|
||||
response.setResetTime(worldTreasureReward.getCreateTime());
|
||||
response.setIsBuy(worldTreasureReward.getIsBuy());
|
||||
MapInfoProto.EndlessTreasureInfoResponse.Builder response = getEndlessResponseBuilder(worldTreasureReward);
|
||||
// }else {
|
||||
// response.setResetTime(-1);
|
||||
// }
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
public MapInfoProto.EndlessTreasureInfoResponse.Builder getEndlessResponseBuilder(EndlessTreasureReward worldTreasureReward){
|
||||
MapInfoProto.EndlessTreasureInfoResponse.Builder response = MapInfoProto.EndlessTreasureInfoResponse.newBuilder();
|
||||
// if(worldTreasureReward.getFirstStartTime()!=0&&worldTreasureReward.getFirstStartTime()<=TimeUtils.nowInt()&&worldTreasureReward.getCreateTime()>TimeUtils.now()/1000){
|
||||
Map<Integer, Integer> rewardStatusMap = worldTreasureReward.getRewardStatusMap();
|
||||
Map<Integer, SEndlessTreasure> worldBossTreasureStaticConfig = STableManager.getConfig(SEndlessTreasure.class);
|
||||
List<MapInfoProto.EndlessTreasureRewardState> states = new ArrayList<>(100);
|
||||
worldBossTreasureStaticConfig.forEach((k,v)->{
|
||||
MapInfoProto.EndlessTreasureRewardState.Builder builder = MapInfoProto.EndlessTreasureRewardState.newBuilder().setId(k).setState(rewardStatusMap.getOrDefault(k,0));
|
||||
states.add(builder.build());
|
||||
});
|
||||
response.addAllTreasureRewardState(states);
|
||||
response.setResetTime(worldTreasureReward.getCreateTime());
|
||||
response.setIsBuy(worldTreasureReward.getIsBuy());
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
public void flushEndlessTreasure(User user) throws Exception {
|
||||
if(user.getMapManager().getEndlessTreasureReward().getCreateTime()<TimeUtils.nowInt()){
|
||||
user.getMapManager().resetEndlessTreasure();
|
||||
|
@ -3445,6 +3452,10 @@ public class MapLogic {
|
|||
if(item!=null&&item.getItemNum()>0){
|
||||
item.setItemNum(0);
|
||||
}
|
||||
LOGGER.info("刷新无尽秘宝uid=>{}",user.getId());
|
||||
MapInfoProto.EndlessTreasureInfoResponse.Builder response = getEndlessResponseBuilder(user.getMapManager().getEndlessTreasureReward());
|
||||
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.ENDLESS_TREASURE_REFRESH_INDICATION_VALUE,response.build(),true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,10 +106,12 @@ public enum ReportEventEnum {
|
|||
START_DEMON_INVASION(72,"start_demon_invasion",CommonEventHandler.getInstance(),new String[]{"stage_id_travel","boss_ids","combat_results"}),
|
||||
// 通过逍遥游
|
||||
COMPLETE_TRAVEL(73,"complete_travel",CommonEventHandler.getInstance(),new String[]{"stage_id_travel"}),
|
||||
// 新将来袭
|
||||
// 踏碎凌霄
|
||||
TA_SUI_LING_XIAO(74,"tasuilingxiao_boss",CommonEventHandler.getInstance(),new String[]{"boss_id","damage_num","reward_nums_list"}),
|
||||
//山河社稷图
|
||||
HARD_STAGE(75 ,"Sunvo_figure",CommonEventHandler.getInstance(),new String[]{"Sunvo_figure_type","Sunvo_figure_id","combat_results","get_star"}),
|
||||
//心愿抽卡活动
|
||||
CHOICE_DRAW_CARD(76 ,"wish_summon",CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
|
|
@ -85,6 +85,16 @@ public class ReportUserEvent {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ReportUserEvent setPackId(String packId){
|
||||
baseInfo.put("pack_id",packId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReportUserEvent setChannelId(String channelId){
|
||||
baseInfo.put("channel_id",channelId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<String, Object> getBaseInfo() {
|
||||
return baseInfo;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,9 @@ public class ReportUtil {
|
|||
.setCoins_amount(coin==null?0:coin.getItemNum())
|
||||
.setDiamond_amount(diamond==null?0:(int)diamond.getItemNum())
|
||||
.setFighting_capacity(user.getPlayerInfoManager().getMaxForce())
|
||||
.setLevel(user.getPlayerInfoManager().getLevel());
|
||||
.setLevel(user.getPlayerInfoManager().getLevel())
|
||||
.setChannelId(user.getPlayerInfoManager().getChannel_id())
|
||||
.setPackId(user.getPlayerInfoManager().getPack_id());
|
||||
}
|
||||
|
||||
public static void doReport(ReportUserEvent reportUserEvent){
|
||||
|
|
|
@ -8,11 +8,14 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.handler.activity.BlessInfoConfig;
|
||||
import com.ljsd.jieling.jbean.ActivityManager;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.jbean.LuckWheelMission;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
|
@ -1553,12 +1556,15 @@ public class ActivityLogic implements IEventHandler{
|
|||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT, "抽奖次数不足");
|
||||
}
|
||||
CommonProto.Drop.Builder drop = null;
|
||||
|
||||
int[] markReward = new int[]{0,0};
|
||||
int[][] markRewards = new int[num][];
|
||||
// 单抽
|
||||
if (num == 1){
|
||||
// 验证免费特权
|
||||
boolean check = PlayerLogic.getInstance().checkAndUpdate(user, setting.getFreeTimes(), num);
|
||||
if (check){
|
||||
drop = getDrawReward(user, activityId, num);
|
||||
drop = getDrawReward(user, activityId, num, markRewards);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1571,7 +1577,8 @@ public class ActivityLogic implements IEventHandler{
|
|||
boolean itemCost = ItemUtil.itemCost(user, cost, BIReason.CHOICE_DRAW_CARD, 0);
|
||||
// 道具抽奖
|
||||
if (itemCost){
|
||||
drop = getDrawReward(user, activityId, num);
|
||||
drop = getDrawReward(user, activityId, num, markRewards);
|
||||
markReward = new int[]{item[0][0],item[0][1]};
|
||||
}
|
||||
// 妖晶抽奖
|
||||
else {
|
||||
|
@ -1587,24 +1594,50 @@ public class ActivityLogic implements IEventHandler{
|
|||
if (!itemCost2){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
markReward = new int[]{item[1][0],item[1][1]};
|
||||
//特权次数消耗
|
||||
PlayerLogic.getInstance().checkAndUpdate(user, setting.getDiamondMaxTimes(), num);
|
||||
drop = getDrawReward(user, activityId, num);
|
||||
drop = getDrawReward(user, activityId, num, markRewards);
|
||||
}
|
||||
}
|
||||
|
||||
// 特权消耗
|
||||
PlayerLogic.getInstance().checkAndUpdate(user, setting.getMaxTimes(), num);
|
||||
|
||||
// 事件分发
|
||||
Poster.getPoster().dispatchEvent(new ChoiceDrawCardEvent(user.getId(),activityId,num));
|
||||
|
||||
// 数数上报
|
||||
int choiceRewardId = user.getActivityManager().getActivityMissionMap().get(activityId).getChoiceRewardId();
|
||||
//限时招募 计次数
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.LIMIT_TIME_CHOICE_CARD,num);
|
||||
List<String> list = rewardArrayToList(markRewards);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.CHOICE_DRAW_CARD.getType(), choiceRewardId, num, markReward[0], markReward[1], list);
|
||||
// 返回奖励信息
|
||||
build.setDrop(drop);
|
||||
MessageUtil.sendMessage(user.getId(),1, MessageTypeProto.MessageType.choiceDrawCardResponse_VALUE,build.build(),true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖励数组转list
|
||||
* @param markRewards
|
||||
* @return
|
||||
*/
|
||||
public List<String> rewardArrayToList(int[][] markRewards){
|
||||
List<String> result = new ArrayList<>(markRewards.length);
|
||||
for (int[] random : markRewards) {
|
||||
if (random == null) {
|
||||
continue;
|
||||
}
|
||||
SItem item = SItem.getsItemMap().get(random[0]);
|
||||
if (item == null) {
|
||||
result.add(random[0] +"-id错误"+random[1]);
|
||||
} else if(item.getItemType()== GlobalItemType.CARD) {
|
||||
result.add(random[0] + "-" + item.getQuantity());
|
||||
}else{
|
||||
result.add(random[0] + "#" + random[1]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 心愿 获取奖励
|
||||
* @param user
|
||||
|
@ -1613,9 +1646,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private CommonProto.Drop.Builder getDrawReward(User user,int activityId,int num) throws Exception {
|
||||
// 奖励信息
|
||||
int[][] reward = new int[num][];
|
||||
private CommonProto.Drop.Builder getDrawReward(User user,int activityId,int num,int[][] reward) throws Exception {
|
||||
// 活动信息
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(activityId);
|
||||
// 累计得抽奖次数
|
||||
|
|
|
@ -106,4 +106,6 @@ public interface ActivityType {
|
|||
|
||||
int SUPERFUND128 = 78;//超值基金128
|
||||
int SUPERFUND328 = 79;//超值基金328
|
||||
int PREPARE_FIFTEEN_ACTIVITY = 80;//15日登陆预告
|
||||
int THEME_ACTIVITY_SHOP = 81;//ThemeActivityTask活动商店
|
||||
}
|
||||
|
|
|
@ -80,7 +80,9 @@ public enum ActivityTypeEnum {
|
|||
MISTYTRIP(ActivityType.MISTY_TRIP,MistyTripActivity::new),
|
||||
SUPERFUND128(ActivityType.SUPERFUND128,SuperFundActivity::new),//超值基金128
|
||||
SUPERFUND328(ActivityType.SUPERFUND328,SuperFundActivity::new),//超值基金328
|
||||
;
|
||||
PREPARE_FIFTEEN_ACTIVITY(ActivityType.PREPARE_FIFTEEN_ACTIVITY,DefaultEmptyActivity::new),//超值基金328
|
||||
THEME_ACTIVITY_SHOP(ActivityType.THEME_ACTIVITY_SHOP,DefaultEmptyActivity::new);
|
||||
|
||||
private int type;
|
||||
private Function<Integer, AbstractActivity> toActivityFunction;
|
||||
private static HashMap<Integer, AbstractActivity> acticityCache = new HashMap<>();
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.ljsd.jieling.logic.dao.Item;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
@ -83,6 +84,7 @@ public class SubActivity extends AbstractActivity {
|
|||
//check cost
|
||||
int[][] cost = new int[1][2];
|
||||
cost[0] = sBlessingConfigNew.getCost();
|
||||
|
||||
boolean b = ItemUtil.itemCost(user, cost, BIReason.SUB_ACTIVITY_CONSUME, 1);
|
||||
if (!b) {
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
|
@ -92,6 +94,8 @@ public class SubActivity extends AbstractActivity {
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
}
|
||||
|
||||
//易经宝库翻牌子
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.SUB_ACTIVITY,1);
|
||||
//get reward
|
||||
long count = activityMission.getActivityMissionMap().values().stream().filter(activityProgressInfo1 -> activityProgressInfo1.getState() == ActivityType.HAD_TAKED).count();
|
||||
//后5个概率提前结束抽奖
|
||||
|
|
|
@ -193,10 +193,36 @@ public class CumulationData {
|
|||
public int hardstage_stars;
|
||||
//山河社稷章节数
|
||||
public int hardstage_node;
|
||||
//山河社稷参与奖励
|
||||
public int hardstage_participation;
|
||||
|
||||
// 公会boss
|
||||
public int guild_boss_room;
|
||||
|
||||
//限时招募次数
|
||||
public int limit_time_choice_card_count;
|
||||
// 乾坤宝盒次数
|
||||
public int qian_kun_box_count;
|
||||
// 灵兽招募次数
|
||||
public int soul_recruit_count;
|
||||
|
||||
// 社稷大典捐献次数
|
||||
public int sheji_activity_donate_count;
|
||||
|
||||
// 易经宝库翻牌子次数
|
||||
public int sub_activity;
|
||||
|
||||
// 急速探索次数
|
||||
public int take_adventure_reward_count;
|
||||
|
||||
//活动期间内日常副本挑战总次数
|
||||
public int daily_challenge_count;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
}
|
||||
|
@ -210,15 +236,15 @@ public class CumulationData {
|
|||
|
||||
|
||||
|
||||
public Result(MissionType subType) {
|
||||
this.subType = subType;
|
||||
}
|
||||
|
||||
public Result(MissionType subType, long value) {
|
||||
this.subType = subType;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Result(MissionType subType) {
|
||||
this.subType = subType;
|
||||
}
|
||||
|
||||
public Result(MissionType subType, int param, long value) {
|
||||
this.subType = subType;
|
||||
this.param = param;
|
||||
|
|
|
@ -89,6 +89,11 @@ public class HeroManager extends MongoBase {
|
|||
*/
|
||||
private Map<Integer, Map<Integer,Integer>> wishCountByStar = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 心愿可以选择的英雄列表
|
||||
*/
|
||||
private Set<Integer> wishOpenHeroList = new HashSet<>();
|
||||
|
||||
public Map<Integer, Integer> getRandomCountByType() {
|
||||
return randomCountByType;
|
||||
}
|
||||
|
@ -439,5 +444,19 @@ public class HeroManager extends MongoBase {
|
|||
this.beautyBagCardInfoMap.put(key,val);
|
||||
updateString("beautyBagCardInfoMap", beautyBagCardInfoMap);
|
||||
}
|
||||
|
||||
public Set<Integer> getWishOpenHeroList() {
|
||||
return wishOpenHeroList;
|
||||
}
|
||||
|
||||
public void setWishOpenHeroList(Set<Integer> wishOpenHeroList) {
|
||||
this.wishOpenHeroList = wishOpenHeroList;
|
||||
updateString("wishOpenHeroList", wishOpenHeroList);
|
||||
}
|
||||
|
||||
public void addWishOpenHeroList(int heroTid) {
|
||||
wishOpenHeroList.add(heroTid);
|
||||
updateString("wishOpenHeroList", wishOpenHeroList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private String bundle_id;
|
||||
|
||||
private String pack_id;
|
||||
|
||||
private String lastDeviceId;
|
||||
|
||||
private String nickName;
|
||||
|
@ -1109,4 +1111,14 @@ public class PlayerManager extends MongoBase {
|
|||
this.isHasRandomLotteryType = hasRandomLotteryType;
|
||||
updateString("isHasRandomLotteryType",hasRandomLotteryType);
|
||||
}
|
||||
|
||||
public String getPack_id() {
|
||||
return pack_id;
|
||||
}
|
||||
|
||||
public void setPack_id(String pack_id) {
|
||||
this.pack_id = pack_id;
|
||||
updateString("pack_id",pack_id);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,12 @@ public class ServerConfig extends MongoBase {
|
|||
@Transient
|
||||
private long cacheOpenTime;
|
||||
|
||||
@Field(value = "version")
|
||||
private int version;
|
||||
|
||||
@Field(value = "restartTime")
|
||||
private String restartTime;
|
||||
|
||||
public void setOpenTime(String openTime) {
|
||||
this.openTime = openTime;
|
||||
}
|
||||
|
@ -48,6 +54,7 @@ public class ServerConfig extends MongoBase {
|
|||
this.cacheOpenTime = cacheOpenTime;
|
||||
}
|
||||
|
||||
|
||||
public int getGroupCount() {
|
||||
return groupCount;
|
||||
}
|
||||
|
@ -55,4 +62,27 @@ public class ServerConfig extends MongoBase {
|
|||
public void setGroupCount(int groupCount) {
|
||||
this.groupCount = groupCount;
|
||||
}
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public int getNew_worldLevel() {
|
||||
return new_worldLevel;
|
||||
}
|
||||
|
||||
public void setNew_worldLevel(int new_worldLevel) {
|
||||
this.new_worldLevel = new_worldLevel;
|
||||
}
|
||||
|
||||
public String getRestartTime() {
|
||||
return restartTime;
|
||||
}
|
||||
|
||||
public void setRestartTime(String restartTime) {
|
||||
this.restartTime = restartTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,13 +75,13 @@ public class UserManager {
|
|||
}
|
||||
|
||||
|
||||
public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
|
||||
public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
|
||||
|
||||
User user = null;
|
||||
if (!UserManager.isUserExist(uid)){
|
||||
user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), uid, User.class);
|
||||
if (user == null) {
|
||||
user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
|
||||
user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId,pack_Id);
|
||||
}
|
||||
UserManager.addUser(user);
|
||||
}else{
|
||||
|
@ -89,21 +89,22 @@ public class UserManager {
|
|||
user.getPlayerInfoManager().setGid(gid);
|
||||
user.getPlayerInfoManager().setPid(pid);
|
||||
user.getPlayerInfoManager().setCc_id(ccId);
|
||||
user.getPlayerInfoManager().setPack_id(pack_Id);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
|
||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
|
||||
User user = new User(uid);
|
||||
UserManager.addUser(user);
|
||||
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
|
||||
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId,pack_Id);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(user.getId(),user);
|
||||
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
|
||||
return user;
|
||||
}
|
||||
|
||||
private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
|
||||
private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
long now = TimeUtils.now();
|
||||
|
@ -124,6 +125,7 @@ public class UserManager {
|
|||
playerManager.setPhoneBindInfo(new PhoneBindInfo(""));
|
||||
playerManager.setChannel(channel);
|
||||
playerManager.setCc_id(ccId);
|
||||
playerManager.setPack_id(pack_Id);
|
||||
playerManager.setPid(pid);
|
||||
playerManager.setGid(gid);
|
||||
playerManager.setPlatform(platform);
|
||||
|
|
|
@ -230,6 +230,7 @@ public class CombatLogic {
|
|||
user.getUserMissionManager().onGameEvent(user,GameEvent.PlAY_STORY,9999,1);
|
||||
Poster.getPoster().dispatchEvent(new SecretEvent(user.getId()));
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.TAKE_ADVENTURE_REWARD_COUNT,1);
|
||||
FightInfoProto.TakeAventureRewardResponse build = FightInfoProto.TakeAventureRewardResponse.newBuilder().setDrop(adventureFastReward.get(1)).setRandomDrop(adventureFastReward.get(2)).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_REWARD_RESPONSE_VALUE,build,true);
|
||||
KtEventUtils.onKtEvent(user,ParamEventBean.UserGameType,KTGameType.TAKE_SECURE_REWARD.getIndex(),type*10);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.hero;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.fight.FamilyHeroInfo;
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
|
@ -384,7 +385,7 @@ public class HeroLogic{
|
|||
* @param sLotterySetting
|
||||
* @return
|
||||
*/
|
||||
private int[] drawCard(User user, SLotteryRewardConfig sLotteryRewardConfig, SLotterySetting sLotterySetting){
|
||||
private int[] drawCard(User user, SLotteryRewardConfig sLotteryRewardConfig, SLotterySetting sLotterySetting)throws Exception{
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
// 参数
|
||||
int type = sLotterySetting.getLotteryType();
|
||||
|
@ -404,6 +405,14 @@ public class HeroLogic{
|
|||
}else {
|
||||
result = reward;
|
||||
}
|
||||
//活动抽奖计数
|
||||
if(isActivityByIdAndType(sLotterySetting.getActivityId(), ActivityType.BEAUTY_BAG)){
|
||||
//乾坤宝盒抽奖 计次数
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.QIAN_KUN_BOX,1);
|
||||
}else if(isActivityByIdAndType(sLotterySetting.getActivityId(), ActivityType.SPECIAL_MONSTER_RANDOM_ACTIVITY)){
|
||||
//灵兽招募 计次数
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.SOUL_RECRUIT,1);
|
||||
}
|
||||
//记录卡池抽奖次数
|
||||
heroManager.putRandomType(type,num+result[1]);
|
||||
return result;
|
||||
|
@ -441,6 +450,14 @@ public class HeroLogic{
|
|||
|
||||
return activity.getType() == ActivityType.BEAUTY_BAG;
|
||||
}
|
||||
private boolean isActivityByIdAndType(int activityId,int activityType){
|
||||
SGlobalActivity activity = SGlobalActivity.getsGlobalActivityMap().get(activityId);
|
||||
if(activity==null){
|
||||
return false;
|
||||
}
|
||||
|
||||
return activity.getType() == activityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 心愿抽卡校验
|
||||
|
@ -604,6 +621,53 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可以加入
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public Set<Integer> getWishOpenHeroList(User user){
|
||||
// 开服时间戳
|
||||
long openTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
// 当前时间戳
|
||||
long now = TimeUtils.now();
|
||||
// 差值
|
||||
long time = now - openTime;
|
||||
// set,存储最新的英雄列表
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
// 全部的英雄列表
|
||||
Map<Integer, SCHero> heroMap = SCHero.getsCHero();
|
||||
// 满足条件的放入set
|
||||
heroMap.values().stream().filter(v->v.getJoinWishDay() > 0 && time >= v.getJoinWishDay()*TimeUtils.DAY).forEach(v->set.add(v.getId()));
|
||||
// set, 返回给客户端,最新的set
|
||||
HashSet<Integer> result = new HashSet<>();
|
||||
// 目前存储的全部set
|
||||
Set<Integer> heroList = user.getHeroManager().getWishOpenHeroList();
|
||||
// 之前没有记录的为新开放,需要返回给客户端
|
||||
set.stream().filter(v->!heroList.contains(v)).forEach(result::add);
|
||||
// 更新玩家数据库
|
||||
user.getHeroManager().setWishOpenHeroList(set);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从抽卡获取服务器开服时间
|
||||
* @return
|
||||
*/
|
||||
public int getServerOpenTimeByWishCard(){
|
||||
// 开服时间
|
||||
long openTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
// 根据格式获取时间戳 例子 :20210720
|
||||
int value = SSpecialConfig.getIntegerValue(SSpecialConfig.Data_Of_Unlock_All_Wish_Hero);
|
||||
long time = TimeUtils.stringToTimeLong(String.valueOf(value), "yyyyMMdd");
|
||||
// 规定时间之前开服的返回0
|
||||
if (openTime <= time){
|
||||
return 0;
|
||||
}else {
|
||||
return (int) (openTime/1000);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeRandomItem(User user,int activityId,int[][] random){
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(activityId);
|
||||
if(activityMission==null||activityMission.getActivityMissionMap().get(0)==null){
|
||||
|
|
|
@ -127,4 +127,14 @@ public enum GameEvent {
|
|||
GUILD_BOSS_ROOM,//公会boos副本
|
||||
MISTY_TRIP_REFRESH,//缥缈之旅刷新
|
||||
MISTY_TRIP,//缥缈之旅
|
||||
|
||||
LIMIT_TIME_CHOICE_CARD,//限时招募
|
||||
QIAN_KUN_BOX,//乾坤宝盒
|
||||
SOUL_RECRUIT,//灵兽招募
|
||||
SHEJI_DONATE,//社稷大典捐献次数
|
||||
SUB_ACTIVITY,//易经宝库翻牌子
|
||||
TAKE_ADVENTURE_REWARD_COUNT,//急速探索次数
|
||||
DAILY_CHALLENGE_COUNT,//日常副本挑战次数
|
||||
HARSTAGE_PARTICIPATION_REWARD,//山河社稷图参与奖励
|
||||
|
||||
}
|
||||
|
|
|
@ -1005,7 +1005,39 @@ public class MissionLoigc {
|
|||
case HARSTAGE_NODE:
|
||||
count = cumulationData.hardstage_node;
|
||||
break;
|
||||
case HARSTAGE_PARTICIPATION_REWARD:
|
||||
count = cumulationData.hardstage_participation;
|
||||
break;
|
||||
//100以后类型继承 AbstractDataManager
|
||||
|
||||
case LIMIT_TIME_CHOICE_CARD:
|
||||
//限时招募
|
||||
count = cumulationData.limit_time_choice_card_count;
|
||||
break;
|
||||
case QIAN_KUN_BOX:
|
||||
//乾坤宝盒
|
||||
count = cumulationData.qian_kun_box_count;
|
||||
break;
|
||||
case SOUL_RECRUIT:
|
||||
//灵兽招募
|
||||
count = cumulationData.soul_recruit_count;
|
||||
break;
|
||||
case SHEJI_DONATE:
|
||||
//社稷大典捐献次数
|
||||
count = cumulationData.sheji_activity_donate_count;
|
||||
break;
|
||||
case SUB_ACTIVITY:
|
||||
//易经宝库翻牌子
|
||||
count = cumulationData.sub_activity;
|
||||
break;
|
||||
case TAKE_ADVENTURE_REWARD_COUNT:
|
||||
//急速探索次数
|
||||
count = cumulationData.take_adventure_reward_count;
|
||||
break;
|
||||
case DAILY_CHALLENGE_COUNT:
|
||||
//副本挑战次数
|
||||
count = cumulationData.daily_challenge_count;
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
|
|
|
@ -138,6 +138,16 @@ public enum MissionType {
|
|||
ENDLESS_BIG_REWARD(130),
|
||||
|
||||
GUILD_BOSS_ROOM(131),//公会副本boss
|
||||
|
||||
LIMIT_TIME_CHOICE_CARD(132),//限时招募
|
||||
QIAN_KUN_BOX(133),//乾坤宝盒
|
||||
SOUL_RECRUIT(134),//灵兽招募
|
||||
SHEJI_DONATE(135),//社稷大典捐献次数
|
||||
SUB_ACTIVITY(136),//易经宝库翻牌子
|
||||
TAKE_ADVENTURE_REWARD_COUNT(137),//急速探索次数
|
||||
DAILY_CHALLENGE_COUNT(138),//日常副本挑战次
|
||||
HARSTAGE_PARTICIPATION_REWARD(139),//山河社稷图参与奖励
|
||||
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
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 DailyChallengeManager extends AbstractDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.daily_challenge_count += num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.daily_challenge_count >= value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.daily_challenge_count;
|
||||
}
|
||||
}
|
|
@ -157,10 +157,21 @@ public class DataManagerDistributor {
|
|||
//山河社稷图
|
||||
judges.put(MissionType.HARSTAGE_STARS, new HardStageStarsDataManager());
|
||||
judges.put(MissionType.HARSTAGE_NODE, new HardStageNodeDataManager());
|
||||
judges.put(MissionType.HARSTAGE_PARTICIPATION_REWARD, new HardStageParticipationManager());
|
||||
|
||||
// 公会副本/boss
|
||||
judges.put(MissionType.GUILD_BOSS_ROOM,new GuildBossRoomManager());
|
||||
|
||||
//主题活动中新增任务类型
|
||||
judges.put(MissionType.LIMIT_TIME_CHOICE_CARD,new LimitTimeChoiceCard());//限时招募
|
||||
judges.put(MissionType.QIAN_KUN_BOX,new QianKunBoxManager());//乾坤宝盒
|
||||
judges.put(MissionType.SOUL_RECRUIT,new SoulRecruitManager());//灵兽招募
|
||||
judges.put(MissionType.SHEJI_DONATE,new ShejiActivityDonateManager());//社稷大典捐献次数
|
||||
judges.put(MissionType.SUB_ACTIVITY,new SubActivityManager());//社稷大典捐献次数
|
||||
judges.put(MissionType.TAKE_ADVENTURE_REWARD_COUNT,new TakeAdventureRewardManager());//急速探索次数
|
||||
judges.put(MissionType.DAILY_CHALLENGE_COUNT,new DailyChallengeManager());//副本挑战次数
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
/**
|
||||
* 山河社稷参与奖励
|
||||
*/
|
||||
public class HardStageParticipationManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int nums = (int)parm[0];
|
||||
if(data.hardstage_participation == 0){
|
||||
data.hardstage_participation += 1;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
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 LimitTimeChoiceCard extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.limit_time_choice_card_count+=num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.limit_time_choice_card_count>=value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.limit_time_choice_card_count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
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 QianKunBoxManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.qian_kun_box_count+=num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.qian_kun_box_count>=value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.qian_kun_box_count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
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 ShejiActivityDonateManager extends AbstractDataManager {
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.sheji_activity_donate_count+=num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.sheji_activity_donate_count>=value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.sheji_activity_donate_count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
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 SoulRecruitManager extends AbstractDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.soul_recruit_count += num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.soul_recruit_count>=value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.soul_recruit_count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
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 SubActivityManager extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.sub_activity+=num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.sub_activity>=value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.sub_activity;
|
||||
}
|
||||
|
||||
}
|
|
@ -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 TakeAdventureRewardManager extends AbstractDataManager{
|
||||
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int num = (int)parm[0];
|
||||
data.take_adventure_reward_count += num;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] value, Object... parm) {
|
||||
return data.take_adventure_reward_count >= value[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.take_adventure_reward_count;
|
||||
}
|
||||
|
||||
}
|
|
@ -499,6 +499,48 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.HARSTAGE_NODE, typeList);
|
||||
eventProcessor.put(GameEvent.HARSTAGE_NODE, new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.HARSTAGE_PARTICIPATION_REWARD);
|
||||
eventEnumListMap.put(GameEvent.HARSTAGE_PARTICIPATION_REWARD, typeList);
|
||||
eventProcessor.put(GameEvent.HARSTAGE_PARTICIPATION_REWARD, new CumulationDataEventProcessor());
|
||||
|
||||
|
||||
//限时招募
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.LIMIT_TIME_CHOICE_CARD);
|
||||
eventEnumListMap.put(GameEvent.LIMIT_TIME_CHOICE_CARD, typeList);
|
||||
eventProcessor.put(GameEvent.LIMIT_TIME_CHOICE_CARD, new CumulationDataEventProcessor());
|
||||
//乾坤宝盒
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.QIAN_KUN_BOX);
|
||||
eventEnumListMap.put(GameEvent.QIAN_KUN_BOX, typeList);
|
||||
eventProcessor.put(GameEvent.QIAN_KUN_BOX, new CumulationDataEventProcessor());
|
||||
//魂印招募
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.SOUL_RECRUIT);
|
||||
eventEnumListMap.put(GameEvent.SOUL_RECRUIT, typeList);
|
||||
eventProcessor.put(GameEvent.SOUL_RECRUIT, new CumulationDataEventProcessor());
|
||||
//社稷大典捐献次数
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.SHEJI_DONATE);
|
||||
eventEnumListMap.put(GameEvent.SHEJI_DONATE, typeList);
|
||||
eventProcessor.put(GameEvent.SHEJI_DONATE, new CumulationDataEventProcessor());
|
||||
//易经宝库翻牌子次数
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.SUB_ACTIVITY);
|
||||
eventEnumListMap.put(GameEvent.SUB_ACTIVITY, typeList);
|
||||
eventProcessor.put(GameEvent.SUB_ACTIVITY, new CumulationDataEventProcessor());
|
||||
//急速探索次数次数
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.TAKE_ADVENTURE_REWARD_COUNT);
|
||||
eventEnumListMap.put(GameEvent.TAKE_ADVENTURE_REWARD_COUNT, typeList);
|
||||
eventProcessor.put(GameEvent.TAKE_ADVENTURE_REWARD_COUNT, new CumulationDataEventProcessor());
|
||||
//日常副本挑战次数
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.DAILY_CHALLENGE_COUNT);
|
||||
eventEnumListMap.put(GameEvent.DAILY_CHALLENGE_COUNT, typeList);
|
||||
eventProcessor.put(GameEvent.DAILY_CHALLENGE_COUNT, new CumulationDataEventProcessor());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ public class SCHero implements BaseConfig{
|
|||
|
||||
private int weight;
|
||||
|
||||
private int joinWishDay;
|
||||
|
||||
private Map<Integer,Integer> secondaryFactorMap;
|
||||
|
||||
private Map<Integer, List<Integer>> skillListByStar;
|
||||
|
@ -354,4 +356,8 @@ public class SCHero implements BaseConfig{
|
|||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public int getJoinWishDay() {
|
||||
return joinWishDay;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public class SGameSetting implements BaseConfig {
|
|||
|
||||
private int defaultSuit;
|
||||
|
||||
private int wookbookVersion;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
@ -325,4 +327,8 @@ public class SGameSetting implements BaseConfig {
|
|||
}
|
||||
|
||||
public int getDefaultSuit() {return defaultSuit; }
|
||||
|
||||
public int getWookbookVersion() {
|
||||
return wookbookVersion;
|
||||
}
|
||||
}
|
|
@ -109,6 +109,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String NUMOFCHOOSEREDSIGN ="NumOfChooseRedSign";//乾坤宝盒选择心愿红色魂印数量
|
||||
|
||||
public static final String LING_LONG_COST = "LingLongCost";//玲珑宝镜消耗道具ID
|
||||
public static final String Data_Of_Unlock_All_Wish_Hero = "DataOfUnlockAllWishHero";//在这个日期前开服的服务器默认解锁所有卡池内神将作为心愿,不走hero表加入心愿时长的判断
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue