秘盒 增加今日抽取次数限制
parent
329746439d
commit
e68ea3591e
|
@ -302,6 +302,7 @@ public class ActivityLogic {
|
|||
|
||||
public void flushSecretBox( SecretBoxManager secretBoxManager){
|
||||
secretBoxManager.setCount(0);
|
||||
secretBoxManager.setDayCount(0);
|
||||
secretBoxManager.setCurSeason(secretBoxSeasonTimes);
|
||||
List<Integer> idsBySeasonId = SDifferDemonsBoxSetting.getIdsBySeasonId(secretBoxSeasonTimes);
|
||||
Map<Integer,Integer> freeUseMap = new HashMap<>(idsBySeasonId.size());
|
||||
|
@ -320,6 +321,11 @@ public class ActivityLogic {
|
|||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SECRETBOX_RANDOM_RESPONSE_VALUE,"activity_close");
|
||||
return;
|
||||
}
|
||||
int randCount = sDifferDemonsBoxSetting.getSecondaryCost();
|
||||
if(secretBoxManager.getDayCount() + randCount > sDifferDemonsBoxSetting.getMaxNum()){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SECRETBOX_RANDOM_RESPONSE_VALUE,"今日抽取已达上限");
|
||||
return;
|
||||
}
|
||||
int freeTime = sDifferDemonsBoxSetting.getFreeTime();
|
||||
Map<Integer, Integer> freeUseInfos = secretBoxManager.getFreeUseInfos();
|
||||
if(freeTime>freeUseInfos.get(id)){
|
||||
|
@ -333,7 +339,7 @@ public class ActivityLogic {
|
|||
return;
|
||||
}
|
||||
}
|
||||
int randCount = sDifferDemonsBoxSetting.getSecondaryCost();
|
||||
|
||||
int count = secretBoxManager.getCount();
|
||||
int[][] randDrop = new int[randCount][];
|
||||
for(int i=0;i<randCount;i++){
|
||||
|
@ -341,7 +347,7 @@ public class ActivityLogic {
|
|||
int[] dropInfos = getSecretBoxRewardByPool(secretBoxRandomPool);
|
||||
randDrop[i] = dropInfos;
|
||||
}
|
||||
|
||||
secretBoxManager.setDayCount(secretBoxManager.getDayCount()+randCount);
|
||||
secretBoxManager.setCount(secretBoxManager.getCount()+randCount);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, randDrop);
|
||||
int[] extraItem = sDifferDemonsBoxSetting.getExtraItem();
|
||||
|
@ -408,6 +414,7 @@ public class ActivityLogic {
|
|||
freeUseInfos.put(key,0);
|
||||
}
|
||||
}
|
||||
secretBoxManager.setDayCount(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue