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