back_recharge
parent
5203b5011e
commit
8807cc06ea
|
|
@ -234,7 +234,7 @@ public class HeroLogic {
|
|||
int j=0;
|
||||
for(int i=0;i<perCount;i++){
|
||||
randCount++;
|
||||
int specialPoolId = getSpecialPoolByRandcount(type, randCount,poolCount);
|
||||
int specialPoolId = getSpecialPoolByRandcount(sLotterySetting, randCount,poolCount);
|
||||
if(specialPoolId == 0){
|
||||
if(pooId==0){
|
||||
pooId = getPooId(sLotterySetting, pooId);
|
||||
|
|
@ -248,6 +248,7 @@ public class HeroLogic {
|
|||
if(sLotteryRewardConfig.getStar() == 1){
|
||||
poolCount=0;
|
||||
}else{
|
||||
|
||||
poolCount++;
|
||||
}
|
||||
int[] reward =sLotteryRewardConfig.getReward();
|
||||
|
|
@ -289,10 +290,15 @@ public class HeroLogic {
|
|||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
private int getSpecialPoolByRandcount(int type, int randCount,int poolCount) {
|
||||
List<SLotterySpecialConfig> list = SLotterySpecialConfig.getLotterySpecialConfigListByType(type);
|
||||
private int getSpecialPoolByRandcount(SLotterySetting sLotterySetting, int randCount,int poolCount) {
|
||||
int id = sLotterySetting.getLotteryType();
|
||||
List<SLotterySpecialConfig> list = SLotterySpecialConfig.getLotterySpecialConfigListByType(1,id);
|
||||
if (list == null) {
|
||||
return 0;
|
||||
list = SLotterySpecialConfig.getLotterySpecialConfigListByType(2,sLotterySetting.getMergePool());
|
||||
if(list == null){
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
int poolId = 0;
|
||||
for (SLotterySpecialConfig data : list) {
|
||||
|
|
|
|||
|
|
@ -26,25 +26,32 @@ public class SLotterySpecialConfig implements BaseConfig {
|
|||
private int pool_id;
|
||||
|
||||
|
||||
private static Map<Integer, List<SLotterySpecialConfig>> lotterySpecialConfigMap;
|
||||
private static Map<Integer, Map<Integer,List<SLotterySpecialConfig>>> lotterySpecialConfigMap;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SLotterySpecialConfig> config = STableManager.getConfig(SLotterySpecialConfig.class);
|
||||
Map<Integer, List<SLotterySpecialConfig>> lotterySpecialConfigMapTmp = new HashMap<>();
|
||||
Map<Integer, Map<Integer,List<SLotterySpecialConfig>>> lotterySpecialConfigMapTmp = new HashMap<>();
|
||||
for(SLotterySpecialConfig sLotterySpecialConfig : config.values()){
|
||||
int type = sLotterySpecialConfig.getType();
|
||||
if(!lotterySpecialConfigMapTmp.containsKey(type)){
|
||||
lotterySpecialConfigMapTmp.put(type,new ArrayList<>());
|
||||
int differentType = sLotterySpecialConfig.getDifferentType();
|
||||
if(!lotterySpecialConfigMapTmp.containsKey(differentType)){
|
||||
lotterySpecialConfigMapTmp.put(differentType,new HashMap<>());
|
||||
}
|
||||
lotterySpecialConfigMapTmp.get(type).add(sLotterySpecialConfig);
|
||||
int type = sLotterySpecialConfig.getType();
|
||||
if(!lotterySpecialConfigMapTmp.get(differentType).containsKey(type)){
|
||||
lotterySpecialConfigMapTmp.get(differentType).put(type,new ArrayList<>());
|
||||
}
|
||||
lotterySpecialConfigMapTmp.get(differentType).get(type).add(sLotterySpecialConfig);
|
||||
}
|
||||
lotterySpecialConfigMap = lotterySpecialConfigMapTmp;
|
||||
}
|
||||
|
||||
public static List<SLotterySpecialConfig> getLotterySpecialConfigListByType(int type) {
|
||||
return lotterySpecialConfigMap.get(type);
|
||||
public static List<SLotterySpecialConfig> getLotterySpecialConfigListByType(int differentType,int type) {
|
||||
if(!lotterySpecialConfigMap.containsKey(differentType)){
|
||||
return null;
|
||||
}
|
||||
return lotterySpecialConfigMap.get(differentType).get(type);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue