Merge branch 'online_1121' of http://60.1.1.230/backend/jieling_server into online_1121
commit
27d7504a0e
|
|
@ -65,6 +65,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
PlayerLogic.getInstance().sendDayilyMail(user,-1);
|
||||
QuestionLogic.getInstence().onLogin(user);
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
ActivityLogic.getInstance().flushForLogin(user,iSession);
|
||||
GlobalDataManaager.checkNeedReFlush(iSession,user,null);
|
||||
playerInfoManager.setLoginTime(TimeUtils.now());
|
||||
Map<Integer, Integer> guidePoints = playerInfoManager.getGuidePoints();
|
||||
|
|
@ -165,7 +166,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.build();
|
||||
try {
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||
ActivityLogic.getInstance().flushForLogin(user,iSession);
|
||||
|
||||
// DoFix.getInstance().loginFix(user);
|
||||
if(playerInfoManager.getIsdayFirst()==0){
|
||||
playerInfoManager.setIsdayFirst(1);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,10 @@ public class NewWelfareActivity extends AbstractActivity {
|
|||
return;
|
||||
}
|
||||
}
|
||||
for(ActivityProgressInfo activityProgressInfo : activityProgressInfoMap.values()){
|
||||
activityProgressInfo.setState(2);
|
||||
}
|
||||
List<SActivityRewardConfig> sActivityRewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
itemAttrs.add(sActivityRewardConfigs.get(0).getValues());
|
||||
itemAttrs.add(sActivityRewardConfigs.get(0).getReward());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,13 +191,13 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
|
||||
boolean isSpecial = false;
|
||||
|
||||
if(sLotterySetting.getOrderBoxPool()!=null && sLotterySetting.getOrderBoxPool().length>0){
|
||||
pooId = getOrderBoxPoolId(sLotterySetting);
|
||||
if(pooId == 0){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("pooId 0"));
|
||||
}
|
||||
isSpecial =true;
|
||||
|
||||
}
|
||||
|
||||
//检验消耗
|
||||
|
|
@ -240,28 +240,26 @@ public class HeroLogic{
|
|||
int j=0;
|
||||
for(int i=0;i<perCount;i++){
|
||||
randCount++;
|
||||
if(pooId == 0){
|
||||
pooId = getSpecialPoolByRandcount(type, randCount,poolCount);
|
||||
if(pooId==0){
|
||||
pooId = getPooId(sLotterySetting, pooId);
|
||||
poolCount++;
|
||||
int randomPoolId = pooId;
|
||||
int specialPoolId = getSpecialPoolByRandcount(sLotterySetting, randCount,poolCount);
|
||||
if(specialPoolId == 0){
|
||||
if(randomPoolId==0){
|
||||
randomPoolId = getPooId(sLotterySetting);
|
||||
}
|
||||
}else{
|
||||
randomPoolId =specialPoolId;
|
||||
}
|
||||
LOGGER.info("the uid={},the type={},the poolId={}",uid,type,pooId);
|
||||
totalCount++;
|
||||
SLotteryRewardConfig sLotteryRewardConfig = randomHeroByPoolId(pooId, totalCount, user.getPlayerInfoManager().getLevel());
|
||||
SLotteryRewardConfig sLotteryRewardConfig = randomHeroByPoolId(randomPoolId, totalCount, user.getPlayerInfoManager().getLevel());
|
||||
LOGGER.info("the uid={},the type={},the poolId={},reward={},poolCount={}",uid,type,randomPoolId,sLotteryRewardConfig.getId(),poolCount);
|
||||
if(sLotteryRewardConfig.getStar() == 1){
|
||||
poolCount=0;
|
||||
}else{
|
||||
poolCount++;
|
||||
}
|
||||
int[] reward =sLotteryRewardConfig.getReward();
|
||||
if(reward!=null){
|
||||
dropHeroAndItem[j++] = reward;
|
||||
}
|
||||
if(!isSpecial){
|
||||
pooId=0;
|
||||
}
|
||||
|
||||
}
|
||||
heroManager.updateRandPoolTypeCount(sLotterySetting.getMergePool(),poolCount);
|
||||
|
||||
|
|
@ -293,10 +291,17 @@ 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.getId();
|
||||
List<SLotterySpecialConfig> list = SLotterySpecialConfig.getLotterySpecialConfigListByType(1,id);
|
||||
boolean isMergePool = false;
|
||||
if (list == null) {
|
||||
return 0;
|
||||
list = SLotterySpecialConfig.getLotterySpecialConfigListByType(2,sLotterySetting.getMergePool());
|
||||
if(list == null){
|
||||
return 0;
|
||||
}
|
||||
isMergePool = true;
|
||||
|
||||
}
|
||||
int poolId = 0;
|
||||
for (SLotterySpecialConfig data : list) {
|
||||
|
|
@ -304,6 +309,9 @@ public class HeroLogic{
|
|||
poolId = data.getpool_id();
|
||||
break;
|
||||
}
|
||||
if(isMergePool){
|
||||
continue;
|
||||
}
|
||||
if (randCount % data.getCount() != 0) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -319,7 +327,7 @@ public class HeroLogic{
|
|||
return poolId;
|
||||
}
|
||||
|
||||
private int getPooId(SLotterySetting sLotterySetting, int pooId) throws Exception {
|
||||
private int getPooId(SLotterySetting sLotterySetting) throws Exception {
|
||||
int[][] diamondBoxContain = sLotterySetting.getDiamondBoxContain();
|
||||
int totalWeight = 0;
|
||||
for(int i=0;i<diamondBoxContain.length;i++){
|
||||
|
|
@ -332,11 +340,10 @@ public class HeroLogic{
|
|||
int[] poolWeightInfo = diamondBoxContain[i];
|
||||
weight += poolWeightInfo[1];
|
||||
if(randWeight<=weight){
|
||||
pooId = poolWeightInfo[0];
|
||||
break;
|
||||
return poolWeightInfo[0];
|
||||
}
|
||||
}
|
||||
return pooId;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getOrderBoxPoolId(SLotterySetting sLotterySetting) throws Exception {
|
||||
|
|
|
|||
|
|
@ -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