Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
# Conflicts: # tablemanager/src/main/java/config/SAchievementConfig.javaback_recharge
commit
f9eda6dfe0
|
@ -110,7 +110,7 @@ public class TimeUtils {
|
|||
/**
|
||||
* 年月日 时分秒, 格式如: 20110111011059
|
||||
*/
|
||||
private static final String ymdhmsFormat_new = "yyyyMMddHHmmss";
|
||||
public static final String ymdhmsFormat_new = "yyyyMMddHHmmss";
|
||||
/**
|
||||
* 年月日 时分, 格式如: 2011-01-11 01:10
|
||||
*/
|
||||
|
@ -123,7 +123,7 @@ public class TimeUtils {
|
|||
/**
|
||||
* 年月日,格式如19700710
|
||||
*/
|
||||
private static final String ymdFormat = "yyyyMMdd";
|
||||
public static final String ymdFormat = "yyyyMMdd";
|
||||
/**
|
||||
* 年月日,格式如1970年07月10日
|
||||
*/
|
||||
|
|
|
@ -83,7 +83,7 @@ public class GameApplication {
|
|||
|
||||
private static void setRegisterTime() throws Exception {
|
||||
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
||||
if( null == serverConfigTmp ){
|
||||
if(serverConfigTmp == null){
|
||||
serverConfigTmp = new ServerConfig();
|
||||
if (GameApplication.serverProperties.isAutoOpen()) {
|
||||
int startbefore = 60; //开服白名单时间
|
||||
|
@ -94,23 +94,18 @@ public class GameApplication {
|
|||
LOGGER.error("预计" + sleepTime + "分钟后开服");
|
||||
Thread.sleep(1000 * 60);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("休眠异常", e.getMessage(), e);
|
||||
LOGGER.error("休眠异常:{}", e.getMessage(), e);
|
||||
}
|
||||
needtime = TimeUtils.differMintFromLast(RedisUtil.getInstence().getObject(GameApplication.serverId + RedisKey.Delimiter_colon + RedisKey.AUTOOPENTIME ,"",String.class,-1));
|
||||
}
|
||||
}
|
||||
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
long serverOenTime = TimeUtils.getAppointTime(0);
|
||||
String format = simpleDateFormat.format(serverOenTime);
|
||||
serverConfigTmp.setOpenTime(format);
|
||||
serverConfigTmp.setOpenTime(TimeUtils.getTimeStamp2(serverOenTime));
|
||||
serverConfigTmp.setCacheOpenTime(serverOenTime);
|
||||
serverConfigTmp.setId(1);
|
||||
}else{
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String openTime = serverConfigTmp.getOpenTime();
|
||||
Date date = simpleDateFormat.parse(openTime);
|
||||
serverConfigTmp.setCacheOpenTime(date.getTime());
|
||||
long timeStamp2 = TimeUtils.stringToTimeLong2(serverConfigTmp.getOpenTime());
|
||||
serverConfigTmp.setCacheOpenTime(timeStamp2);
|
||||
}
|
||||
int version = STableManager.getConfig(SGameSetting.class).get(1).getWookbookVersion();
|
||||
serverConfigTmp.setVersion(version);
|
||||
|
|
|
@ -475,6 +475,8 @@ public class GlobalDataManaager implements IManager {
|
|||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.fund_zero_init));
|
||||
// 心愿格子信息刷新
|
||||
HeroLogic.getInstance().resetWishDrawCardInfoMap(user);
|
||||
///清空当天推送的礼包次数
|
||||
user.getPlayerInfoManager().getNewRechargeInfo().ClearDayPushMap();
|
||||
}
|
||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||
}
|
||||
|
|
|
@ -169,28 +169,20 @@ public class ActivityLogic implements IEventHandler{
|
|||
}
|
||||
if(time == ActivityType.OPEN_TYPE_MONTHS){
|
||||
//now = 当前是开服第几个月
|
||||
//开服日期
|
||||
String openTime = GameApplication.serverConfig.getOpenTime().split(" ")[0];
|
||||
String nowTime = TimeUtils.getTimeStampYMDnew(TimeUtils.now());
|
||||
//now = TimeUtils.getGapMonthsByTwoTime(openTime, nowTime)+1;
|
||||
}
|
||||
long startTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),0, 1);
|
||||
long endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),0, 2);
|
||||
long gapEndTime = endTime+sGlobalActivity.getGapTime()*TimeUtils.DAY;
|
||||
if (now < startTime) {
|
||||
//如果没到活动开启时间,但是openActivityIds里有了这个活动,证明是热更延迟开启的活动,需要清除掉
|
||||
if (openActivityIds.contains(sGlobalActivity.getId())) {
|
||||
openActivityIds.remove(sGlobalActivity.getId());
|
||||
}
|
||||
openActivityIds.remove(sGlobalActivity.getId());
|
||||
continue;
|
||||
}
|
||||
int[] ifOpen = sGlobalActivity.getIfOpen();
|
||||
if(ifOpen!=null && ifOpen.length>0){
|
||||
if(ifOpen[0]==2){ //开服
|
||||
if(GameApplication.serverConfig.getCacheOpenTime() + ifOpen[1]*TimeUtils.ONE_DAY >TimeUtils.now()){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 开服条件判断
|
||||
boolean open = SGlobalActivity.checkActivityIfOpen(sGlobalActivity.getId(),0,GameApplication.serverConfig.getCacheOpenTime());
|
||||
if (!open){
|
||||
continue;
|
||||
}
|
||||
if (endTime != 0 && now > endTime) {
|
||||
if (!openActivityIds.contains(sGlobalActivity.getId())) {
|
||||
|
@ -213,8 +205,9 @@ public class ActivityLogic implements IEventHandler{
|
|||
if (null == abstractActivity) {
|
||||
continue;
|
||||
}
|
||||
if(openActivityIds.contains(sGlobalActivity.getId()))
|
||||
if(openActivityIds.contains(sGlobalActivity.getId())) {
|
||||
continue;
|
||||
}
|
||||
abstractActivity.onActivityStart();
|
||||
openActivityIds.add(sGlobalActivity.getId());
|
||||
}
|
||||
|
@ -327,7 +320,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
public LuckWheelMission getLuckWheel(ActivityManager activityManager, int type) {
|
||||
LuckWheelMission luckWheelMission = type == ActivityType.LUCK_WHEEL ? activityManager.getLuckWheel() : activityManager.getLuckWheelAdvance();
|
||||
if (null == luckWheelMission) {
|
||||
String key = type == ActivityType.LUCK_WHEEL ? "luckWheel" : "luckWheelAdvance";
|
||||
// String key = type == ActivityType.LUCK_WHEEL ? "luckWheel" : "luckWheelAdvance";
|
||||
if (type == ActivityType.LUCK_WHEEL) {
|
||||
luckWheelMission = new LuckWheelMission();
|
||||
activityManager.setLuckWheel(luckWheelMission);
|
||||
|
@ -342,7 +335,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
public void initLuckWheel(ActivityManager activityManager,int type) {
|
||||
LuckWheelMission luckWheelMission = type == ActivityType.LUCK_WHEEL ? activityManager.getLuckWheel() : activityManager.getLuckWheelAdvance();
|
||||
if (null != luckWheelMission) {
|
||||
String key = type == ActivityType.LUCK_WHEEL ? "luckWheel" : "luckWheelAdvance";
|
||||
// String key = type == ActivityType.LUCK_WHEEL ? "luckWheel" : "luckWheelAdvance";
|
||||
if (type == ActivityType.LUCK_WHEEL) {
|
||||
activityManager.setLuckWheel(luckWheelMission);
|
||||
} else {
|
||||
|
@ -365,11 +358,10 @@ public class ActivityLogic implements IEventHandler{
|
|||
for (Integer openActivityId : openActivityIds) {
|
||||
SGlobalActivity sGlobalActivity = sGlobalActivityMap.get(openActivityId);
|
||||
int[] ifOpen = sGlobalActivity.getIfOpen();
|
||||
if(ifOpen!=null && ifOpen.length>0){
|
||||
if(ifOpen[0]==1){ //创角
|
||||
if(userCreateTime + ifOpen[1]*TimeUtils.ONE_DAY - now >0){
|
||||
continue;
|
||||
}
|
||||
//创角
|
||||
if(ifOpen!=null && ifOpen.length>0 && ifOpen[0]==1){
|
||||
if(userCreateTime + ifOpen[1]*TimeUtils.ONE_DAY > now){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ActivityMission activityMission = activityManager.getActivityMissionMap().get(openActivityId);
|
||||
|
@ -400,11 +392,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// if(!initOtherActivity(user, sGlobalActivity)){
|
||||
initAllActivityMission(activityManager.getActivityMissionMap(),openActivityId);
|
||||
// }
|
||||
|
||||
initAllActivityMission(activityManager.getActivityMissionMap(),openActivityId);
|
||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(openActivityId);
|
||||
if (null==abstractActivity) {
|
||||
continue;
|
||||
|
@ -425,15 +413,13 @@ public class ActivityLogic implements IEventHandler{
|
|||
int activityId = sGlobalActivity.getId();
|
||||
if (openActivityIds.contains(activityId)) {
|
||||
int[] ifOpen = sGlobalActivity.getIfOpen();
|
||||
if(ifOpen!=null && ifOpen.length>0){
|
||||
if(ifOpen[0]==1){ //创角
|
||||
if(userCreateTime + ifOpen[1]*TimeUtils.ONE_DAY - now >0){
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
if (ifOpen == null || ifOpen.length <= 0){
|
||||
continue;
|
||||
}
|
||||
if (ifOpen[0]!=1){
|
||||
continue;
|
||||
}
|
||||
if (userCreateTime + ifOpen[1]*TimeUtils.ONE_DAY > now){
|
||||
continue;
|
||||
}
|
||||
} else if (activityMissionMap.containsKey(activityId)) {
|
||||
|
@ -469,7 +455,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
// ReportUtil.onReportEvent(user, ReportEventEnum.JOIN_ACTIVITY.getType(),String.valueOf(activityId));
|
||||
abstractActivity.initActivity(user);
|
||||
// if(!initOtherActivity(user, sGlobalActivity)){
|
||||
initAllActivityMission(activityManager.getActivityMissionMap(),activityId);
|
||||
initAllActivityMission(activityManager.getActivityMissionMap(),activityId);
|
||||
//
|
||||
int activityOpenState = getActivityOpenState(user, activityId );
|
||||
abstractActivity.setOpenState(user,activityOpenState);
|
||||
|
@ -539,7 +525,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.LUCKWHEEL_POOL_INDICATION_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
public List<CommonProto.ActivityInfo> getActivityInfos(Map<Integer, ActivityMission> activityMissionMap, long createTime) {
|
||||
public List<CommonProto.ActivityInfo> getActivityInfos(Map<Integer, ActivityMission> activityMissionMap, long createTime) {
|
||||
Map<Integer, SGlobalActivity> sGlobalActivityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||
List<CommonProto.ActivityInfo> activityInfoList = new ArrayList<>(activityMissionMap.size());
|
||||
for (Map.Entry<Integer, ActivityMission> activityState : activityMissionMap.entrySet()) {
|
||||
|
@ -586,7 +572,6 @@ public class ActivityLogic implements IEventHandler{
|
|||
int endTime;
|
||||
if(sGlobalActivity.getGapTime()!=0){
|
||||
endTime = (int) (ToolsUtil.getEndTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),createTime, sGlobalActivity.getGapTime()) / 1000);
|
||||
|
||||
}else{
|
||||
endTime = (int) (ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),createTime, 2) / 1000);
|
||||
}
|
||||
|
@ -642,7 +627,8 @@ public class ActivityLogic implements IEventHandler{
|
|||
ActivityMission value = item.getValue();
|
||||
if (value.getOpenType() == 0) {
|
||||
value.setOpenType(1);
|
||||
} }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
|
@ -12,20 +13,20 @@ 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.logic.mission.main.CowFlySkyMissionType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SActivityRewardConfig;
|
||||
import config.SArroGantFly;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SGlobalActivity;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class CowFlySkyActivity extends AbstractActivity {
|
||||
|
||||
|
@ -35,6 +36,10 @@ public class CowFlySkyActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
boolean open = SGlobalActivity.checkActivityIfOpen(id, user.getPlayerInfoManager().getCreateTime(), GameApplication.serverConfig.getCacheOpenTime());
|
||||
if (!open){
|
||||
return;
|
||||
}
|
||||
ActivityMission mission = new ActivityMission();
|
||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
ArrayList<Integer> integers = new ArrayList<>(rewardConfigs.size());
|
||||
|
|
|
@ -2273,9 +2273,7 @@ public class HeroLogic{
|
|||
if (!bookEnabled.isEmpty()){
|
||||
Map<Integer, SSpiritAnimalBook> config = STableManager.getConfig(SSpiritAnimalBook.class);
|
||||
for(int bootId:bookEnabled){
|
||||
SSpiritAnimalBook animalBook=config.get(bootId);
|
||||
if (animalBook==null)continue;
|
||||
int[][] activePara = animalBook.getActivePara();
|
||||
int[][] activePara = Optional.ofNullable(config.get(bootId)).map(SSpiritAnimalBook::getActivePara).orElse(new int[0][]);
|
||||
combinedAttribute(activePara,heroAllAttribute);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.ljsd.jieling.logic.mission.data.BaseDataManager;
|
|||
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
||||
import com.ljsd.jieling.logic.mission.main.*;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import org.luaj.vm2.ast.Str;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
@ -60,10 +61,40 @@ public class MissionLoigc {
|
|||
getCowFlySkyMission(user,missionList);
|
||||
getEndlessMission(user,missionList);
|
||||
getMistyTripMission(user,missionList);
|
||||
// 此方法必须放在最后,对所有获取到的任务进行处理
|
||||
checkMissionTime(missionList);
|
||||
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_MISSION_RESPONSE_VALUE,build,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容,校验成就时间
|
||||
* @param missionList
|
||||
*/
|
||||
private static void checkMissionTime(List<CommonProto.UserMissionInfo> missionList){
|
||||
// 配置表
|
||||
Map<Integer, SAchievementConfig> config = STableManager.getConfig(SAchievementConfig.class);
|
||||
// 玩家当前任务
|
||||
Iterator<CommonProto.UserMissionInfo> iterator = missionList.iterator();
|
||||
// 开服时间
|
||||
long cacheOpenTime = GameApplication.serverConfig.getCacheOpenTime();
|
||||
// 遍历
|
||||
while (iterator.hasNext()){
|
||||
CommonProto.UserMissionInfo next = iterator.next();
|
||||
SAchievementConfig achievementConfig = config.get(next.getMissionId());
|
||||
// 配置表不存在的成就,可能删除了,代码去除
|
||||
if (achievementConfig == null){
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
long time = TimeUtils.stringToTimeLong(String.valueOf(achievementConfig.getEffectData()), TimeUtils.ymdFormat);
|
||||
// 表中配置的,time之前开服的不显示改任务
|
||||
if (cacheOpenTime < time){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void getBloodyMisison(User user, List<CommonProto.UserMissionInfo> missionList){
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
BloodyMissionIdsType bloodyMissionIdsType = userMissionManager.getBloodyMissionIdsType();
|
||||
|
|
|
@ -208,6 +208,7 @@ public class BuyGoodsNewLogic {
|
|||
info.setMaxSingleR(price);
|
||||
}
|
||||
info.setRr(MathUtils.doubleAdd(price,info.getRr()));
|
||||
info.setRechargeList(TimeUtils.now(),price);
|
||||
//处理月卡
|
||||
user.getPlayerInfoManager().getMonthCard();
|
||||
activeMonthCard(user,price,info);
|
||||
|
@ -810,18 +811,32 @@ public class BuyGoodsNewLogic {
|
|||
if(list == null){
|
||||
return;
|
||||
}
|
||||
Collections.sort(list, new Comparator<SPackPushConfig>(){
|
||||
@Override
|
||||
public int compare(SPackPushConfig o1, SPackPushConfig o2) {
|
||||
return Integer.compare(o1.getPriority(), o2.getPriority());
|
||||
}
|
||||
});
|
||||
int popup = 0;
|
||||
boolean push = false;
|
||||
for(SPackPushConfig con : list){
|
||||
int bagId = judgePushCondition(user,con);
|
||||
int conditionType=con.getConditionId()[0];
|
||||
int pushId=con.getId();
|
||||
if (con.getStatistics()>0&&info.getDayPushNum(pushId)>=con.getStatistics())continue;
|
||||
if (con.getCount()>0&&info.getAllPuthNum(pushId)>=con.getCount())continue;
|
||||
//条件成功
|
||||
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()){
|
||||
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()&& info.getTypePushTimeMap(conditionType) < System.currentTimeMillis()){
|
||||
popup = bagId;
|
||||
info.setNextPushTime(System.currentTimeMillis() + con.getcDTime() * TimeUtils.HOUR);
|
||||
info.setTypePushTimeMap(conditionType,System.currentTimeMillis() + con.getPrivateCD() * TimeUtils.HOUR);
|
||||
info.setDayPushNum(pushId,1);
|
||||
info.setAllPuthNum(pushId,1);
|
||||
boolean tempPush = createPushBag(bagId,user,num);
|
||||
if(!push){
|
||||
push = tempPush;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||
|
@ -861,12 +876,16 @@ public class BuyGoodsNewLogic {
|
|||
return -1;
|
||||
}
|
||||
}else if(scope[0] == 7){
|
||||
double mxr = user.getPlayerInfoManager().getNewRechargeInfo().getMaxSingleR();
|
||||
//此处根据需求改成指定天数内最大充值订单,之前的条件是历史充值最大订单
|
||||
//double mxr = user.getPlayerInfoManager().getNewRechargeInfo().getMaxSingleR();
|
||||
double mxr = user.getPlayerInfoManager().getNewRechargeInfo().GetSingleMaxRechargeNum(SSpecialConfig.getIntegerValue(SSpecialConfig.DAYS_FOR_RECHARGE_SINGLE));
|
||||
if(mxr < scope[1]){
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
double rr = user.getPlayerInfoManager().getNewRechargeInfo().getRr();
|
||||
//double rr = user.getPlayerInfoManager().getNewRechargeInfo().getRr();
|
||||
//此处根据需求改成指定天数累计充值,之前的条件是历史累计充值
|
||||
double rr = user.getPlayerInfoManager().getNewRechargeInfo().GetAllRechargeNum(SSpecialConfig.getIntegerValue(SSpecialConfig.DAYS_FOR_RECHARGE_SUM));
|
||||
int index = 0;
|
||||
for(int i = 1;i<con.getPersonas().length;i++){
|
||||
if(con.getPersonas()[i] > rr){
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.store.newRechargeInfo;
|
|||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.*;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -20,6 +21,8 @@ public class NewRechargeInfo extends MongoBase {
|
|||
private long firstTime;//首冲时间
|
||||
private int isDayFirst;
|
||||
|
||||
private Map<Long,Double>rechargeList=new HashMap<>();//充值记录
|
||||
|
||||
private Map<Integer,AbstractWelfareBag> perpetualMap = new HashMap<>();//永久礼包
|
||||
private Map<Integer,AbstractWelfareBag> timeLimitMap = new HashMap<>();//限时刷新礼包
|
||||
private Map<Integer,AbstractWelfareBag> receiveMap = new HashMap<>();//限时刷新礼包
|
||||
|
@ -30,6 +33,12 @@ public class NewRechargeInfo extends MongoBase {
|
|||
private int towerLost; //记录爬塔失败次数
|
||||
private long nextPushTime; //上次推送时间
|
||||
|
||||
private Map<Integer,Long>typePushTimeMap=new HashMap<>();//记录推送条件类型cd时间
|
||||
|
||||
private Map<Integer,Integer> dayPushNumMap =new HashMap<>();//记录当天推送次数
|
||||
|
||||
private Map<Integer,Integer> allPushNumMap =new HashMap<>();//记录历史推送次数
|
||||
|
||||
private long lastRefreshTime;
|
||||
public static int FIVESTARLIMIT = 2;//临时五星成长礼每天最多两次
|
||||
private Map<Integer,Integer> tempLimitMap = new HashMap<>();//五星成长礼每天购买次数
|
||||
|
@ -254,12 +263,60 @@ public class NewRechargeInfo extends MongoBase {
|
|||
public long getNextPushTime() {
|
||||
return nextPushTime;
|
||||
}
|
||||
|
||||
public void setNextPushTime(long nextPushTime) {
|
||||
this.nextPushTime = nextPushTime;
|
||||
updateString("nextPushTime",nextPushTime);
|
||||
}
|
||||
|
||||
public long getTypePushTimeMap(int pushType) {
|
||||
if (typePushTimeMap.containsKey(pushType)){
|
||||
return typePushTimeMap.get(pushType);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setTypePushTimeMap(int pushType,long nextPushTime) {
|
||||
this.typePushTimeMap.put(pushType,nextPushTime);
|
||||
updateString("typePushTimeMap."+pushType,nextPushTime);
|
||||
}
|
||||
|
||||
public int getDayPushNum(int pushId) {
|
||||
if (dayPushNumMap.containsKey(pushId)){
|
||||
return dayPushNumMap.get(pushId);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setDayPushNum(int pushId,int addNum) {
|
||||
int pushNum=addNum;
|
||||
if (dayPushNumMap.containsKey(pushId)){
|
||||
pushNum+= dayPushNumMap.get(pushId);
|
||||
}
|
||||
this.dayPushNumMap.put(pushId,pushNum);
|
||||
updateString("dayPushNumMap."+pushId,pushNum);
|
||||
}
|
||||
|
||||
public void ClearDayPushMap(){
|
||||
dayPushNumMap.clear();
|
||||
updateString("dayPushNumMap", dayPushNumMap);
|
||||
}
|
||||
|
||||
public int getAllPuthNum(int pushId) {
|
||||
if (allPushNumMap.containsKey(pushId)){
|
||||
return allPushNumMap.get(pushId);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setAllPuthNum(int pushId,int addNum) {
|
||||
int pushNum=addNum;
|
||||
if (allPushNumMap.containsKey(pushId)){
|
||||
pushNum+= allPushNumMap.get(pushId);
|
||||
}
|
||||
this.allPushNumMap.put(pushId,pushNum);
|
||||
updateString("allPushNumMap."+pushId,pushNum);
|
||||
}
|
||||
|
||||
public long getLastRefreshTime() {
|
||||
return lastRefreshTime;
|
||||
}
|
||||
|
@ -278,6 +335,41 @@ public class NewRechargeInfo extends MongoBase {
|
|||
updateString("maxSingleR",maxSingleR);
|
||||
}
|
||||
|
||||
public Map<Long, Double> getRechargeList() {
|
||||
return rechargeList;
|
||||
}
|
||||
|
||||
public void setRechargeList(long _rechargeTime,double _rechargePrice) {
|
||||
this.rechargeList.put(_rechargeTime,_rechargePrice);
|
||||
updateString("rechargeList",this.rechargeList);
|
||||
}
|
||||
|
||||
///获取指定天数内累计充值金额
|
||||
public double GetAllRechargeNum(int _deyNum){
|
||||
double rechargeNum=0;
|
||||
long limitTime= TimeUtils.now()-TimeUtils.ONE_DAY*_deyNum;
|
||||
for (Map.Entry<Long, Double> entry : rechargeList.entrySet()) {
|
||||
if (entry.getKey()>limitTime) {
|
||||
rechargeNum+=entry.getValue();
|
||||
}
|
||||
}
|
||||
return rechargeNum;
|
||||
}
|
||||
|
||||
///获取指定天数内单笔最大充值金额
|
||||
public double GetSingleMaxRechargeNum(int _deyNum){
|
||||
double rechargeNum=0;
|
||||
long limitTime= TimeUtils.now()-TimeUtils.ONE_DAY*_deyNum;
|
||||
for (Map.Entry<Long, Double> entry : rechargeList.entrySet()) {
|
||||
if (entry.getKey()>limitTime) {
|
||||
if (entry.getValue()>rechargeNum){
|
||||
rechargeNum=entry.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return rechargeNum;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTempLimitMap() {
|
||||
return tempLimitMap;
|
||||
}
|
||||
|
@ -285,4 +377,5 @@ public class NewRechargeInfo extends MongoBase {
|
|||
public void setTempLimitMap(Map<Integer, Integer> tempLimitMap) {
|
||||
this.tempLimitMap = tempLimitMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,11 +81,6 @@ public class SGlobalActivity implements BaseConfig {
|
|||
}
|
||||
sGlobalActivity.setStartTimeLong(Long.parseLong(startTime));
|
||||
sGlobalActivity.setEndTimeLong(Long.parseLong(endtime));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
sGlobalActivityMap = config;
|
||||
sGlobalActivityMapByType = sGlobalActivityMapByTypeTmp;
|
||||
|
@ -93,6 +88,60 @@ public class SGlobalActivity implements BaseConfig {
|
|||
sRechargeId2ActivityId = sRechargeId2ActivityIdTemp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验活动开启条件
|
||||
* @param activityId
|
||||
* @param value
|
||||
* 对应位置参数传0,表示不需要验证
|
||||
* 条件参数,第一位:创角时间
|
||||
* 第二位:开服时间
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkActivityIfOpen(int activityId, long... value){
|
||||
SGlobalActivity activity = sGlobalActivityMap.get(activityId);
|
||||
if (activity == null){
|
||||
return false;
|
||||
}
|
||||
// 开启条件
|
||||
int[] ifOpen = activity.getIfOpen();
|
||||
// 为空表示没有条件
|
||||
if (ifOpen == null || ifOpen.length <= 0){
|
||||
return true;
|
||||
}
|
||||
long now = TimeUtils.now();
|
||||
switch (ifOpen[0]){
|
||||
case 1:
|
||||
// 创角多少天后不开
|
||||
if (value[0] != 0 && value[0] + ifOpen[1]*TimeUtils.ONE_DAY > now){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// 开服后多少天不出现改活动
|
||||
if(value[1] != 0 && value[1] + ifOpen[1]*TimeUtils.ONE_DAY > now){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// 在某某时间之前开服不会出现
|
||||
long timeOpen3 = TimeUtils.stringToTimeLong(String.valueOf(ifOpen[1]), TimeUtils.ymdFormat);
|
||||
if (value[1] != 0 && value[1] < timeOpen3){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// 在某某时间之后开服不会出现
|
||||
long timeOpen4 = TimeUtils.stringToTimeLong(String.valueOf(ifOpen[1]), TimeUtils.ymdFormat);
|
||||
if (value[1] != 0 && value[1] > timeOpen4){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Map<Integer, SGlobalActivity> getsGlobalActivityMap() {
|
||||
return sGlobalActivityMap;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ public class SPackPushConfig implements BaseConfig {
|
|||
private int[] packs;
|
||||
private int statistics;
|
||||
|
||||
private int privateCD;
|
||||
|
||||
public static Map<Integer,SPackPushConfig> configMap;
|
||||
public static Map<Integer,Map<Integer,List<SPackPushConfig>>> conditionMap;
|
||||
|
||||
|
@ -66,79 +68,50 @@ public class SPackPushConfig implements BaseConfig {
|
|||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int[] getScopeId() {
|
||||
return scopeId;
|
||||
}
|
||||
|
||||
public void setScopeId(int[] scopeId) {
|
||||
this.scopeId = scopeId;
|
||||
}
|
||||
|
||||
public int[] getConditionId() {
|
||||
return conditionId;
|
||||
}
|
||||
|
||||
public void setConditionId(int[] conditionId) {
|
||||
this.conditionId = conditionId;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
public int getcDTime() {
|
||||
return cDTime;
|
||||
}
|
||||
|
||||
public void setcDTime(int cDTime) {
|
||||
this.cDTime = cDTime;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public int[] getPersonas() {
|
||||
return personas;
|
||||
}
|
||||
|
||||
public void setPersonas(int[] personas) {
|
||||
this.personas = personas;
|
||||
}
|
||||
|
||||
public int[] getPacks() {
|
||||
return packs;
|
||||
}
|
||||
|
||||
public void setPacks(int[] packs) {
|
||||
this.packs = packs;
|
||||
}
|
||||
|
||||
public int getStatistics() {
|
||||
return statistics;
|
||||
}
|
||||
|
||||
public void setStatistics(int statistics) {
|
||||
this.statistics = statistics;
|
||||
|
||||
public int getPrivateCD() {
|
||||
return privateCD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public class SSpecialConfig implements BaseConfig {
|
|||
|
||||
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
||||
public static final String LIKE_ABILITY = "LikeAbility";//好感度功能,每日赠予礼物次数上限
|
||||
public static final String DAYS_FOR_RECHARGE_SUM = "DaysForRechargeSum";//近期累计充值金额累计时长
|
||||
public static final String DAYS_FOR_RECHARGE_SINGLE = "DaysForRechargeSingle";//近期最大单笔充值金额累计时长
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue