战力排行榜
parent
e19da91240
commit
3eddd7610c
|
@ -32,6 +32,7 @@ import util.MathUtils;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -1098,6 +1099,14 @@ public class ActivityLogic {
|
|||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
|
||||
|
||||
public boolean getActivityStatusByType(User user,int type){
|
||||
List<SGlobalActivity> activities = SGlobalActivity.sGlobalActivityMapByType.get(type);
|
||||
if(activities.isEmpty()){
|
||||
return false;
|
||||
}else{
|
||||
Object[] objects = activities.stream().filter(n -> getActivityOpenState(user, n.getId()) != ActivityType.OPEN_STATE).toArray();
|
||||
return objects.length>0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
|
@ -176,6 +177,9 @@ public class HeroLogic {
|
|||
if(type==11&&heroManager.getFirstTenth()==0){
|
||||
heroManager.updateFirstTenth();
|
||||
}
|
||||
if(sLotterySetting.getLotteryType()==3&&!ActivityLogic.getInstance().getActivityStatusByType(user,sLotterySetting.getActivityId())){
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
//筛选卡池
|
||||
int pooId =0;
|
||||
int perCount = sLotterySetting.getPerCount();
|
||||
|
|
|
@ -24,6 +24,7 @@ public enum RankEnum {
|
|||
|
||||
static {
|
||||
rankMap = new HashMap<>();
|
||||
abstractRankMap = new HashMap<>();
|
||||
Arrays.stream(RankEnum.values()).forEach((rankEnum)->rankMap.put(rankEnum.getType(),rankEnum));
|
||||
}
|
||||
RankEnum(int type,String redisKey, BiFunction<Integer,String,AbstractRank> rankFunction){
|
||||
|
|
|
@ -4,6 +4,9 @@ import manager.STableManager;
|
|||
import manager.Table;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="GlobalActivity")
|
||||
|
@ -43,10 +46,15 @@ public class SGlobalActivity implements BaseConfig {
|
|||
|
||||
private int[] foreshow;
|
||||
|
||||
public static Map<Integer, List<SGlobalActivity>> sGlobalActivityMapByType;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sGlobalActivityMapByType = new HashMap<>();
|
||||
Map<Integer, SGlobalActivity> config = STableManager.getConfig(SGlobalActivity.class);
|
||||
for(SGlobalActivity sGlobalActivity : config.values()){
|
||||
sGlobalActivityMapByType.computeIfAbsent(sGlobalActivity.getType(),n->new ArrayList<>()).add(sGlobalActivity);
|
||||
int time = sGlobalActivity.getTime();
|
||||
String startTime = sGlobalActivity.getStartTime();
|
||||
String endtime = sGlobalActivity.getEndtime();
|
||||
|
|
|
@ -103,4 +103,8 @@ public class SLotterySetting implements BaseConfig {
|
|||
public int[][] getTenTimesMustGetBox() {
|
||||
return tenTimesMustGetBox;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue