From cf4b3c91cb50e2ba549c5502c2204c43f8f2f825 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 20 Aug 2013 19:32:21 +0000 Subject: [PATCH] - updated wog/vcmi mod.json files - found situation where JsonNode parser won't report warning: comma after last element in arrays or objects. Fixed this in our config files but parser change is disabled for now due to huge number of warnings from mods. --- Mods/WoG/mod.json | 2 + Mods/vcmi/mod.json | 2 + config/artifacts.json | 2 +- config/creatures/conflux.json | 2 +- config/creatures/fortress.json | 2 +- config/creatures/necropolis.json | 2 +- config/creatures/neutral.json | 2 +- config/factions/conflux.json | 2 +- config/filesystem.json | 2 +- config/obstacles.json | 72 ++++++++++++++++---------------- config/schemas/bonus.json | 28 ++++++------- config/schemas/faction.json | 2 +- config/schemas/hero.json | 6 +-- config/schemas/mod.json | 2 +- config/schemas/settings.json | 2 +- config/sp_sounds.json | 6 +-- config/terrainViewPatterns.json | 2 +- lib/CCreatureHandler.cpp | 1 + lib/JsonNode.cpp | 5 +++ 19 files changed, 77 insertions(+), 67 deletions(-) diff --git a/Mods/WoG/mod.json b/Mods/WoG/mod.json index 0563a6876..7c5864933 100644 --- a/Mods/WoG/mod.json +++ b/Mods/WoG/mod.json @@ -4,6 +4,8 @@ "version" : "3.58.0", "author" : "WoG Team", + "contact" : "http://forum.vcmi.eu/index.php", + "modType" : "Expansion", "artifacts" : [ diff --git a/Mods/vcmi/mod.json b/Mods/vcmi/mod.json index 98ad0bdfb..6a0a01d15 100644 --- a/Mods/vcmi/mod.json +++ b/Mods/vcmi/mod.json @@ -4,6 +4,8 @@ "version" : "0.0", "author" : "VCMI Team", + "contact" : "http://forum.vcmi.eu/index.php", + "modType" : "Graphical", "filesystem": { diff --git a/config/artifacts.json b/config/artifacts.json index 177e7e57e..84fada3e8 100644 --- a/config/artifacts.json +++ b/config/artifacts.json @@ -2,7 +2,7 @@ "spellBook": { "index" : 0, - "type" : ["HERO"], + "type" : ["HERO"] }, "spellScroll": { diff --git a/config/creatures/conflux.json b/config/creatures/conflux.json index 62e494546..032124265 100644 --- a/config/creatures/conflux.json +++ b/config/creatures/conflux.json @@ -494,7 +494,7 @@ { "type" : "FIRE_IMMUNITY", "subtype" : 0 //this IS important - }, + } }, "graphics" : { diff --git a/config/creatures/fortress.json b/config/creatures/fortress.json index 9f1371d83..4353e40f6 100644 --- a/config/creatures/fortress.json +++ b/config/creatures/fortress.json @@ -40,7 +40,7 @@ { "index": 100, "level": 2, - "extraNames": [ "primitiveLizardman", ], + "extraNames": [ "primitiveLizardman" ], "faction": "fortress", "upgrades": ["lizardWarrior"], "hasDoubleWeek": true, diff --git a/config/creatures/necropolis.json b/config/creatures/necropolis.json index 90f367f11..f73084803 100644 --- a/config/creatures/necropolis.json +++ b/config/creatures/necropolis.json @@ -354,7 +354,7 @@ { "dragon" : { - "type" : "DRAGON_NATURE", + "type" : "DRAGON_NATURE" }, "age" : { diff --git a/config/creatures/neutral.json b/config/creatures/neutral.json index 69806b842..c16bbbffa 100644 --- a/config/creatures/neutral.json +++ b/config/creatures/neutral.json @@ -142,7 +142,7 @@ { "dragon" : { - "type" : "DRAGON_NATURE", + "type" : "DRAGON_NATURE" }, "mirror" : { diff --git a/config/factions/conflux.json b/config/factions/conflux.json index 3278fa7f8..2c70f0f7b 100644 --- a/config/factions/conflux.json +++ b/config/factions/conflux.json @@ -75,7 +75,7 @@ }, "structures" : { - "extraAnimation2":{ "animation" : "TBELEXT5.def", "x" : 682, "y" : 183, "z" : -1, }, + "extraAnimation2":{ "animation" : "TBELEXT5.def", "x" : 682, "y" : 183, "z" : -1 }, "extraAnimation": { "animation" : "TBELEXT1.def", "x" : 23, "y" : 218 }, "mageGuild1": { "id" : 0, "animation" : "TBELMAGE.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAGE.bmp", "area" : "TZELMAGE.bmp" }, "mageGuild2": { "id" : 1, "animation" : "TBELMAG2.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAG2.bmp", "area" : "TZELMAG2.bmp" }, diff --git a/config/filesystem.json b/config/filesystem.json index c208df867..4917922e0 100644 --- a/config/filesystem.json +++ b/config/filesystem.json @@ -39,7 +39,7 @@ ], "CONFIG/": [ - {"type" : "dir", "path" : "config",} + {"type" : "dir", "path" : "config"} ], "MAPS/": [ diff --git a/config/obstacles.json b/config/obstacles.json index 925afdfef..10c8360e5 100644 --- a/config/obstacles.json +++ b/config/obstacles.json @@ -921,7 +921,7 @@ "blockedTiles" : [0, 1, -14, -15], "defname" : "ObMCs02.def", "unknown" : 1 - }, + } ], "absoluteObstacles" : [ { @@ -931,7 +931,7 @@ "width" : 124, "height" : 254, "blockedTiles" : [80, 94, 95, 96, 97, 105, 106, 107, 108, 109, 110], - "defname" : "ObDtL04.pcx", + "defname" : "ObDtL04.pcx" }, { "id" : 1, @@ -940,7 +940,7 @@ "width" : 256, "height" : 254, "blockedTiles" : [73, 91, 108, 109, 110, 111, 112, 113], - "defname" : "ObDtL06.pcx", + "defname" : "ObDtL06.pcx" }, { "id" : 2, @@ -949,7 +949,7 @@ "width" : 168, "height" : 212, "blockedTiles" : [60, 61, 62, 63, 64, 72, 73, 74, 75, 76, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149], - "defname" : "ObDtL10.pcx", + "defname" : "ObDtL10.pcx" }, { "id" : 3, @@ -958,7 +958,7 @@ "width" : 124, "height" : 254, "blockedTiles" : [88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98], - "defname" : "ObDtL02.pcx", + "defname" : "ObDtL02.pcx" }, { "id" : 4, @@ -967,7 +967,7 @@ "width" : 146, "height" : 254, "blockedTiles" : [76, 77, 78, 79, 80, 89, 90, 91, 92, 93], - "defname" : "ObDtL03.pcx", + "defname" : "ObDtL03.pcx" }, { "id" : 5, @@ -976,7 +976,7 @@ "width" : 173, "height" : 221, "blockedTiles" : [55, 56, 57, 58, 75, 76, 77, 95, 112, 113, 131], - "defname" : "ObGrL01.pcx", + "defname" : "ObGrL01.pcx" }, { "id" : 6, @@ -985,7 +985,7 @@ "width" : 180, "height" : 264, "blockedTiles" : [81, 91, 92, 93, 94, 95, 96, 97, 98, 106, 107, 123], - "defname" : "ObGrL02.pcx", + "defname" : "ObGrL02.pcx" }, { "id" : 7, @@ -994,7 +994,7 @@ "width" : 166, "height" : 255, "blockedTiles" : [76, 77, 78, 79, 91, 92, 93, 97, 98, 106, 107, 108], - "defname" : "ObSnL01.pcx", + "defname" : "ObSnL01.pcx" }, { "id" : 8, @@ -1003,7 +1003,7 @@ "width" : 302, "height" : 172, "blockedTiles" : [41, 42, 43, 58, 75, 92, 108, 126, 143], - "defname" : "ObSnL14.pcx", + "defname" : "ObSnL14.pcx" }, { "id" : 9, @@ -1012,7 +1012,7 @@ "width" : 300, "height" : 170, "blockedTiles" : [40, 41, 58, 59, 74, 75, 92, 93, 109, 110, 111, 127, 128, 129, 130], - "defname" : "ObSwL15.pcx", + "defname" : "ObSwL15.pcx" }, { "id" : 10, @@ -1021,7 +1021,7 @@ "width" : 278, "height" : 171, "blockedTiles" : [43, 60, 61, 77, 93, 94, 95, 109, 110, 126, 127], - "defname" : "ObSwL14.pcx", + "defname" : "ObSwL14.pcx" }, { "id" : 11, @@ -1030,7 +1030,7 @@ "width" : 256, "height" : 254, "blockedTiles" : [74, 75, 76, 77, 91, 92, 93, 94, 95, 109, 110, 111, 112], - "defname" : "ObSwL22.pcx", + "defname" : "ObSwL22.pcx" }, { "id" : 12, @@ -1039,7 +1039,7 @@ "width" : 124, "height" : 254, "blockedTiles" : [77, 78, 79, 80, 81, 91, 92, 93, 94, 105, 106, 107], - "defname" : "ObLvL01.pcx", + "defname" : "ObLvL01.pcx" }, { "id" : 13, @@ -1048,7 +1048,7 @@ "width" : 256, "height" : 128, "blockedTiles" : [43, 60, 61, 76, 77, 93, 109, 126, 127, 142, 143], - "defname" : "OBLvL02.pcx", + "defname" : "OBLvL02.pcx" }, { "id" : 14, @@ -1057,7 +1057,7 @@ "width" : 186, "height" : 212, "blockedTiles" : [55, 72, 90, 107, 125, 126, 127, 128, 129, 130, 131, 132], - "defname" : "ObRgL01.pcx", + "defname" : "ObRgL01.pcx" }, { "id" : 15, @@ -1066,7 +1066,7 @@ "width" : 347, "height" : 174, "blockedTiles" : [41, 59, 76, 94, 111, 129, 143, 144, 145], - "defname" : "ObRgL02.pcx", + "defname" : "ObRgL02.pcx" }, { "id" : 16, @@ -1075,7 +1075,7 @@ "width" : 294, "height" : 169, "blockedTiles" : [40, 41, 42, 43, 58, 75, 93, 110, 128, 145], - "defname" : "ObRgL03.pcx", + "defname" : "ObRgL03.pcx" }, { "id" : 17, @@ -1084,7 +1084,7 @@ "width" : 165, "height" : 257, "blockedTiles" : [72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 89, 105], - "defname" : "ObRgL04.pcx", + "defname" : "ObRgL04.pcx" }, { "id" : 18, @@ -1093,7 +1093,7 @@ "width" : 208, "height" : 268, "blockedTiles" : [72, 73, 74, 75, 76, 77, 78, 79, 80, 90, 91, 92, 93, 94, 95, 96, 97], - "defname" : "ObRgL05.pcx", + "defname" : "ObRgL05.pcx" }, { "id" : 19, @@ -1102,7 +1102,7 @@ "width" : 252, "height" : 254, "blockedTiles" : [73, 74, 75, 76, 77, 78, 91, 92, 93, 94], - "defname" : "ObRgL06.pcx", + "defname" : "ObRgL06.pcx" }, { "id" : 20, @@ -1111,7 +1111,7 @@ "width" : 278, "height" : 128, "blockedTiles" : [23, 40, 58, 75, 93, 110, 128, 145, 163], - "defname" : "ObRgL15.pcx", + "defname" : "ObRgL15.pcx" }, { "id" : 21, @@ -1120,7 +1120,7 @@ "width" : 208, "height" : 268, "blockedTiles" : [72, 73, 74, 75, 76, 77, 78, 79, 80, 90, 91, 92, 93, 94, 95, 96, 97], - "defname" : "ObRgL05.pcx", + "defname" : "ObRgL05.pcx" }, { "id" : 22, @@ -1129,7 +1129,7 @@ "width" : 168, "height" : 212, "blockedTiles" : [73, 74, 75, 76, 77, 78, 79, 90, 91, 92, 93, 94, 95, 96, 97, 106, 107, 108, 109, 110, 111, 112], - "defname" : "ObRgL22.pcx", + "defname" : "ObRgL22.pcx" }, { "id" : 23, @@ -1138,7 +1138,7 @@ "width" : 147, "height" : 264, "blockedTiles" : [72, 73, 74, 75, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98], - "defname" : "ObBhL02.pcx", + "defname" : "ObBhL02.pcx" }, { "id" : 24, @@ -1147,7 +1147,7 @@ "width" : 178, "height" : 262, "blockedTiles" : [71, 72, 73, 74, 75, 76, 77, 78, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98], - "defname" : "ObBhL03.pcx", + "defname" : "ObBhL03.pcx" }, { "id" : 25, @@ -1156,7 +1156,7 @@ "width" : 173, "height" : 257, "blockedTiles" : [72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 89, 90, 105, 106], - "defname" : "ObBhL05.pcx", + "defname" : "ObBhL05.pcx" }, { "id" : 26, @@ -1165,7 +1165,7 @@ "width" : 241, "height" : 272, "blockedTiles" : [73, 91, 108, 109, 110, 111, 112, 113], - "defname" : "ObBhL06.pcx", + "defname" : "ObBhL06.pcx" }, { "id" : 27, @@ -1174,7 +1174,7 @@ "width" : 261, "height" : 129, "blockedTiles" : [27, 28, 43, 44, 60, 61, 76, 77, 93, 94, 109, 110, 126, 127, 142, 143, 159], - "defname" : "ObBhL14.pcx", + "defname" : "ObBhL14.pcx" }, { "id" : 28, @@ -1183,7 +1183,7 @@ "width" : 180, "height" : 154, "blockedTiles" : [22, 38, 39, 40, 44, 45, 46, 55, 56, 57, 62, 63, 123, 124, 125, 130, 131, 140, 141, 146, 147, 148], - "defname" : "ObBhL16.pcx", + "defname" : "ObBhL16.pcx" }, { "id" : 29, @@ -1192,7 +1192,7 @@ "width" : 304, "height" : 264, "blockedTiles" : [76, 77, 92, 93, 94, 95, 109, 110, 111], - "defname" : "ObCFL00.pcx", + "defname" : "ObCFL00.pcx" }, { "id" : 30, @@ -1201,7 +1201,7 @@ "width" : 256, "height" : 257, "blockedTiles" : [76, 77, 78, 92, 93, 94, 107, 108, 109], - "defname" : "ObLPL00.pcx", + "defname" : "ObLPL00.pcx" }, { "id" : 31, @@ -1210,7 +1210,7 @@ "width" : 257, "height" : 255, "blockedTiles" : [76, 77, 91, 92, 93, 94, 95, 108, 109, 110, 111], - "defname" : "ObFFL00.pcx", + "defname" : "ObFFL00.pcx" }, { "id" : 32, @@ -1219,7 +1219,7 @@ "width" : 277, "height" : 218, "blockedTiles" : [60, 61, 75, 76, 77, 91, 92, 93, 94, 95], - "defname" : "ObRLL00.pcx", + "defname" : "ObRLL00.pcx" }, { "id" : 33, @@ -1228,8 +1228,8 @@ "width" : 300, "height" : 214, "blockedTiles" : [59, 60, 74, 75, 76, 93, 94, 95, 111, 112], - "defname" : "ObMCL00.pcx", + "defname" : "ObMCL00.pcx" } ] -} \ No newline at end of file +} diff --git a/config/schemas/bonus.json b/config/schemas/bonus.json index 2ef25d990..1f9b9d2de 100644 --- a/config/schemas/bonus.json +++ b/config/schemas/bonus.json @@ -12,19 +12,19 @@ { "type" : "string" }, { "type" : "number" } ], - "description": "addInfo", + "description": "addInfo" }, "description": { "type":"string", - "description": "description", + "description": "description" }, "duration": { "type":"string", - "description": "duration", + "description": "duration" }, "effectRange": { "type":"string", - "description": "effectRange", + "description": "effectRange" }, "limiters": { "type":"array", @@ -42,7 +42,7 @@ }, "type": { "type":"string", - "description": "type", + "description": "type" } } }, @@ -62,41 +62,41 @@ "type":"array", "items": { "type":"string", - "description": "0", + "description": "0" } } - ], + ] }, "sourceID": { "type":"number", - "description": "sourceID", + "description": "sourceID" }, "sourceType": { "type":"string", - "description": "sourceType", + "description": "sourceType" }, "subtype": { "anyOf" : [ { "type" : "string" }, { "type" : "number" } ], - "description": "subtype", + "description": "subtype" }, "turns": { "type":"number", - "description": "turns", + "description": "turns" }, "type": { "type":"string", - "description": "type", + "description": "type" }, "val": { "type":"number", - "description": "val", + "description": "val" }, "valueType": { "type":"string", - "description": "valueType", + "description": "valueType" } } } diff --git a/config/schemas/faction.json b/config/schemas/faction.json index b9bb4be74..335e65a32 100644 --- a/config/schemas/faction.json +++ b/config/schemas/faction.json @@ -73,7 +73,7 @@ }, "nativeTerrain": { "type":"string", - "description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses", + "description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses" }, "puzzleMap": { "type":"object", diff --git a/config/schemas/hero.json b/config/schemas/hero.json index ce47faee3..cd742511f 100644 --- a/config/schemas/hero.json +++ b/config/schemas/hero.json @@ -28,15 +28,15 @@ "properties":{ "creature": { "type":"string", - "description": "creature", + "description": "creature" }, "max": { "type":"number", - "description": "max", + "description": "max" }, "min": { "type":"number", - "description": "min", + "description": "min" } } } diff --git a/config/schemas/mod.json b/config/schemas/mod.json index febe841b1..4dd1649a7 100644 --- a/config/schemas/mod.json +++ b/config/schemas/mod.json @@ -3,7 +3,7 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI mod file format", "description" : "Format used to define main mod file (mod.json) in VCMI", - "required" : [ "name", "description", "version", "author", "contact" ], + "required" : [ "name", "description", "version", "author", "contact", "modType" ], "additionalProperties" : false, "properties":{ diff --git a/config/schemas/settings.json b/config/schemas/settings.json index e81ead63d..412ec9263 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -168,7 +168,7 @@ }, "threshold" : { "$ref" : "#/definitions/logLevelEnum", - "default" : "info", + "default" : "info" }, "coloredOutputEnabled" : { "type" : "boolean", diff --git a/config/sp_sounds.json b/config/sp_sounds.json index 763e72056..c2b5a6159 100644 --- a/config/sp_sounds.json +++ b/config/sp_sounds.json @@ -177,7 +177,7 @@ }, { "id": 34, - "soundfile": "ANIMDEAD.wav", + "soundfile": "ANIMDEAD.wav" }, { "id": 35, @@ -201,7 +201,7 @@ }, { "id": 39, - "soundfile": "ANIMDEAD.wav", + "soundfile": "ANIMDEAD.wav" }, { "id": 40 , @@ -315,7 +315,7 @@ }, { "id": 62, - "soundfile": "BLIND.wav", + "soundfile": "BLIND.wav" }, { "id": 63 , diff --git a/config/terrainViewPatterns.json b/config/terrainViewPatterns.json index 2e0a46bcd..1e8fd5879 100644 --- a/config/terrainViewPatterns.json +++ b/config/terrainViewPatterns.json @@ -283,6 +283,6 @@ "T-1,N", "N", "N" ], "minPoints" : 1 - }, + } ] } diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index 6470c092d..931d8ee19 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -635,6 +635,7 @@ void CCreatureHandler::loadCreatureJson(CCreature * creature, const JsonNode & c creature->level = config["level"].Float(); creature->animDefName = config["graphics"]["animation"].String(); + //FIXME: MOD COMPATIBILITY if (config["abilities"].getType() == JsonNode::DATA_STRUCT) { for(auto &ability : config["abilities"].Struct()) diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index 7a8b5e491..97b1691a4 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -699,7 +699,12 @@ bool JsonParser::extractElement(JsonNode &node, char terminator) } if (input[pos] == terminator) + { + //FIXME: MOD COMPATIBILITY: Too many of these right now, re-enable later + //if (comma) + //error("Extra comma found!", true); return true; + } if (!comma) error("Comma expected!", true);