天降礼包补充
parent
99a484ba83
commit
c5cd4fb8bd
|
|
@ -287,9 +287,8 @@ public class TimeUtils {
|
||||||
*
|
*
|
||||||
* @param time
|
* @param time
|
||||||
* @return
|
* @return
|
||||||
* @throws ParseException
|
|
||||||
*/
|
*/
|
||||||
public static long dateFormat2(String time) throws ParseException {
|
public static long dateFormat2(String time) {
|
||||||
return stringToTimeLong2(time);
|
return stringToTimeLong2(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,12 @@ public class GmSingleActivityLogic {
|
||||||
return map;
|
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) {
|
public List<GiftMission> findAllMission(int activityId) {
|
||||||
MongoTemplate coreMonoTemplate = MongoUtil.getCoreMongoTemplate();
|
MongoTemplate coreMonoTemplate = MongoUtil.getCoreMongoTemplate();
|
||||||
Query query = new Query(Criteria.where("activityId").is(activityId));
|
Query query = new Query(Criteria.where("activityId").is(activityId));
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,7 @@ public class PlayerManager extends MongoBase {
|
||||||
maxTime = nowInt + config.getContinueTime()[0];
|
maxTime = nowInt + config.getContinueTime()[0];
|
||||||
}
|
}
|
||||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000L,0,0,true)/1000);
|
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000L,0,0,true)/1000);
|
||||||
newVipInfo.setEffectTime((int)maxTime);
|
newVipInfo.setEffectTime(maxTime);
|
||||||
}
|
}
|
||||||
this.vipInfo.put(privilegeId,newVipInfo);
|
this.vipInfo.put(privilegeId,newVipInfo);
|
||||||
updateString("vipInfo", this.vipInfo);
|
updateString("vipInfo", this.vipInfo);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.store;
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
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.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
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.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
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.activity.event.*;
|
||||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
|
@ -652,11 +654,9 @@ public class BuyGoodsNewLogic {
|
||||||
}
|
}
|
||||||
RechargeHandler rechargeHandler = getRechargeHandler(config.getOtype());
|
RechargeHandler rechargeHandler = getRechargeHandler(config.getOtype());
|
||||||
AbstractWelfareBag bag = rechargeHandler.getBag(user, config.getId());
|
AbstractWelfareBag bag = rechargeHandler.getBag(user, config.getId());
|
||||||
if (bag == null){
|
if (bag != null){
|
||||||
result = false;
|
result = bag.getBuyTimes() >= 1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
result = bag.getBuyTimes() >= 1;
|
|
||||||
break;
|
break;
|
||||||
default:break;
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
@ -838,6 +838,16 @@ public class BuyGoodsNewLogic {
|
||||||
return null;
|
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(bag.getType() == RechargeType.perpetual.getType() && bag.getRefreshTime() > 0){
|
||||||
if (configById.getDailyUpdate() == 1) {
|
if (configById.getDailyUpdate() == 1) {
|
||||||
builder.setEndTime(((int) (TimeUtils.getTodayZero() / 1000)) + 86400);
|
builder.setEndTime(((int) (TimeUtils.getTodayZero() / 1000)) + 86400);
|
||||||
|
|
@ -866,12 +876,8 @@ public class BuyGoodsNewLogic {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
AyyncWorker ayyncWorker = new AyyncWorker(user, false, new AyncWorkerRunnable() {
|
LOGGER.info("每秒钟坚持游戏内礼包缓存==================={}",value.getUid());
|
||||||
@Override
|
AyyncWorker ayyncWorker = new AyyncWorker(user, false, user1 -> sendGiftGooodsIndication(user1.getId()));
|
||||||
public void work(User user) throws Exception {
|
|
||||||
sendGiftGooodsIndication(user.getId());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue