二期推送需求修改提交
parent
92b027d90c
commit
bf0652a4ad
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -811,18 +811,31 @@ 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 (info.getDayPushNum(pushId)>=con.getStatistics()||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());
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.ljsd.jieling.logic.store.newRechargeInfo;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.fight.eventhandler.IFightEventProcesor;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.*;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -35,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<>();//五星成长礼每天购买次数
|
||||
|
@ -259,12 +263,59 @@ 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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue