增加法宝聚灵抽,增加每周固定日期推送礼包

master_yuenan
DESKTOP-C3M45P4\dengdan 2025-11-11 15:06:47 +08:00
parent dee16fd384
commit 63b2d8730a
8 changed files with 99 additions and 1 deletions

View File

@ -47,6 +47,12 @@ public class DesireDrawCardHandler extends BaseHandler<PlayerInfoProto.DesireDra
playerManager.putDesireDraw(type, tempId);
}
break;
case 15: //法宝聚灵心愿
Set<Integer> trumpList = ActivityLogic.getInstance().getDesireOpenTrumpList();
if (trumpList.contains(tempId) || tempId == 0){
playerManager.putDesireDraw(type, tempId);
}
break;
default:
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
}

View File

@ -98,6 +98,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
long haveTime = now - openTime;
int nowDay = (int)(haveTime/TimeUtils.ONE_DAY) + 1;
BuyGoodsNewLogic.openPush(iSession, user, PushRechargeType.OPEN_DAY.getType(),nowDay);
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
BuyGoodsNewLogic.openPush(iSession, user, PushRechargeType.WEEK_DAY.getType(),w);
playerInfoManager.setLoginTime(now);
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
Map<Integer, Integer> guidePoints = playerInfoManager.getGuidePoints();

View File

@ -41,6 +41,10 @@ public class GetWishDrawCardInfoHandler extends BaseHandler<PlayerInfoProto.choi
set = ActivityLogic.getInstance().getDesireOpenFabaoList();
tmpId = user.getPlayerInfoManager().getDesireDraw().getOrDefault(type, 0);
break;
case 15://法宝聚灵卡池
set = ActivityLogic.getInstance().getDesireOpenFabaoList();
tmpId = user.getPlayerInfoManager().getDesireDraw().getOrDefault(type, 0);
break;
default:
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
}

View File

@ -509,6 +509,11 @@ public class GlobalDataManaager implements IManager {
//刷新推送礼包
int nowDay = GameApplication.serverConfig.getServerOpenDay(TimeUtils.now());
BuyGoodsNewLogic.openPush(session, user, PushRechargeType.OPEN_DAY.getType(),nowDay);
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
BuyGoodsNewLogic.openPush(session, user, PushRechargeType.WEEK_DAY.getType(),w);
flag = true;
}
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());

View File

@ -2002,6 +2002,26 @@ public class ActivityLogic implements IEventHandler{
// 当前时间戳
long now = TimeUtils.now();
Map<Integer, STrumpLottery> map = STrumpLottery.map;
for (STrumpLottery lottery : map.values()) {
long start = TimeUtils.stringToTimeLong(lottery.getStartTime(), TimeUtils.Stand_CeHua_Data_format);
long end = TimeUtils.stringToTimeLong(lottery.getEndtime(), TimeUtils.Stand_CeHua_Data_format);
if (now >= start && now < end){
result = Arrays.stream(lottery.getDrop()).boxed().collect(Collectors.toSet());
break;
}
}
return result;
}
/**
*
*/
public Set<Integer> getDesireOpenTrumpList() {
Set<Integer> result = new HashSet<>();
// 当前时间戳
long now = TimeUtils.now();
Map<Integer, SEquipTalismanaLottery> map = SEquipTalismanaLottery.map;
for (SEquipTalismanaLottery lottery : map.values()) {
long start = TimeUtils.stringToTimeLong(lottery.getStartTime(), TimeUtils.Stand_CeHua_Data_format);

View File

@ -1025,7 +1025,8 @@ public class BuyGoodsNewLogic {
type == PushRechargeType.XUNAXIAN_ZHOAHUAN.getType() ||
type == PushRechargeType.XIANDOU_ZHOAHUAN.getType() ||
type == PushRechargeType.QIANNENG_UP.getType()||
type == PushRechargeType.OPEN_DAY.getType()){
type == PushRechargeType.OPEN_DAY.getType()||
type == PushRechargeType.WEEK_DAY.getType()){
int[] bagIds = judgePushConditionMulti(user,con,true);
// todo DayPushNum和AllPuthNum可以放到redis里操作
if (statistics >0 && info.getDayPushNum(pushId)>= statistics && count > 0 && info.getAllPuthNum(pushId)>= count){
@ -1180,6 +1181,16 @@ public class BuyGoodsNewLogic {
return false;
}
break;
case 21://每周指定日期礼包
int dayOfWeek = condition[1];
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
if(w != dayOfWeek){
return false;
}
break;
default:break;
}
return true;

View File

@ -45,6 +45,8 @@ public enum PushRechargeType {
QIANNENG_UP(19),
//开服天数
OPEN_DAY(20),
//每周指定天数
WEEK_DAY(21),
;
private int type;

View File

@ -0,0 +1,45 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="TrumpLottery")
public class STrumpLottery implements BaseConfig {
private int id;
private int[] drop;
private String startTime;
private String endtime;
public static Map<Integer, STrumpLottery> map = new HashMap<>();
@Override
public void init() throws Exception {
map = STableManager.getConfig(STrumpLottery.class);
}
public int getId() {
return id;
}
public int[] getDrop() {
return drop;
}
public String getStartTime() {
return startTime;
}
public String getEndtime() {
return endtime;
}
}