diff options
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/validate_config.rb | 29 |
1 files changed, 28 insertions, 1 deletions
| diff --git a/utils/validate_config.rb b/utils/validate_config.rb index 3ac49dc..96ed9fc 100644 --- a/utils/validate_config.rb +++ b/utils/validate_config.rb | |||
| @@ -8,7 +8,8 @@ require 'set' | |||
| 8 | require 'yaml' | 8 | require 'yaml' |
| 9 | 9 | ||
| 10 | configpath = ARGV[0] | 10 | configpath = ARGV[0] |
| 11 | mappath = ARGV[1] | 11 | idspath = ARGV[1] |
| 12 | mappath = ARGV[2] | ||
| 12 | 13 | ||
| 13 | panels = Set["Countdown Panels/Panel_1234567890_wanderlust"] | 14 | panels = Set["Countdown Panels/Panel_1234567890_wanderlust"] |
| 14 | doors = Set["Naps Room Doors/Door_hider_new1", "Tower Room Area Doors/Door_wanderer_entrance"] | 15 | doors = Set["Naps Room Doors/Door_hider_new1", "Tower Room Area Doors/Door_wanderer_entrance"] |
| @@ -46,6 +47,8 @@ painting_directives = Set["id", "enter_only", "exit_only", "orientation", "requi | |||
| 46 | 47 | ||
| 47 | non_counting = 0 | 48 | non_counting = 0 |
| 48 | 49 | ||
| 50 | ids = YAML.load_file(idspath) | ||
| 51 | |||
| 49 | config = YAML.load_file(configpath) | 52 | config = YAML.load_file(configpath) |
| 50 | config.each do |room_name, room| | 53 | config.each do |room_name, room| |
| 51 | configured_rooms.add(room_name) | 54 | configured_rooms.add(room_name) |
| @@ -162,6 +165,10 @@ config.each do |room_name, room| | |||
| 162 | unless bad_subdirectives.empty? then | 165 | unless bad_subdirectives.empty? then |
| 163 | puts "#{room_name} - #{panel_name} :::: Panel has the following invalid subdirectives: #{bad_subdirectives.join(", ")}" | 166 | puts "#{room_name} - #{panel_name} :::: Panel has the following invalid subdirectives: #{bad_subdirectives.join(", ")}" |
| 164 | end | 167 | end |
| 168 | |||
| 169 | unless ids.include?("panels") and ids["panels"].include?(room_name) and ids["panels"][room_name].include?(panel_name) | ||
| 170 | puts "#{room_name} - #{panel_name} :::: Panel is missing a location ID" | ||
| 171 | end | ||
| 165 | end | 172 | end |
| 166 | 173 | ||
| 167 | (room["doors"] || {}).each do |door_name, door| | 174 | (room["doors"] || {}).each do |door_name, door| |
| @@ -229,6 +236,18 @@ config.each do |room_name, room| | |||
| 229 | unless bad_subdirectives.empty? then | 236 | unless bad_subdirectives.empty? then |
| 230 | puts "#{room_name} - #{door_name} :::: Door has the following invalid subdirectives: #{bad_subdirectives.join(", ")}" | 237 | puts "#{room_name} - #{door_name} :::: Door has the following invalid subdirectives: #{bad_subdirectives.join(", ")}" |
| 231 | end | 238 | end |
| 239 | |||
| 240 | unless door["skip_item"] or door["event"] | ||
| 241 | unless ids.include?("doors") and ids["doors"].include?(room_name) and ids["doors"][room_name].include?(door_name) and ids["doors"][room_name][door_name].include?("item") | ||
| 242 | puts "#{room_name} - #{door_name} :::: Door is missing an item ID" | ||
| 243 | end | ||
| 244 | end | ||
| 245 | |||
| 246 | unless door["skip_location"] or door["event"] | ||
| 247 | unless ids.include?("doors") and ids["doors"].include?(room_name) and ids["doors"][room_name].include?(door_name) and ids["doors"][room_name][door_name].include?("location") | ||
| 248 | puts "#{room_name} - #{door_name} :::: Door is missing a location ID" | ||
| 249 | end | ||
| 250 | end | ||
| 232 | end | 251 | end |
| 233 | 252 | ||
| 234 | (room["paintings"] || []).each do |painting| | 253 | (room["paintings"] || []).each do |painting| |
| @@ -281,6 +300,10 @@ config.each do |room_name, room| | |||
| 281 | mentioned_doors.add("#{room_name} - #{door}") | 300 | mentioned_doors.add("#{room_name} - #{door}") |
| 282 | end | 301 | end |
| 283 | end | 302 | end |
| 303 | |||
| 304 | unless ids.include?("progression") and ids["progression"].include?(progression_name) | ||
| 305 | puts "#{room_name} - #{progression_name} :::: Progression is missing an item ID" | ||
| 306 | end | ||
| 284 | end | 307 | end |
| 285 | end | 308 | end |
| 286 | 309 | ||
| @@ -303,6 +326,10 @@ door_groups.each do |group,num| | |||
| 303 | if num == 1 then | 326 | if num == 1 then |
| 304 | puts "Door group \"#{group}\" only has one door in it" | 327 | puts "Door group \"#{group}\" only has one door in it" |
| 305 | end | 328 | end |
| 329 | |||
| 330 | unless ids.include?("door_groups") and ids["door_groups"].include?(group) | ||
| 331 | puts "#{group} :::: Door group is missing an item ID" | ||
| 332 | end | ||
| 306 | end | 333 | end |
| 307 | 334 | ||
| 308 | slashed_rooms = configured_rooms.select do |room| | 335 | slashed_rooms = configured_rooms.select do |room| |
