Merge branch 'dh_dev_webpay' into master_test_gn_zf
commit
5adeaa9f4d
|
@ -126,7 +126,7 @@ public class GlobalDataManaager implements IManager {
|
||||||
if( limitDay[0] == 2 ){
|
if( limitDay[0] == 2 ){
|
||||||
//此时是开服第几天
|
//此时是开服第几天
|
||||||
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
||||||
if(day < limitDay[1]){
|
if(day <= limitDay[1]){
|
||||||
closeList.add(id);
|
closeList.add(id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -155,10 +155,10 @@ public class GlobalDataManaager implements IManager {
|
||||||
//开服几天后开启
|
//开服几天后开启
|
||||||
if(getServerOpenTimeCompareSpecialTimeResult()){
|
if(getServerOpenTimeCompareSpecialTimeResult()){
|
||||||
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
||||||
if(limitDay.length>0 && limitDay != null){
|
if(limitDay.length > 0){
|
||||||
if( limitDay[0] == 2 ){
|
if( limitDay[0] == 2 ){
|
||||||
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
||||||
if(day < limitDay[1]){
|
if(day <= limitDay[1]){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,11 +214,13 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
List<int[][]> itemArrs = new LinkedList<>();
|
List<int[][]> itemArrs = new LinkedList<>();
|
||||||
getAllMissRewards(user, session, itemArrs);
|
getAllMissRewards(user, session, itemArrs);
|
||||||
if (itemArrs.size() == 0)
|
if (itemArrs.size() == 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||||
if (null == sGlobalActivity)
|
if (null == sGlobalActivity) {
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
|
}
|
||||||
String title = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_title", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
String title = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_title", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
||||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_txt", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_txt", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
||||||
String mailReward = ItemUtil.getMailReward(itemArrs);
|
String mailReward = ItemUtil.getMailReward(itemArrs);
|
||||||
|
@ -308,8 +310,9 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
||||||
|
|
||||||
void onActivityEndSelfWithDealReward(User user) throws Exception {
|
void onActivityEndSelfWithDealReward(User user) throws Exception {
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||||
if (sGlobalActivity.getIsMail() == 1)
|
if (sGlobalActivity.getIsMail() == 1) {
|
||||||
onActivityEndDealReward(user);
|
onActivityEndDealReward(user);
|
||||||
|
}
|
||||||
onActivityEndOnMySelf(user);
|
onActivityEndOnMySelf(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,6 +339,15 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关闭的礼包
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Set<Integer> getCloseGoods(User user){
|
||||||
|
return new HashSet<>(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动结束邮件 有比较多的潜规则 单号1003747体现
|
* 活动结束邮件 有比较多的潜规则 单号1003747体现
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,8 +17,10 @@ import config.SGlobalActivity;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class HeroStarActivity extends AbstractActivity {
|
public class HeroStarActivity extends AbstractActivity {
|
||||||
private int heroId;
|
private int heroId;
|
||||||
|
@ -132,4 +134,26 @@ public class HeroStarActivity extends AbstractActivity {
|
||||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Integer> getCloseGoods(User user){
|
||||||
|
HashSet<Integer> set = new HashSet<>();
|
||||||
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
if (mission == null){
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
// 活动奖励条件
|
||||||
|
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||||
|
for (SActivityRewardConfig rewardConfig : rewardConfigs) {
|
||||||
|
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||||
|
ActivityProgressInfo progressInfo = map.get(rewardConfig.getId());
|
||||||
|
// 页签不存在或者状态不为可领取状态
|
||||||
|
if (progressInfo == null || progressInfo.getState() != 1){
|
||||||
|
int goodsId = rewardConfig.getValues()[2][0];
|
||||||
|
set.add(goodsId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,7 @@ import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class MistyTripActivity extends AbstractActivity {
|
public class MistyTripActivity extends AbstractActivity {
|
||||||
|
|
||||||
|
@ -115,5 +113,32 @@ public class MistyTripActivity extends AbstractActivity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Integer> getCloseGoods(User user){
|
||||||
|
HashSet<Integer> set = new HashSet<>();
|
||||||
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
if (mission == null){
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
// 活动详细配置
|
||||||
|
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||||
|
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||||
|
// 创角色第几天
|
||||||
|
int days = TimeUtils.getSoFarWentDays(user.getPlayerInfoManager().getCreateTime(), TimeUtils.now())+1;
|
||||||
|
for (SActivityRewardConfig config : rewardConfigs) {
|
||||||
|
// 单个页签信息
|
||||||
|
ActivityProgressInfo info = map.getOrDefault(config.getId(), null);
|
||||||
|
if (info == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int[][] values = config.getValues();
|
||||||
|
// 条件,天数和任务数量
|
||||||
|
if (days < values[0][1] || info.getProgrss() < values[0][0]){
|
||||||
|
set.add(values[1][0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ class RechargeSumDayActivity extends AbstractActivity {
|
||||||
/**
|
/**
|
||||||
* 根据配置解析数值进度完成度
|
* 根据配置解析数值进度完成度
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
boolean checkValue(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
boolean checkValue(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||||
int[][] values = sActivityRewardConfig.getValues();
|
int[][] values = sActivityRewardConfig.getValues();
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
|
|
@ -265,4 +265,27 @@ public class SuperBoxActivity extends AbstractActivity {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Integer> getCloseGoods(User user){
|
||||||
|
HashSet<Integer> set = new HashSet<>();
|
||||||
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
if (mission == null){
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
// 活动页签
|
||||||
|
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||||
|
Map<Integer, SSurpriseBox> boxMap = SSurpriseBox.map.get(id);
|
||||||
|
// 活动奖励条件
|
||||||
|
for (Map.Entry<Integer, ActivityProgressInfo> entry2 : map.entrySet()) {
|
||||||
|
if (entry2.getValue().getProgrss() != 1){
|
||||||
|
SSurpriseBox box = boxMap.getOrDefault(entry2.getKey(), null);
|
||||||
|
if (box == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
set.add(box.getPackId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,12 +48,6 @@ public class TreasureActivity extends AbstractActivity {
|
||||||
if(user.getPlayerInfoManager().getHadBuyTreasure() == 1){
|
if(user.getPlayerInfoManager().getHadBuyTreasure() == 1){
|
||||||
LOGGER.info("[青龙秘宝初始化] [重置秘宝解锁状态] [uid:{}]",user.getId());
|
LOGGER.info("[青龙秘宝初始化] [重置秘宝解锁状态] [uid:{}]",user.getId());
|
||||||
user.getPlayerInfoManager().setHadBuyTreasure(0);
|
user.getPlayerInfoManager().setHadBuyTreasure(0);
|
||||||
int id=0;
|
|
||||||
for(SRechargeCommodityNewConfig sRechargeCommodityConfig : SRechargeCommodityNewConfig.configMap.values()){
|
|
||||||
if(sRechargeCommodityConfig.getType() == GiftGoodsType.SUN_LONG){
|
|
||||||
id=sRechargeCommodityConfig.getId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||||
|
|
|
@ -11,17 +11,18 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
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.event.*;
|
import com.ljsd.jieling.logic.activity.event.*;
|
||||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.RechargeInfo;
|
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
|
||||||
import com.ljsd.jieling.logic.dao.VipInfo;
|
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||||
|
@ -636,26 +637,73 @@ public class BuyGoodsNewLogic {
|
||||||
public static Set<Integer> getGoodsBagInfoFromDelive(int uid) throws Exception {
|
public static Set<Integer> getGoodsBagInfoFromDelive(int uid) throws Exception {
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
Set<Integer> list = new HashSet<>();
|
Set<Integer> list = new HashSet<>();
|
||||||
|
// 礼包是否打开
|
||||||
NewRechargeInfo rechargeInfo = user.getPlayerInfoManager().getNewRechargeInfo();
|
NewRechargeInfo rechargeInfo = user.getPlayerInfoManager().getNewRechargeInfo();
|
||||||
for(AbstractWelfareBag bag : rechargeInfo.getPerpetualMap().values()){
|
Map<Integer, SRechargeCommodityNewConfig> configMap = SRechargeCommodityNewConfig.configMap;
|
||||||
|
// 次数,推送,永久礼包一起处理
|
||||||
|
ArrayList<AbstractWelfareBag> welfareBags = new ArrayList<>(rechargeInfo.getPerpetualMap().values());
|
||||||
|
welfareBags.addAll(rechargeInfo.getTimeLimitMap().values());
|
||||||
|
welfareBags.addAll(rechargeInfo.getReceiveMap().values());
|
||||||
|
welfareBags.addAll(rechargeInfo.getPushMap().values());
|
||||||
|
for (AbstractWelfareBag bag : welfareBags) {
|
||||||
if(bag.isOpen()){
|
if(bag.isOpen()){
|
||||||
list.add(bag.getModId());
|
if (bag.getLimit() == 0 || bag.getLimit() > bag.getBuyTimes()){
|
||||||
|
list.add(bag.getModId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(AbstractWelfareBag bag : rechargeInfo.getTimeLimitMap().values()){
|
|
||||||
if(bag.isOpen()){
|
// 走表判断开启的礼包
|
||||||
list.add(bag.getModId());
|
Map<Integer, SGlobalActivity> activityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||||
|
Map<Integer, ActivityMission> missionMap = user.getActivityManager().getActivityMissionMap();
|
||||||
|
|
||||||
|
for (Map.Entry<Integer, ActivityMission> entry : missionMap.entrySet()) {
|
||||||
|
int activityId = entry.getKey();
|
||||||
|
ActivityMission mission = entry.getValue();
|
||||||
|
// 遍历
|
||||||
|
Iterator<Integer> iterator = list.iterator();
|
||||||
|
while (iterator.hasNext()){
|
||||||
|
SRechargeCommodityNewConfig config = configMap.get(iterator.next());
|
||||||
|
// 表控制不显示
|
||||||
|
if (config.getIsShowInWeb() == 0){
|
||||||
|
iterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 未加入公会,不显示公会红包
|
||||||
|
if (user.getPlayerInfoManager().getGuildId() == 0 && config.getType() == 10){
|
||||||
|
iterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String[] open : config.getCondition()) {
|
||||||
|
// 活动未开启的礼包
|
||||||
|
if ("3".equals(open[0])){
|
||||||
|
if (mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||||
|
if (open[1].equals(String.valueOf(activityId))){
|
||||||
|
iterator.remove();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 功能未开启的表
|
||||||
|
if ("2".equals(open[0])){
|
||||||
|
if (!GlobalDataManaager.getInstance().checkIsOpen(Integer.parseInt(open[1]))){
|
||||||
|
iterator.remove();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// 单独活动信息处理
|
||||||
for(AbstractWelfareBag bag : rechargeInfo.getReceiveMap().values()){
|
SGlobalActivity activity = activityMap.get(activityId);
|
||||||
if(bag.isOpen()){
|
if (activity == null){
|
||||||
list.add(bag.getModId());
|
continue;
|
||||||
}
|
}
|
||||||
}
|
AbstractActivity activityType = ActivityTypeEnum.getActicityType(activityId);
|
||||||
for(AbstractWelfareBag bag : rechargeInfo.getPushMap().values()){
|
if (activityType == null || list.isEmpty()){
|
||||||
if(bag.isOpen()){
|
continue;
|
||||||
list.add(bag.getModId());
|
|
||||||
}
|
}
|
||||||
|
list.removeAll(activityType.getCloseGoods(user));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -750,7 +798,7 @@ public class BuyGoodsNewLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int judgePushCondition(User user,SPackPushConfig con){
|
private static int judgePushCondition(User user,SPackPushConfig con){
|
||||||
int[] scope = con.getScopeId();
|
int[] scope = con.getScopeId();
|
||||||
if(scope[0] == 1){//主线关卡
|
if(scope[0] == 1){//主线关卡
|
||||||
int mainLevel = user.getMainLevelManager().getFightId();
|
int mainLevel = user.getMainLevelManager().getFightId();
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
||||||
private String rechargeId9;
|
private String rechargeId9;
|
||||||
private String rechargeId10;
|
private String rechargeId10;
|
||||||
|
|
||||||
|
private int isShowInWeb;
|
||||||
|
|
||||||
private int[] forbid;
|
private int[] forbid;
|
||||||
|
|
||||||
|
@ -205,4 +205,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
||||||
this.condition = condition;
|
this.condition = condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIsShowInWeb() {
|
||||||
|
return isShowInWeb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue