牛气冲天活动bug修改

back_recharge
duhui 2022-09-06 13:45:24 +08:00
parent 0579b663eb
commit bfdd43d6bd
3 changed files with 31 additions and 11 deletions

View File

@ -243,8 +243,9 @@ public class UserMissionManager extends MongoBase {
break;
case COW_FLY_SKY_REFRESH:
int activityCowId = (int) parm[0];
// 牛气冲天
Set<Integer> arro = STableManager.getConfig(SArroGantFly.class).keySet();
Set<Integer> arro = SArroGantFly.getActivityMap().getOrDefault(activityCowId, new HashMap<>()).keySet();
cowFlySkyMissionType.getDoingMissionIds().clear();
cowFlySkyMissionType.getFinishMissionIds().clear();
cowFlySkyMissionType.getRewardedMissionIds().clear();

View File

@ -34,11 +34,11 @@ public class CowFlySkyMissionType extends AbstractMissionType {
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) throws Exception {
// 进行中得任务
Set<Integer> doingMissionIds = getDoingMissionIds();
List<SArroGantFly> flyList = SArroGantFly.getMap().get(result.subType.getMissionTypeValue());
if (flyList == null){
Collection<SArroGantFly> values = SArroGantFly.getTaskTypeMap().get(result.subType.getMissionTypeValue()).values();
if (values == null || values.isEmpty()){
return;
}
for (SArroGantFly fly : flyList) {
for (SArroGantFly fly : values) {
// 任务子id
int id = fly.getId();
// 不在执行中

View File

@ -21,20 +21,39 @@ public class SArroGantFly implements BaseConfig {
private int[][] reward;
private static Map<Integer, List<SArroGantFly>> map = new HashMap<>();
// key活动id
private static Map<Integer, Map<Integer,SArroGantFly>> activityMap = new HashMap<>();
// key: 任务类型
private static Map<Integer, Map<Integer,SArroGantFly>> taskTypeMap = new HashMap<>();
@Override
public void init() throws Exception {
Map<Integer, SArroGantFly> config = STableManager.getConfig(SArroGantFly.class);
HashMap<Integer, Map<Integer,SArroGantFly>> map1 = new HashMap<>();
HashMap<Integer, Map<Integer,SArroGantFly>> map2 = new HashMap<>();
for (SArroGantFly value : config.values()) {
List<SArroGantFly> flyList = map.getOrDefault(value.getValues(), new ArrayList<>());
flyList.add(value);
map.put(value.getValues(),flyList);
// 活动id
Map<Integer, SArroGantFly> flyMap = map1.getOrDefault(value.getActivityId(), new HashMap<>());
flyMap.put(value.getId(),value);
map1.put(value.getActivityId(),flyMap);
// 任务类型
Map<Integer, SArroGantFly> flyMap2 = map2.getOrDefault(value.getValues(), new HashMap<>());
flyMap2.put(value.getId(),value);
map2.put(value.getValues(),flyMap2);
}
activityMap.clear();
activityMap = map1;
taskTypeMap.clear();
taskTypeMap = map2;
}
public static Map<Integer, List<SArroGantFly>> getMap() {
return map;
public static Map<Integer, Map<Integer,SArroGantFly>> getActivityMap() {
return activityMap;
}
public static Map<Integer, Map<Integer, SArroGantFly>> getTaskTypeMap() {
return taskTypeMap;
}
public int getId() {