新礼包推送弹出

back_recharge
mengchengzhen 2021-04-27 22:28:08 +08:00
parent 32900d9aa9
commit 2cfe67afe4
1 changed files with 6 additions and 3 deletions

View File

@ -649,22 +649,25 @@ public class BuyGoodsNewLogic {
if(list == null){
return;
}
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);
initUnitWF(user,config);
}
}
List<Integer> pushList = info.getPushList();
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
getGoodsBagInfo(user.getId(), goodsBagInfo);
PlayerInfoProto.AllGiftGoodsIndication goodsBuild = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE, goodsBuild, true);
PlayerInfoProto.PushWelfareResponse pushWelfareResponse = PlayerInfoProto.PushWelfareResponse.newBuilder().addAllId(pushList).build();
if(popup != 0){
PlayerInfoProto.PushWelfareResponse pushWelfareResponse = PlayerInfoProto.PushWelfareResponse.newBuilder().addId(popup).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.PUSH_WELFARE_RESPONSE.getNumber(), pushWelfareResponse, true);
}
}
private static int judgePushCondition(User user,SPackPushConfig con){
int[] scope = con.getScopeId();