修改每日特惠礼包购买逻辑
parent
280816adb6
commit
16274993ce
|
|
@ -336,9 +336,9 @@ public class BuyGoodsNewLogic {
|
|||
bag.buy();
|
||||
int[] forbid = config.getForbid();
|
||||
if(forbid != null){
|
||||
//每日礼包一键购买之后,把所有单个的每日礼包的购买次数加一
|
||||
//每日礼包一键购买之后,把所有单个的每日礼包的购买次数加一(最新版本有限购大于1的礼包,把礼包数量直接加99)
|
||||
for (int gId : forbid) {
|
||||
rechargeHandler.getBag(user, gId).addBuyTimes(1);
|
||||
rechargeHandler.getBag(user, gId).addBuyTimes(99);
|
||||
}
|
||||
}
|
||||
//处理特权
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="BecomeAGodSetting")
|
||||
|
|
@ -21,13 +23,54 @@ public class SBecomeAGodSetting implements BaseConfig {
|
|||
|
||||
public static Map<Integer, SBecomeAGodSetting> map = new HashMap<>();
|
||||
public static Map<Integer, SBecomeAGodSetting> typeMap = new HashMap<>();
|
||||
//按照六道类型和阶数存储的累积属性库id集合
|
||||
public static Map<Integer,Map<Integer, List<Integer>>> propMap = new HashMap<>();
|
||||
//按塔的层数存储的对应阶数属性库集合
|
||||
public static Map<Integer,Integer> towerPropMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SBecomeAGodSetting.class);
|
||||
Map<Integer,Map<Integer, List<Integer>>> _propMap = new HashMap<>();
|
||||
Map<Integer,Integer> _towerPropMap = new HashMap<>();
|
||||
for(SBecomeAGodSetting config : map.values()){
|
||||
typeMap.put(config.getType(),config);
|
||||
int[] floor = config.getFloor();
|
||||
int[] propertyGit = config.getPropertyGit();
|
||||
if(floor == null || floor.length == 0){
|
||||
continue;
|
||||
}
|
||||
Map<Integer, List<Integer>> map = new HashMap<>();
|
||||
int maxNum = 0;
|
||||
if(propertyGit!= null && propertyGit.length > 0){
|
||||
for(int i = 0;i<floor.length;i++) {
|
||||
int num = floor[i];
|
||||
if(maxNum < num){
|
||||
maxNum = num;
|
||||
}
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for(int j= 0;j<propertyGit.length;j++){
|
||||
//每次都要把之前的库id加上,统计的是累积的库id
|
||||
if(j<=i){
|
||||
int propertyId = propertyGit[j];
|
||||
list.add(propertyId);
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
map.put(i,list);
|
||||
}
|
||||
}
|
||||
//做个容错处理,假如策划配错了,最大层数超过1w,按1w算
|
||||
if(maxNum > 10000){
|
||||
maxNum = 10000;
|
||||
}
|
||||
for(int i=0;i<=maxNum;i++){
|
||||
|
||||
}
|
||||
_propMap.put(type,map);
|
||||
}
|
||||
propMap = _propMap;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue