From d602a4772d2c1ae3cd5bab46f7c2dc18fafee97c Mon Sep 17 00:00:00 2001 From: phkb Date: Wed, 8 Jul 2026 14:13:55 +1000 Subject: [PATCH] Updates to plist and schemas to improve quality of verifier process --- Resources/Config/verifyOXP.plist | 297 +++++------ Resources/Schemata/demoshipsSchema.plist | 8 +- Resources/Schemata/hudSchema.plist | 190 +++---- Resources/Schemata/plistschema.plist | 449 +++++++--------- Resources/Schemata/shipdataEntrySchema.plist | 503 +++++++----------- Resources/Schemata/shipyardSchema.plist | 76 ++- .../OOCheckEquipmentPListVerifierStage.m | 2 +- .../OOCheckJSSyntaxVerifierStage.m | 16 +- .../OOCheckPListSyntaxVerifierStage.m | 3 + 9 files changed, 637 insertions(+), 907 deletions(-) diff --git a/Resources/Config/verifyOXP.plist b/Resources/Config/verifyOXP.plist index e89187489..08f5a90be 100644 --- a/Resources/Config/verifyOXP.plist +++ b/Resources/Config/verifyOXP.plist @@ -4,19 +4,17 @@ */ { - stages = - ( - OOCheckRequiresPListVerifierStage, - OOCheckPListSyntaxVerifierStage, - OOCheckDemoShipsPListVerifierStage, - OOCheckEquipmentPListVerifierStage, - OOTextureVerifierStage, - OOCheckShipDataPListVerifierStage, - OOAIStateMachineVerifierStage, - OOCheckJSSyntaxVerifierStage + stages = ( + "OOCheckRequiresPListVerifierStage", + "OOCheckPListSyntaxVerifierStage", + "OOCheckDemoShipsPListVerifierStage", + "OOCheckEquipmentPListVerifierStage", + "OOTextureVerifierStage", + "OOCheckShipDataPListVerifierStage", + "OOAIStateMachineVerifierStage", + "OOCheckJSSyntaxVerifierStage" ); - excludeStages = - ( + excludeStages = ( /* Add stages here to stop them from being used. For instance, to skip the texture verification, create a verifyOXP.plist file in your AddOns folder with the following content: @@ -24,19 +22,18 @@ */ ); - logControlOverride = - { + logControlOverride = { // Note: only yes and no here, no inherit or $metaclass dataCache.rebuild.pathsChanged = no; verifyOXP = yes; verifyOXP.stage = yes; verifyOXP.verbose = no; + verifyOXP.scanFiles.readMe = no; }; logShowMessageClassOverride = no; - knownRootDirectories = - ( + knownRootDirectories = ( // Folder names that are meaningful inside an OXP (or Resources) "AIs", "Config", @@ -51,11 +48,9 @@ "Textures" ); - knownFiles = - { + knownFiles = { // Files the game uses directly. - "Config" = - ( + Config = ( "autoAImap.plist", "characters.plist", "commodities.plist", @@ -94,8 +89,7 @@ ); // the files in the "Config" list which are arrays - "ConfigArrays" = - ( + ConfigArrays = ( "demoships.plist", "equipment.plist", "nebulatextures.plist", @@ -107,8 +101,7 @@ ); // the files in the "Config" list which are dictionaries - "ConfigDictionaries" = - ( + ConfigDictionaries = ( "autoAImap.plist", "characters.plist", "commodities.plist", @@ -139,8 +132,7 @@ "trade-goods.plist" ); - "Sounds" = - ( + Sounds = ( "afterburner1.ogg", "witchabort.ogg", "warning.ogg", @@ -162,39 +154,33 @@ "laser.ogg", "hullbang.ogg" ); - "Music" = - ( + Music = ( "BlueDanube.ogg", "OoliteTheme.ogg" ); - "Textures" = - ( + Textures = ( "blur256.png", "asciitext.png", "trumblekit.png" ); }; - junkFiles = - ( + junkFiles = ( // Files generated by operating systems and tools which can be ignored. ".DS_Store", "Thumbs.db", "zipinfo.txt" ); - skipDirectories = - ( + skipDirectories = ( // Directories to silently skip (version control systems make these). ".svn", "CVS", ".git" ); - readMeNames = - { - stems = - ( + readMeNames = { + stems = ( "readme", "read me", "read_me", @@ -207,8 +193,7 @@ "read me now!", "read me first!" ); - extensions = - ( + extensions = ( "", ".txt", ".html", @@ -220,14 +205,12 @@ ); }; - requiresPListSupportedKeys = - ( + requiresPListSupportedKeys = ( "version", "max_version" ); - debugGraphvizTempate = - { + debugGraphvizTempate = { /* Bits needed to generate graphviz code describing verifier stage dependency relationships. This is generated (and written to the current working directory) if the preference @@ -247,156 +230,162 @@ postamble = "}\n"; }; - shipdataPListSettings = - { - knownShipKeys = - ( - "like_ship", - "is_template", - "is_external_dependency", - "max_flight_speed", - "max_flight_roll", - "max_flight_pitch", - "max_flight_yaw", - "thrust", + shipdataPListSettings = { + knownShipKeys = ( "accuracy", - "max_energy", + "aft_eject_position", + "aft_weapon_type", + "ai_type", + "auto_ai", + "auto_weapons", + "beacon", + "beacon_label", + "bounty", + "cargo_carried", + "cargo_type", + "cloak_automatic", + "cloak_passive", + "condition_script", + "conditions", + "counts_as_kill", + "death_actions", + "debris_role", + "density", + "display_name", "energy_recharge_rate", + "escape_pod_model", + "escape_pod_role", + "escort-role", + "escort-ship", + "escort_role", + "escort_roles", + "escort_ship", + "escorts", + "exhaust", + "exhaust_emissive_color", + "explosion_type", + "extra_cargo", "forward_weapon_type", - "aft_weapon_type", - "port_weapon_type", - "starboard_weapon_type", - "weapon_energy", - "weapon_range", //added 2010-10-31 by cmdr_james for variable range plasma turrets - "scanner_range", + "fragment_chance", + "frangible", + "fuel", "fuel_charge_rate", - "missiles", + "has_cloaking_device", "has_ecm", - "has_scoop", - "has_escape_pod", "has_energy_bomb", + "has_escape_pod", "has_fuel_injection", - "has_cloaking_device", + "has_insulation", "has_military_jammer", "has_military_scanner_filter", - "fragment_chance", + "has_scoop", + "has_scoop_message", "has_shield_booster", "has_shield_enhancer", - "fuel", - "bounty", - "ai_type", - "max_cargo", + "heat_insulation", + "hyperspace_motor", + "hyperspace_motor_spin_time", + "isCarrier", + "is_carrier", + "is_external_dependency", + "is_hulk", + "is_submunition", + "is_template", + "laser_color", + "launch_actions", + "like_ship", "likely_cargo", - "extra_cargo", - "cargo_carried", - "cargo_type", + "materials", + "max_cargo", + "max_energy", + "max_flight_pitch", + "max_flight_roll", + "max_flight_speed", + "max_flight_yaw", + "max_missiles", + "missile_launch_position", + "missile_load_time", + "missile_role", + "missiles", "model", "model_scale_factor", - "materials", - "shaders", - "smooth", - "density", "name", - "display_name", + "no_boulders", + "pilot", + "port_weapon_type", + "reaction_time", "roles", - "exhaust", - "exhaust_emissive_color", - "is_hulk", - "subentities", - "frangible", + "rotational_velocity", + "scanClass", + "scan_class", "scanner_display_color1", "scanner_display_color2", - "laser_color", - "scan_class", - "scanClass", - "launch_actions", + "scanner_range", + "scoop_position", + "script", "script_actions", - "death_actions", + "script_info", "setup_actions", - "escorts", - "beacon", - "beacon_label", - "rotational_velocity", + "shaders", + "show_damage", + "smooth", + "starboard_weapon_type", + "subentities", + "sun_glare_filter", + "throw_sparks", + "thrust", "track_contacts", - "weapon_position_forward", + "unpiloted", + "weapon_energy", + "weapon_facings", + "weapon_mount_mode", + "weapon_offset_x", "weapon_position_aft", + "weapon_position_forward", "weapon_position_port", "weapon_position_starboard", - "weapon_facings", - "weapon_offset_x", - "scoop_position", - "heat_insulation", - "pilot", - "unpiloted", - "escort_roles", - "escort_role", - "escort-role", - "escort_ship", - "escort-ship", - "missile_launch_position", - "missile_load_time", - "missile_role", - "escape_pod_role", - "escape_pod_model", - "aft_eject_position", - "auto_ai", - "auto_weapons", - "script", - "conditions", - "condition_script", - "script_info", - "is_submunition", - "is_carrier", - "isCarrier", - "no_boulders", - "hyperspace_motor", - "hyperspace_motor_spin_time", - "throw_sparks", - "max_missiles", - "cloak_passive", - "cloak_automatic", - "debris_role", - "has_scoop_message", - "counts_as_kill", - "explosion_type" + "weapon_range" //added 2010-10-31 by cmdr_james for variable range plasma turrets ); - knownStationKeys = - ( - "rotating", - "station_roll", + knownStationKeys = ( + "allegiance", + "allows_auto_docking", + "allows_auto_docking", + "allows_fast_docking", "defense_ship", "defense_ship_role", + "equipment_price_factor", + "equivalent_tech_level", + "hasShipyard", "has_npc_traffic", "has_patrol_ships", "has_shipyard", - "hasShipyard", - "port_radius", - "port_dimensions", - "equivalent_tech_level", - "max_scavengers", + "interstellar_undocking", + "market", + "market_broadcast", + "market_capacity", + "market_definition", + "market_monitored", + "market_script", "max_defense_ships", "max_police", - "equipment_price_factor", + "max_scavengers", + "port_dimensions", + "port_radius", "requires_docking_clearance", - "tunnel_corners", - "tunnel_start_angle", + "rotating", + "station_roll", "tunnel_aspect_ratio", - "interstellar_undocking", - "allows_fast_docking", - "allows_auto_docking", - "allegiance", - "market_monitored", - "market_definition" + "tunnel_corners", + "tunnel_start_angle" ); - knownPlayerKeys = - ( + knownPlayerKeys = ( "extra_equipment", + "custom_views", "hud", "view_position_forward", "view_position_aft", "view_position_port", - "view_position_starboard", - "custom_views" + "view_position_starboard" ); }; } diff --git a/Resources/Schemata/demoshipsSchema.plist b/Resources/Schemata/demoshipsSchema.plist index ae06cbbb8..16740d18d 100644 --- a/Resources/Schemata/demoshipsSchema.plist +++ b/Resources/Schemata/demoshipsSchema.plist @@ -3,10 +3,6 @@ */ { - type = array; - valueType = - { - type = delegatedType; - baseType = string; - }; + type = "array"; + valueType = { type = "delegatedType"; baseType = "string"; }; } diff --git a/Resources/Schemata/hudSchema.plist b/Resources/Schemata/hudSchema.plist index 432e9e900..ae1de1024 100644 --- a/Resources/Schemata/hudSchema.plist +++ b/Resources/Schemata/hudSchema.plist @@ -3,54 +3,47 @@ */ { - type = dictionary; - schema = - { - "dials" = - { - type = array; - valueType = - { - type = dictionary; - schema = - { + type = "dictionary"; + schema = { + dials = { + type = "array"; + valueType = { + type = "dictionary"; + schema = { // Not all values apply to all types of dial. - "alpha" = $floatZeroToTwo; - "equipment_required" = $equipmentKey; - "selector" = $oneParamSelector; - "x" = integer; - "y" = integer; - "width" = positiveFloat; - "height" = positiveFloat; - "rgb_color" = $simpleRGBColor; - "color" = $colourSpecifier; // Alternative to rgb_color as of 1.70 - "draw_surround" = boolean; - "labelled" = boolean; - "spacing" = positiveInteger; - "n_bars" = positiveInteger; + alpha = "$floatZeroToTwo"; + equipment_required = "$equipmentKey"; + selector = "$oneParamSelector"; + x = "integer"; + y = "integer"; + width = "positiveFloat"; + height = "positiveFloat"; + rgb_color = "$simpleRGBColor"; + color = "$colourSpecifier"; // Alternative to rgb_color as of 1.70 + draw_surround = "boolean"; + labelled = "boolean"; + spacing = "positiveInteger"; + n_bars = "positiveInteger"; // These are for use with the resetGuis: selector. - "message_gui" = $guiParameters; - "comm_log_gui" = $commGuiParameters; + message_gui = "$guiParameters"; + comm_log_gui = "$commGuiParameters"; }; allowOthers = NO; requiredKeys = ( "selector" ); }; }; - legends = - { - type = array; - valueType = - { - type = dictionary; - schema = - { - "text" = string; - "x" = integer; - "y" = integer; - "width" = positiveFloat; - "height" = positiveFloat; - "image" = $imageFileName; + legends = { + type = "array"; + valueType = { + type = "dictionary"; + schema = { + text = "string"; + x = "integer"; + y = "integer"; + width = "positiveFloat"; + height = "positiveFloat"; + image = "$imageFileName"; }; allowOthers = NO; }; @@ -58,94 +51,69 @@ }; }; allowOthers = NO; - $definitions = - { - $equipmentKey = - { - type = string; - requiredPrefix = "EQ_"; - }; - $oneParamSelector = - { - type = delegatedType; - key = oneParamSelector; - baseType = - { - type = string; + $definitions = { + $equipmentKey = { type = "string"; requiredPrefix = "EQ_"; }; + $oneParamSelector = { + type = "delegatedType"; + key = "oneParamSelector"; + baseType = { + type = "string"; requiredSuffix = ":"; }; }; - $floatZeroToOne = - { - type = positiveFloat; - maximum = 1; - }; - $floatZeroToTwo = - { + $floatZeroToOne = { type = "positiveFloat"; maximum = 1; }; + $floatZeroToTwo = { // Alpha can reasonably be two for aegis, since it's scaled by 0.5. // Why the inconsistency? Kaks 20101029 - type = positiveFloat; + type = "positiveFloat"; maximum = 2; }; - $simpleRGBColor = - { - type = array; - valueType = $floatZeroToOne; + $simpleRGBColor = { + type = "array"; + valueType = "$floatZeroToOne"; minCount = 3; maxCount = 3; }; - $colorSpecifier = - { - type = delegatedType; - baseType = - { + $colorSpecifier = { + type = "delegatedType"; + baseType = { type = oneOf; - options = - ( - array, - dictionary, - string - ); + options = ( "array", "dictionary", "string" ); }; - key = colorSpecifier; + key = "colorSpecifier"; }; - $imageFileName = - { - type = delegatedType; - baseType = string; - key = imageFileName; + $imageFileName = { + type = "delegatedType"; + baseType = "string"; + key = "imageFileName"; }; - $guiParameters = - { - type = dictionary; - schema = - { - "x" = integer; - "y" = integer; - "width" = positiveFloat; - "height" = positiveFloat; - "row_height" = positiveInteger; - "alpha" = $floatZeroToOne; - "background_rgba" = string; - "title" = string; + $guiParameters = { + type = "dictionary"; + schema = { + x = "integer"; + y = "integer"; + width = "positiveFloat"; + height = "positiveFloat"; + row_height = "positiveInteger"; + alpha = "$floatZeroToOne"; + background_rgba = "string"; + title = "string"; }; allowOthers = NO; }; - $commGuiParameters = - { - type = dictionary; - schema = - { - "automatic" = boolean; - "permanent" = boolean; - "x" = integer; - "y" = integer; - "width" = positiveFloat; - "height" = positiveFloat; - "row_height" = positiveInteger; - "alpha" = $floatZeroToOne; - "background_rgba" = string; - "title" = string; + $commGuiParameters = { + type = "dictionary"; + schema = { + automatic = "boolean"; + permanent = "boolean"; + x = "integer"; + y = "integer"; + width = "positiveFloat"; + height = "positiveFloat"; + row_height = "positiveInteger"; + alpha = "$floatZeroToOne"; + background_rgba = "string"; + title = "string"; }; allowOthers = NO; }; diff --git a/Resources/Schemata/plistschema.plist b/Resources/Schemata/plistschema.plist index 6d663cda1..2c50ba4d6 100644 --- a/Resources/Schemata/plistschema.plist +++ b/Resources/Schemata/plistschema.plist @@ -1,4 +1,4 @@ -/* plistschema.plist +/* plistSchema.plist Schema for plist schemas. Oooh, meta. @@ -7,54 +7,47 @@ */ { - type = $rootTypeSpecifier; + type = "$rootTypeSpecifier"; - $definitions = - { - $typeSpecifier = - { - type = oneOf; - options = - ( - $simpleTypeSpecifier, - $macroInvocation, - $stringTypeSpecifier, - $arrayTypeSpecifier, - $dictionaryTypeSpecifier, - $numberTypeSpecifier, - $positiveNumberTypeSpecifier, - $parameterLessTypeSpecifier, - $enumerationTypeSpecifier, - $oneOfTypeSpecifier, - $delegatedTypeSpecifier + $definitions = { + $typeSpecifier = { + type = "oneOf"; + options = ( + "$simpleTypeSpecifier", + "$macroInvocation", + "$stringTypeSpecifier", + "$arrayTypeSpecifier", + "$dictionaryTypeSpecifier", + "$numberTypeSpecifier", + "$positiveNumberTypeSpecifier", + "$parameterLessTypeSpecifier", + "$enumerationTypeSpecifier", + "$oneOfTypeSpecifier", + "$delegatedTypeSpecifier" ); }; - $rootTypeSpecifier = - { - type = oneOf; - options = - ( - $simpleTypeSpecifier, - $rootMacroInvocation, - $stringTypeSpecifier, - $numberTypeSpecifier, - $positiveNumberTypeSpecifier, - $parameterLessTypeSpecifier, - $enumerationTypeSpecifier, - $rootArrayTypeSpecifier, - $rootDictionaryTypeSpecifier, - $rootOneOfTypeSpecifier, - $rootDelegatedTypeSpecifier + $rootTypeSpecifier = { + type = "oneOf"; + options = ( + "$simpleTypeSpecifier", + "$rootMacroInvocation", + "$stringTypeSpecifier", + "$numberTypeSpecifier", + "$positiveNumberTypeSpecifier", + "$parameterLessTypeSpecifier", + "$enumerationTypeSpecifier", + "$rootArrayTypeSpecifier", + "$rootDictionaryTypeSpecifier", + "$rootOneOfTypeSpecifier", + "$rootDelegatedTypeSpecifier" ); }; - $simpleTypeSpecifier = - { + $simpleTypeSpecifier = { // Simple types that can be referred to by name with no parameters - type = enumeration; - values = - ( + type = "enumeration"; + values = ( "string", "array", "dictionary", @@ -70,323 +63,254 @@ ); }; - $macroInvocation = - { - type = oneOf; - options = - ( - $macroInvocationString, + $macroInvocation = { + type = "oneOf"; + options = ( + "$macroInvocationString", { - type = dictionary; - schema = - { - "type" = $macroInvocation; - }; + type = "dictionary"; + schema = { type = "$macroInvocation"; }; allowOthers = NO; requiredKeys = ( "type" ); } ); }; - $macroInvocationString = - { - type = string; + $macroInvocationString = { + type = "string"; minLength = 2; requiredPrefix = "$"; }; - $stringTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $stringTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "string" ); }; - "filter" = $filterSpecifier; - "requiredPrefix" = $stringOrStringArray; - "requiredSuffix" = $stringOrStringArray; - "requiredSubString" = $stringOrStringArray; - "minLength" = positiveInteger; - "maxLength" = positiveInteger; + filter = "$filterSpecifier"; + requiredPrefix = "$stringOrStringArray"; + requiredSuffix = "$stringOrStringArray"; + requiredSubString = "$stringOrStringArray"; + minLength = "positiveInteger"; + maxLength = "positiveInteger"; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $arrayTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $arrayTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "array" ); }; - "minCount" = positiveInteger; - "maxCount" = positiveInteger; - "valueType" = $typeSpecifier; + minCount = "positiveInteger"; + maxCount = "positiveInteger"; + valueType = "$typeSpecifier"; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $dictionaryTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $dictionaryTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "dictionary" ); }; - "minCount" = positiveInteger; - "maxCount" = positiveInteger; - "valueType" = $typeSpecifier; - "schema" = - { - type = dictionary; - valueType = $typeSpecifier; + minCount = "positiveInteger"; + maxCount = "positiveInteger"; + valueType = "$typeSpecifier"; + schema = { + type = "dictionary"; + valueType = "$typeSpecifier"; }; - "allowOthers" = boolean; - "requiredKeys" = - { - type = array; - valueType = string; + allowOthers = "boolean"; + requiredKeys = { + type = "array"; + valueType = "string"; }; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $numberTypeSpecifier = - { + $numberTypeSpecifier = { type = dictionary; - schema = - { - "type" = - { - type = enumeration; - values = - ( - "integer", - "float" - ); + schema = { + type = { + type = "enumeration"; + values = ( "integer", "float" ); }; - "minimum" = integer; - "maximum" = integer; + minimum = "integer"; + maximum = "integer"; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $positiveNumberTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; - values = - ( - "positiveInteger", - "positiveFloat" - ); + $positiveNumberTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; + values = ( "positiveInteger", "positiveFloat" ); }; - "minimum" = positiveInteger; - "maximum" = positiveInteger; + minimum = "positiveInteger"; + maximum = "positiveInteger"; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $parameterLessTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; - values = - ( - "boolean", - "fuzzyBoolean", - "vector", - "quaternion" - ); + $parameterLessTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; + values = ( "boolean", "fuzzyBoolean", "vector", "quaternion" ); }; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $enumerationTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $enumerationTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "enumeration" ); }; - "values" = - { - type = array; - valueType = string; + values = { + type = "array"; + valueType = "string"; minCount = 1; }; - "filter" = $filterSpecifier; + filter = "$filterSpecifier"; }; allowOthers = NO; requiredKeys = ( "type", "values" ); }; - $oneOfTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $oneOfTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "oneOf" ); }; - "options" = - { - type = array; - valueType = $typeSpecifier; + options = { + type = "array"; + valueType = "$typeSpecifier"; minCount = 1; }; }; allowOthers = NO; requiredKeys = ( "type", "options" ); }; - $delegatedTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $delegatedTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "delegatedType" ); }; - "baseType" = $typeSpecifier; - "key" = string; + baseType = "$typeSpecifier"; + key = "string"; }; allowOthers = NO; requiredKeys = ( "type", "key" ); }; // "Root" variants of types which can have typeSpecifier arguments. These are the only types for which a $definitions entry is meaningful. - $rootArrayTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $rootArrayTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "array" ); }; - "$definitions" = $definitionsDictionary; + $definitions = "$definitionsDictionary"; - "minCount" = positiveInteger; - "maxCount" = positiveInteger; - "valueType" = $typeSpecifier; + minCount = "positiveInteger"; + maxCount = "positiveInteger"; + valueType = "$typeSpecifier"; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $rootDictionaryTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $rootDictionaryTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "dictionary") ; }; - "$definitions" = $definitionsDictionary; + $definitions = "$definitionsDictionary"; - "minCount" = positiveInteger; - "maxCount" = positiveInteger; - "valueType" = $typeSpecifier; - "schema" = - { - type = dictionary; - valueType = $typeSpecifier; + minCount = "positiveInteger"; + maxCount = "positiveInteger"; + valueType = "$typeSpecifier"; + schema = { + type = "dictionary"; + valueType = "$typeSpecifier"; }; - "allowOthers" = boolean; - "requiredKeys" = - { - type = array; - valueType = string; + allowOthers = "boolean"; + requiredKeys = { + type = "array"; + valueType = "string"; }; }; allowOthers = NO; requiredKeys = ( "type" ); }; - $rootOneOfTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $rootOneOfTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "oneOf" ); }; - "$definitions" = $definitionsDictionary; + $definitions = "$definitionsDictionary"; - "options" = - { - type = array; - valueType = $typeSpecifier; + options = { + type = "array"; + valueType = "$typeSpecifier"; }; }; allowOthers = NO; requiredKeys = ( "type", "options" ); }; - $rootDelegatedTypeSpecifier = - { - type = dictionary; - schema = - { - "type" = - { - type = enumeration; + $rootDelegatedTypeSpecifier = { + type = "dictionary"; + schema = { + type = { + type = "enumeration"; values = ( "delegatedType") ; }; - "$definitions" = $definitionsDictionary; + $definitions = "$definitionsDictionary"; - "baseType" = $typeSpecifier; - "key" = string; + baseType = "$typeSpecifier"; + key = "string"; }; allowOthers = NO; requiredKeys = ( "type", "key" ); }; - $rootMacroInvocation = - { - type = oneOf; - options = - ( - $macroInvocationString, + $rootMacroInvocation = { + type = "oneOf"; + options = ( + "$macroInvocationString", { - type = dictionary; - schema = - { - "type" = $macroInvocation; - "$definitions" = $definitionsDictionary; + type = "dictionary"; + schema = { + type = "$macroInvocation"; + $definitions = "$definitionsDictionary"; }; allowOthers = NO; requiredKeys = ( "type" ); @@ -395,24 +319,20 @@ }; - $stringOrStringArray = - { - type = oneOf; - options = - ( - string, + $stringOrStringArray = { + type = "oneOf"; + options = ( + "string", { - type = array; - valueType = string; + type = "array"; + valueType = "string"; } ); }; - $filterSpecifier = - { - type = enumeration; - filter = subStringToInclusive::; - values = - ( + $filterSpecifier = { + type = "enumeration"; + filter = "subStringToInclusive::"; + values = ( "lowerCase", "upperCase", "capitalized", @@ -424,11 +344,10 @@ "subStringFromInclusive:" ); }; - $definitionsDictionary = - { + $definitionsDictionary = { // NOTE: there is currently no way to apply string requirements (like requiredPrefix = "$") to dictionary keys. - type = dictionary; - valueType = $typeSpecifier; + type = "dictionary"; + valueType = "$typeSpecifier"; }; }; } diff --git a/Resources/Schemata/shipdataEntrySchema.plist b/Resources/Schemata/shipdataEntrySchema.plist index 228d9c355..bb3833553 100644 --- a/Resources/Schemata/shipdataEntrySchema.plist +++ b/Resources/Schemata/shipdataEntrySchema.plist @@ -4,172 +4,146 @@ { type = "dictionary"; - schema = - { - like_ship = "$shipRole"; - is_template = "boolean"; - is_external_dependency = "boolean"; - max_flight_speed = "positiveFloat"; - max_flight_roll = "positiveFloat"; - max_flight_pitch = "positiveFloat"; - max_flight_yaw = "positiveFloat"; - thrust = "positiveFloat"; + schema = { accuracy = "float"; - max_energy = "positiveFloat"; + aft_eject_position = "vector"; + aft_weapon_type = "string"; + ai_type = "$aiFileName"; + allows_auto_docking = "boolean"; + allows_fast_docking = "boolean"; + auto_ai = "boolean"; + beacon = "string"; + bounty = "positiveInteger"; + cargo_carried = "$cargoCarried"; + cargo_type = "$cargoType"; + cloak_passive = "boolean"; + cloak_automatic = "boolean"; + conditions = "$scriptConditionList"; + counts_as_kill = "boolean"; + custom_views = { type = "array"; valueType = "$customViewSpec"; }; + death_actions = "$scriptActions"; + debris_role = "$shipRole"; + defense_ship = "$shipKey"; + defense_ship_role = "$shipRole"; + density = "positiveFloat"; + display_name = "string"; energy_recharge_rate = "positiveFloat"; + equipment_price_factor = "positiveFloat"; + equivalent_tech_level = "integer"; + escape_pod_role = "$shipRole"; // new, improved (1.77) + escape_pod_model = "$shipRole"; // old, deprecated + escorts = { type = "positiveInteger"; maximum = 16; }; + escort_role = "$shipRole"; + escort-role = "$shipRole"; + escort_ship = "$shipKey"; + escort-ship = "$shipKey"; + exhaust = { type = "array"; valueType = "$exhaustSpecifier"; }; + extra_cargo = "positiveInteger"; + extra_equipment = "$extraEquipmentDictionary"; + fire_rate = { type = "positiveFloat"; minimum = 0.25; }; forward_weapon_type = "string"; - aft_weapon_type = "string"; - port_weapon_type = "string"; - starboard_weapon_type = "string"; - weapon_facings = "positiveInteger"; - weapon_energy = "positiveFloat"; - weapon_range = "positiveFloat"; - fire_rate = - { - type = "positiveFloat"; - minimum = "0.25"; - }; - scanner_range = "positiveFloat"; + fragment_chance = "fuzzyBoolean"; + frangible = "boolean"; + fuel = "positiveInteger"; fuel_charge_rate = "positiveFloat"; - missiles = "positiveInteger"; + has_cloaking_device = "fuzzyBoolean"; has_ecm = "fuzzyBoolean"; - has_scoop = "fuzzyBoolean"; - has_escape_pod = "positiveInteger"; has_energy_bomb = "fuzzyBoolean"; + has_escape_pod = "positiveInteger"; has_fuel_injection = "fuzzyBoolean"; - has_cloaking_device = "fuzzyBoolean"; has_military_jammer = "fuzzyBoolean"; has_military_scanner_filter = "fuzzyBoolean"; - fragment_chance = "fuzzyBoolean"; + has_npc_traffic = "fuzzyBoolean"; + has_patrol_ships = "fuzzyBoolean"; + has_scoop = "fuzzyBoolean"; + has_scoop_message = "boolean"; has_shield_booster = "fuzzyBoolean"; has_shield_enhancer = "fuzzyBoolean"; - fuel = "positiveInteger"; - bounty = "positiveInteger"; - ai_type = "$aiFileName"; - max_cargo = "positiveInteger"; + has_shipyard = "$hasShipyard"; + hasShipyard = "$hasShipyard"; + heat_insulation = "positiveFloat"; + hud = "$hudFileName"; + hyperspace_motor = "boolean"; + hyperspace_motor_spin_time = "positiveFloat"; + interstellar_undocking = "boolean"; + is_carrier = "boolean"; + isCarrier = "boolean"; + is_external_dependency = "boolean"; + is_hulk = "boolean"; + is_submunition = "boolean"; + is_template = "boolean"; + laser_color = "$colorSpecifier"; + launch_actions = "$scriptActions"; + like_ship = "$shipRole"; likely_cargo = "positiveInteger"; - extra_cargo = "positiveInteger"; - cargo_carried = "$cargoCarried"; - cargo_type = "$cargoType"; - model = "$modelName"; + market = "string"; materials = "$materialDict"; - shaders = "$materialDict"; - smooth = "boolean"; - density = "positiveFloat"; + max_cargo = "positiveInteger"; + max_defense_ships = "positiveInteger"; + max_energy = "positiveFloat"; + max_flight_speed = "positiveFloat"; + max_flight_roll = "positiveFloat"; + max_flight_pitch = "positiveFloat"; + max_flight_yaw = "positiveFloat"; + max_missiles = "positiveInteger"; + max_police = "positiveInteger"; + max_scavengers = "positiveInteger"; + missile_launch_position = "vector"; + missile_load_time = "positiveFloat"; + missiles = "positiveInteger"; + missile_role = "$shipRole"; + model = "$modelName"; name = "string"; - display_name = "string"; + no_boulders = "fuzzyBoolean"; + pilot = "$characterKey"; + port_dimensions = "$portDimensions"; + port_radius = "positiveFloat"; + port_weapon_type = "string"; + requires_docking_clearance = "boolean"; roles = "$roles"; - exhaust = - { - type = "array"; - valueType = "$exhaustSpecifier"; - }; - is_hulk = "boolean"; - subentities = - { - type = "array"; - valueType = "$subEntitySpecifier"; - }; - frangible = "boolean"; - scanner_display_color1 = "$colorSpecifier"; - scanner_display_color2 = "$colorSpecifier"; - laser_color = "$colorSpecifier"; + rotating = "boolean"; + rotational_velocity = "quaternion"; scan_class = "$scanClass"; scanClass = "$scanClass"; - launch_actions = "$scriptActions"; - script_actions = "$scriptActions"; - death_actions = "$scriptActions"; - setup_actions = "$scriptActions"; - escorts = - { - valueType = "positiveInteger"; - maximum = 16; - }; - beacon = "string"; - rotational_velocity = "quaternion"; - track_contacts = "boolean"; - weapon_position_forward = "vector"; - weapon_position_aft = "vector"; - weapon_position_port = "vector"; - weapon_position_starboard = "vector"; - weapon_offset_x = "float"; // NOTE: ignored after 1.65 + scanner_display_color1 = "$colorSpecifier"; + scanner_display_color2 = "$colorSpecifier"; + scanner_range = "positiveFloat"; scoop_position = "vector"; - heat_insulation = "positiveFloat"; - pilot = "$characterKey"; - unpiloted = "fuzzyBoolean"; - escort_role = "$shipRole"; - escort-role = "$shipRole"; - escort_ship = "$shipKey"; - escort-ship = "$shipKey"; - escorts = "positiveInteger"; - missile_launch_position = "vector"; - missile_load_time = "positiveFloat"; - missile_role = "$shipRole"; - escape_pod_role = "$shipRole"; // new, improved (1.77) - escape_pod_model = "$shipRole"; // old, deprecated - aft_eject_position = "vector"; - auto_ai = "boolean"; script = "$scriptFileName"; - conditions = "$scriptConditionList"; + script_actions = "$scriptActions"; script_info = "dictionary"; - is_submunition = "boolean"; - is_carrier = "boolean"; - isCarrier = "boolean"; - no_boulders = "fuzzyBoolean"; - hyperspace_motor = "boolean"; - hyperspace_motor_spin_time = "positiveFloat"; - throw_sparks = "boolean"; - max_missiles = "positiveInteger"; - cloak_passive = "boolean"; - cloak_automatic = "boolean"; - debris_role = "$shipRole"; - has_scoop_message = "boolean"; - - rotating = "boolean"; + setup_actions = "$scriptActions"; + shaders = "$materialDict"; + smooth = "boolean"; + starboard_weapon_type = "string"; station_roll = "float"; - defense_ship = "$shipKey"; - defense_ship_role = "$shipRole"; - has_npc_traffic = "fuzzyBoolean"; - has_patrol_ships = "fuzzyBoolean"; - has_shipyard = "$hasShipyard"; - hasShipyard = "$hasShipyard"; - port_radius = "positiveFloat"; - port_dimensions = "$portDimensions"; - equivalent_tech_level = "integer"; - max_scavengers = "positiveInteger"; - max_defense_ships = "positiveInteger"; - max_police = "positiveInteger"; - equipment_price_factor = "positiveFloat"; - requires_docking_clearance = "boolean"; + subentities = { type = "array"; valueType = "$subEntitySpecifier"; }; + sun_glare_filter = { type = "positiveFloat"; maximum = 1; }; + throw_sparks = "boolean"; + thrust = "positiveFloat"; + track_contacts = "boolean"; + tunnel_aspect_ratio = "positiveFloat"; tunnel_corners = "positiveInteger"; tunnel_start_angle = "float"; - tunnel_aspect_ratio = "positiveFloat"; - market = "string"; - interstellar_undocking = "boolean"; - allows_auto_docking = "boolean"; - allows_fast_docking = "boolean"; - counts_as_kill = "boolean"; - - extra_equipment = "$extraEquipmentDictionary"; - hud = "$hudFileName"; - view_position_forward = "vector"; view_position_aft = "vector"; + view_position_forward = "vector"; view_position_port = "vector"; view_position_starboard = "vector"; - custom_views = - { - type = "array"; - valueType = "$customViewSpec"; - }; + weapon_energy = "positiveFloat"; + weapon_facings = "positiveInteger"; + weapon_position_aft = "$weaponPosition"; + weapon_position_forward = "$weaponPosition"; + weapon_position_port = "$weaponPosition"; + weapon_position_starboard = "$weaponPosition"; + weapon_offset_x = "float"; // NOTE: ignored after 1.65 + weapon_range = "positiveFloat"; + unpiloted = "fuzzyBoolean"; }; - $definitions = - { + $definitions = { // "Special" types referred to above. - $materialDict = - { + $materialDict = { type = "dictionary"; - schema = - { + schema = { ambient = "$colorSpecifier"; // Deprecated but permitted alias for ambient_color ambient_color = "$colorSpecifier"; diffuse = "$colorSpecifier"; // Deprecated but permitted alias for diffuse_color @@ -179,52 +153,30 @@ emission_color = "$colorSpecifier"; emission_map = "$textureSpecifier"; emission_modulate_color = "$colorSpecifier"; - specular = "$colorSpecifier"; - specular_color = "$colorSpecifier"; // Deprecated but permitted alias for emission_color + normal_map = "$textureSpecifier"; + specular = "$colorSpecifier"; // Deprecated but permitted alias for specular_color + specular_color = "$colorSpecifier"; specular_map = "$textureSpecifier"; specular_modulate_color = "$colorSpecifier"; - - shininess = - { - type = "positiveInteger"; - maximum = "128"; - }; + + gloss = { type = "positiveFloat"; maximum = 1; }; + shininess = { type = "positiveInteger"; maximum = 128; }; fragment_shader = "$shaderFileName"; - textures = - { - type = "array"; - valueType = "$textureSpecifier"; - }; - uniforms = - { + textures = { type = "array"; valueType = "$textureSpecifier"; }; + uniforms = { type = "dictionary"; - valueType = - { + valueType = { type = "oneOf"; - options = - ( + options = ( "string", { type = "dictionary"; - schema = - { + schema = { asMatrix = "boolean"; binding = "string"; clamped = "boolean"; normalized = "boolean"; - type = - { - type = "enumeration"; - values = - ( - "binding", - "float", - "real", - "int", - "integer", - "texture" - ); - }; + type = { type = "enumeration"; values = ( "binding", "float", "real", "int", "integer", "texture" ); }; value = "float"; }; } @@ -234,37 +186,16 @@ vertex_shader = "$shaderFileName"; }; }; - $textureSpecifier = - { + $textureSpecifier = { type = "oneOf"; - options = - ( + options = ( "string", { type = "dictionary"; - schema = - { + schema = { anisotropy = "positiveFloat"; - mag_filter = - { - type = "enumeration"; - values = - ( - "nearest", - "linear" - ); - }; - min_filter = - { - type = "enumeration"; - values = - ( - "nearest", - "linear", - "mipmap", - "default" - ); - }; + mag_filter = { type = "enumeration"; values = ( "nearest", "linear" ); }; + min_filter = { type = "enumeration"; values = ( "nearest", "linear", "mipmap", "default" ); }; name = "string"; no_shrink = "boolean"; repeat_s = "boolean"; @@ -274,12 +205,11 @@ } ); }; - $scanClass = - { + $scanClass = { type = "enumeration"; - values = - ( + values = ( "CLASS_NOT_SET", + "CLASS_NEUTRAL", "CLASS_NO_DRAW", "CLASS_BUOY", "CLASS_CARGO", @@ -292,11 +222,9 @@ "CLASS_THARGOID" ); }; - $cargoType = - { + $cargoType = { type = "enumeration"; - values = - ( + values = ( "CARGO_NOT_CARGO", "CARGO_SLAVES", "CARGO_ALLOY", @@ -308,134 +236,93 @@ "CARGO_CHARACTER" ); }; - $customViewSpec = - { + $customViewSpec = { type = "dictionary"; - schema = - { - "view_description" = "string"; - "view_position" = "vector"; - "view_orientation" = "quaternion"; - "weapon_facing" = - { + schema = { + view_description = "string"; + view_position = "vector"; + view_orientation = "quaternion"; + weapon_facing = { type = "enumeration"; filter = "lowerCase"; - values = - ( - "forward", - "aft", - "port", - "starboard" - ); + values = ( "forward", "aft", "port", "starboard" ); }; }; }; + $weaponPosition = { + type = "oneOf"; + options = ( "vector", "array" ); + }; // Types handled in code. - $modelName = - { + $modelName = { type = "delegatedType"; - baseType = - { + baseType = { type = "string"; filter = "lowerCase"; requiredSuffix = ".dat"; }; key = "modelName"; }; - $colorSpecifier = - { + $colorSpecifier = { type = "delegatedType"; - baseType = - { + baseType = { type = "oneOf"; - options = - ( - "array", - "dictionary", - "string" - ); + options = ( "array", "dictionary", "string" ); }; key = "colorSpecifier"; }; - $textureFileName = - { + $textureFileName = { type = "delegatedType"; - baseType = - { + baseType = { type = "string"; filter = "lowerCase"; requiredSuffix = ".png"; }; key = "textureFileName"; }; - $hasShipyard = - { + $hasShipyard = { type = "oneOf"; - options = - ( - "$scriptCondition", - "boolean" - ); + options = ( "$scriptCondition", "boolean" ); }; - $aiFileName = - { + $aiFileName = { type = "oneOf"; - options = - ( - "$aiFileNamePlist", - "$aiFileNameJs" - ); + options = ( "$aiFileNamePlist", "$aiFileNameJs" ); key = "aiFileName"; }; - $aiFileNamePlist = - { + $aiFileNamePlist = { type = "delegatedType"; - baseType = - { + baseType = { type = "string"; filter = "lowerCase"; requiredSuffix = ".plist"; }; }; - $aiFileNameJs = - { + $aiFileNameJs = { type = "delegatedType"; - baseType = - { + baseType = { type = "string"; filter = "lowerCase"; requiredSuffix = ".js"; }; }; - $shaderFileName = - { + $shaderFileName = { type = "delegatedType"; - baseType = - { + baseType = { type = "string"; filter = "lowerCase"; - requiredSuffix = - ( - ".vertex", - ".vert", - ".fragment", - ".frag" - ); + requiredSuffix = ( ".vertex", ".vert", ".fragment", ".frag" ); }; key = "shaderFileName"; }; - $exhaustSpecifier = - { + $exhaustSpecifier = { type = "delegatedType"; baseType = "string"; key = "exhaustSpecifier"; }; - $subEntitySpecifier = - { + $subEntitySpecifier = { type = "oneOf"; - options = - ( + options = ( { type = "delegatedType"; baseType = "string"; @@ -444,13 +331,8 @@ { type = "dictionary"; requiredKeys = ( "type", "subentity_key" ); - schema = - { - "type" = - { - type = "enumeration"; - values = ( "standard", "ball_turret" ); - }; + schema = { + type = { type = "enumeration"; values = ( "standard", "ball_turret" ); }; subentity_key = "$shipKey"; position = "vector"; orientation = "quaternion"; @@ -460,19 +342,10 @@ { type = "dictionary"; requiredKeys = ( "type" ); - schema = - { - "type" = - { - type = "enumeration"; - values = ( "flasher" ); - }; + schema = { + type = { type = "enumeration"; values = ( "flasher" ); }; color = "$colorSpecifier"; - colors = - { - type = array; - valueType = "$colorSpecifier"; - }; + colors = { type = "array"; valueType = "$colorSpecifier"; }; position = "vector"; orientation = "quaternion"; size = "positiveFloat"; @@ -483,74 +356,62 @@ } ); }; - $scriptActions = - { + $scriptActions = { type = "delegatedType"; baseType = "array"; key = "scriptActions"; }; - $characterKey = - { + $characterKey = { type = "delegatedType"; baseType = "string"; key = "characterKey"; }; - $shipRole = - { + $shipRole = { type = "delegatedType"; baseType = "string"; key = "shipRole"; }; - $shipKey = - { + $shipKey = { type = "delegatedType"; baseType = "string"; key = "shipKey"; }; - $roles = - { + $roles = { type = "delegatedType"; baseType = "string"; key = "roles"; }; - $scriptCondition = - { + $scriptCondition = { type = "delegatedType"; baseType = "string"; key = "scriptCondition"; }; - $scriptConditionList = - { + $scriptConditionList = { type = "delegatedType"; baseType = "array"; key = "scriptConditions"; }; - $portDimensions = - { + $portDimensions = { type = "delegatedType"; baseType = "string"; key = "portDimensions"; }; - $extraEquipmentDictionary = - { + $extraEquipmentDictionary = { type = "delegatedType"; baseType = "dictionary"; key = "extraEquipmentDictionary"; }; - $hudFileName = - { + $hudFileName = { type = "delegatedType"; baseType = "string"; key = "hudFileName"; }; - $cargoCarried = - { + $cargoCarried = { type = "delegatedType"; baseType = "string"; key = "cargoCarried"; }; - $scriptFileName = - { + $scriptFileName = { type = "delegatedType"; baseType = "string"; key = "$scriptFileName"; diff --git a/Resources/Schemata/shipyardSchema.plist b/Resources/Schemata/shipyardSchema.plist index c43e403d3..6b540c16c 100644 --- a/Resources/Schemata/shipyardSchema.plist +++ b/Resources/Schemata/shipyardSchema.plist @@ -3,57 +3,46 @@ */ { - type = dictionary; - valueType = - { - type = dictionary; - schema = - { - "chance" = float; - "optional_equipment" = $equipmentKeyArray; - "price" = positiveInteger; - "standard_equipment" = - { - type = dictionary; - schema = - { - "forward_weapon_type" = $weaponType; - "extras" = $equipmentKeyArray; - "missiles" = positiveInteger; + type = "dictionary"; + valueType = { + type = "dictionary"; + schema = { + chance = "float"; + optional_equipment = "$equipmentKeyArray"; + price = "positiveInteger"; + standard_equipment = { + type = "dictionary"; + schema = { + forward_weapon_type = "$weaponType"; + extras = "$equipmentKeyArray"; + missiles = "positiveInteger"; }; allowOthers = NO; }; - techLevel = - { - type = positiveInteger; + techLevel = { + type = "positiveInteger"; maximum = 99; // Normally 0..13, but 99 is special. }; - weaponFacings = - { - type = positiveInteger; + weaponFacings = { + type = "positiveInteger"; maximum = 15; }; - "conditions" = $scriptConditions; - "max_cargo" = positiveInteger; + conditions = "$scriptConditions"; + max_cargo = "positiveInteger"; }; }; - $definitions = - { - $equipmentKey = - { - type = string; + $definitions = { + $equipmentKey = { + type = "string"; requiredPrefix = "EQ_"; }; - $equipmentKeyArray = - { - type = array; - valueType = $equipmentKey; + $equipmentKeyArray = { + type = "array"; + valueType = "$equipmentKey"; }; - $weaponType = - { - type = enumeration; - values = - ( + $weaponType = { + type = "enumeration"; + values = ( "EQ_WEAPON_NONE", // "EQ_WEAPON_PLASMA_CANNON", // Currently not supported in code. "EQ_WEAPON_PULSE_LASER", @@ -63,11 +52,10 @@ "EQ_WEAPON_THARGOID_LASER" ); }; - $scriptConditions = - { - type = delegatedType; - baseType = array; - key = scriptConditions; + $scriptConditions = { + type = "delegatedType"; + baseType = "array"; + key = "scriptConditions"; }; }; } diff --git a/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m b/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m index bf7d8afd3..e2d867967 100644 --- a/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m +++ b/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m @@ -132,7 +132,7 @@ - (void)runCheckWithEquipment:(NSArray *)equipmentPList /* Check element types. The numbers are required to be unsigned integers; the use of a negative default will catch both negative - values and unconvertable values. + values and unconvertible values. */ if ([entry oo_longAtIndex:EQUIPMENT_TECH_LEVEL_INDEX defaultValue:-1] < 0) { diff --git a/src/Core/OXPVerifier/OOCheckJSSyntaxVerifierStage.m b/src/Core/OXPVerifier/OOCheckJSSyntaxVerifierStage.m index cfad55303..0154bbdda 100644 --- a/src/Core/OXPVerifier/OOCheckJSSyntaxVerifierStage.m +++ b/src/Core/OXPVerifier/OOCheckJSSyntaxVerifierStage.m @@ -47,9 +47,9 @@ - (NSString *)name - (BOOL)shouldRun { OOFileScannerVerifierStage *fileScanner = nil; - + fileScanner = [[self verifier] fileScannerStage]; - return ([[fileScanner filesInFolder:@"Scripts"] count] > 0); + return ([[fileScanner filesInFolder:@"Scripts"] count] > 0 || [[fileScanner filesInFolder:@"Config"] containsObject:@"script.js"]); } @@ -60,11 +60,13 @@ - (void)run NSString *scriptFile = nil; NSString *fileExt = nil; NSString *filePath = nil; + BOOL configScript = NO; fileScanner = [[self verifier] fileScannerStage]; scriptFiles = [fileScanner filesInFolder:@"Scripts"]; + configScript = ([[fileScanner filesInFolder:@"Config"] containsObject:@"script.js"]); - if (scriptFiles == nil) return; + if (scriptFiles == nil && configScript == NO) return; [[OOJavaScriptEngine sharedEngine] setShowErrorLocations:YES]; @@ -79,8 +81,12 @@ - (void)run (void)script; } } - - + if (configScript == YES) { + scriptFile = @"script.js"; + filePath = [fileScanner pathForFile:scriptFile inFolder:@"Config" referencedFrom:nil checkBuiltIn:NO]; + OOScript *script = [OOJSScript scriptWithPath:filePath properties:nil]; + (void)script; + } } @end diff --git a/src/Core/OXPVerifier/OOCheckPListSyntaxVerifierStage.m b/src/Core/OXPVerifier/OOCheckPListSyntaxVerifierStage.m index 4bfb6fd2d..75b1db1d7 100644 --- a/src/Core/OXPVerifier/OOCheckPListSyntaxVerifierStage.m +++ b/src/Core/OXPVerifier/OOCheckPListSyntaxVerifierStage.m @@ -61,6 +61,9 @@ - (void)run NSString *plistName = nil; foreach (plistName, plists) { + // don't scan a js file as a plist + if ([plistName isEqualToString:@"script.js"]) continue; + if ([fileScanner fileExists:plistName inFolder:@"Config" referencedFrom:nil