等级校验添加

back_recharge
lvxinran 2020-10-19 14:01:14 +08:00
parent 674e421e27
commit 7abd3c2dba
1 changed files with 6 additions and 2 deletions

View File

@ -41,7 +41,12 @@ public class JourneyMap {
public final static JourneyMap instance = new JourneyMap(); public final static JourneyMap instance = new JourneyMap();
} }
public static void init(User user,int mapId){ public static void init(User user,int mapId) throws ErrorCodeException {
//等级校验
SFreeTravel travelConfig = SFreeTravel.journeyMapByMapId.get(mapId);
if(travelConfig.getUnlockLevel()==-1||user.getPlayerInfoManager().getLevel()<travelConfig.getUnlockLevel()){
throw new ErrorCodeException(ErrorCode.PLAYER_LEVE_NOT);
}
Path[] paths ; Path[] paths ;
Map<Integer,SCMap> scMap = SCMap.sCMap.get(mapId); Map<Integer,SCMap> scMap = SCMap.sCMap.get(mapId);
Map<Integer, SCMap> point = new HashMap<>(); Map<Integer, SCMap> point = new HashMap<>();
@ -68,7 +73,6 @@ public class JourneyMap {
} }
} }
int[][] tempArray = SFreeTravel.journeyMapByMapId.get(mapId).getAdventureNumber(); int[][] tempArray = SFreeTravel.journeyMapByMapId.get(mapId).getAdventureNumber();
SFreeTravel travelConfig = SFreeTravel.journeyMapByMapId.get(mapId);
for(int[] array:tempArray){ for(int[] array:tempArray){
if(!randomPoint.containsKey(array[0])){ if(!randomPoint.containsKey(array[0])){
continue; continue;