新礼包五星推送
parent
1a1476fdf7
commit
76abb2383a
|
@ -666,14 +666,11 @@ public class BuyGoodsNewLogic {
|
|||
int popup = 0;
|
||||
for(SPackPushConfig con : list){
|
||||
int bagId = judgePushCondition(user,con);
|
||||
//条件成功
|
||||
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()){
|
||||
popup = bagId;
|
||||
info.setNextPushTime(System.currentTimeMillis() + con.getcDTime() * TimeUtils.HOUR);
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(bagId);
|
||||
AbstractWelfareBag bag = initUnitWF(user,config);
|
||||
if(num != 0 && num > info.getTEMP_LIMIT()){
|
||||
bag.setLimit(info.getTEMP_LIMIT());
|
||||
}
|
||||
createPushBag(bagId,user,num);
|
||||
}
|
||||
}
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||
|
@ -681,7 +678,7 @@ public class BuyGoodsNewLogic {
|
|||
PlayerInfoProto.AllGiftGoodsIndication goodsBuild = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE, goodsBuild, true);
|
||||
if(popup != 0){
|
||||
if(popup == 21 || popup == 400 || popup == 401 || popup == 402 ){
|
||||
if(isFiveStarBag(popup)){
|
||||
if(info.getTEMP_LIMIT()>0){
|
||||
info.setTEMP_LIMIT(info.getTEMP_LIMIT() - 1);
|
||||
PlayerInfoProto.PushWelfareResponse pushWelfareResponse = PlayerInfoProto.PushWelfareResponse.newBuilder().addId(popup).build();
|
||||
|
@ -812,4 +809,28 @@ public class BuyGoodsNewLogic {
|
|||
info.setLastRefreshTime(System.currentTimeMillis());
|
||||
info.setTEMP_LIMIT(2);
|
||||
}
|
||||
|
||||
//是否属于五星成长礼
|
||||
public static boolean isFiveStarBag(int id){
|
||||
if(id == 21 || id == 400 || id == 401 || id == 402 ){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void createPushBag(int bagId,User user,int num){
|
||||
NewRechargeInfo info = user.getPlayerInfoManager().getNewRechargeInfo();
|
||||
if(isFiveStarBag(bagId) && info.getPushMap().get(bagId) != null){
|
||||
AbstractWelfareBag bag = info.getPushMap().get(bagId);
|
||||
bag.setLimit((bag.getLimit()+num)>info.getTEMP_LIMIT()?info.getTEMP_LIMIT():(bag.getLimit()+num));
|
||||
}else{
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(bagId);
|
||||
AbstractWelfareBag bag = initUnitWF(user,config);
|
||||
if(num != 0 && num > info.getTEMP_LIMIT()){
|
||||
bag.setLimit(info.getTEMP_LIMIT());
|
||||
}else{
|
||||
bag.setLimit(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue