天降礼包补充

master_ob2
PC-202302260912\Administrator 2023-06-28 18:54:30 +08:00
parent 99a484ba83
commit c5cd4fb8bd
4 changed files with 24 additions and 13 deletions

View File

@ -287,9 +287,8 @@ public class TimeUtils {
*
* @param time
* @return
* @throws ParseException
*/
public static long dateFormat2(String time) throws ParseException {
public static long dateFormat2(String time) {
return stringToTimeLong2(time);
}

View File

@ -77,6 +77,12 @@ public class GmSingleActivityLogic {
return map;
}
public GiftActivity getGmSingle(int activityId) {
MongoTemplate coreMonoTemplate = MongoUtil.getCoreMongoTemplate();
Query query = new Query(Criteria.where("_id").is(activityId));
return coreMonoTemplate.findOne(query, GiftActivity.class);
}
public List<GiftMission> findAllMission(int activityId) {
MongoTemplate coreMonoTemplate = MongoUtil.getCoreMongoTemplate();
Query query = new Query(Criteria.where("activityId").is(activityId));

View File

@ -644,7 +644,7 @@ public class PlayerManager extends MongoBase {
maxTime = nowInt + config.getContinueTime()[0];
}
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000L,0,0,true)/1000);
newVipInfo.setEffectTime((int)maxTime);
newVipInfo.setEffectTime(maxTime);
}
this.vipInfo.put(privilegeId,newVipInfo);
updateString("vipInfo", this.vipInfo);

View File

@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.store;
import com.ljsd.GameApplication;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.mongo.gmActivity.GiftActivity;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
@ -18,6 +19,7 @@ import com.ljsd.jieling.logic.activity.AbstractActivity;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
import com.ljsd.jieling.logic.activity.activityLogic.GmSingleActivityLogic;
import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.UserManager;
@ -652,11 +654,9 @@ public class BuyGoodsNewLogic {
}
RechargeHandler rechargeHandler = getRechargeHandler(config.getOtype());
AbstractWelfareBag bag = rechargeHandler.getBag(user, config.getId());
if (bag == null){
result = false;
break;
}
if (bag != null){
result = bag.getBuyTimes() >= 1;
}
break;
default:break;
}
@ -838,6 +838,16 @@ public class BuyGoodsNewLogic {
return null;
}
if (bag.getType() == RechargeType.gmSingle.getType()){
int activityId = Long.valueOf(bag.getStartTime()).intValue();
GiftActivity single = GmSingleActivityLogic.getInstance().getGmSingle(activityId);
if (single == null){
return null;
}
builder.setStartTime((int)(single.getStartTime()/1000));
builder.setEndTime((int)(single.getEndTime()/1000));
}
if(bag.getType() == RechargeType.perpetual.getType() && bag.getRefreshTime() > 0){
if (configById.getDailyUpdate() == 1) {
builder.setEndTime(((int) (TimeUtils.getTodayZero() / 1000)) + 86400);
@ -866,12 +876,8 @@ public class BuyGoodsNewLogic {
if (user == null) {
continue;
}
AyyncWorker ayyncWorker = new AyyncWorker(user, false, new AyncWorkerRunnable() {
@Override
public void work(User user) throws Exception {
sendGiftGooodsIndication(user.getId());
}
});
LOGGER.info("每秒钟坚持游戏内礼包缓存==================={}",value.getUid());
AyyncWorker ayyncWorker = new AyyncWorker(user, false, user1 -> sendGiftGooodsIndication(user1.getId()));
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
}
}