如何调试为什么JSON文档无效?

时间:2018-12-30 08:48:20

标签: json

{
  "General":{
    "TimedPointsReward":{
      "Enabled":true,
      "Interval":5,
      "Groups":{
        "Default":{
          "Amount":5
        },
        "Premiums":{
          "Amount":15
        }
      }
    },
    "ItemsPerPage":15,
    "ShopDisplayTime":15.0,
    "ShopTextSize":1.3,
    "DbPathOverride":"",
    "DefaultKit":"House,starter"
  },
  "Kits":{
    "starter":{
      "DefaultAmount":2,
      "Price":20,
      "Description":"Starter Kit! (Raptor and Pteradon)",
      "OnlyFromSpawn":false,
      "Items":[
        {
          "Amount":1,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Armor/Saddles/PrimalItemArmor_PteroSaddle.PrimalItemArmor_PteroSaddle'"
 },
        {
          "Amount":1,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Armor/Saddles/PrimalItemArmor_RaptorSaddle.PrimalItemArmor_RaptorSaddle'"
        }
      ],
      "Dinos":[
        {
          "Level":100,
          "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Raptor/BionicRaptor_Character_BP.BionicRaptor_Character_BP'"
 },
        {
          "Level":100,
          "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Ptero/Ptero_Character_BP.Ptero_Character_BP'"
        }
      ]
    },
    "House":{
      "DefaultAmount":1,
      "Price":100,
      "Description":"House Kit! (Wood)",
      "Items":[
        {
          "Amount":20,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodFloor.PrimalItemStructure_WoodFloor'"
 },
        {
          "Amount":40,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodWall.PrimalItemStructure_WoodWall'"
 },
        {
          "Amount":20,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodCeiling.PrimalItemStructure_WoodCeiling'"
 },
        {
          "Amount":2,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodWallWithDoor.PrimalItemStructure_WoodWallWithDoor'"
 },
        {
          "Amount":2,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Stone/PrimalItemStructure_StoneDoor.PrimalItemStructure_StoneDoor'"
        }
      ]
    },
    "Survival":{
      "DefaultAmount":3,
      "Price":100,
      "MinLevel":1,
      "MaxLevel":20,
      "Description":"Survival Kit(Sword, Pickaxe, and Hatchet",
      "Items":[
        {
          "Amount":1,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItem_WeaponSword.PrimalItem_WeaponSword'"
        },
        {
          "Amount":1,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItem_WeaponMetalPick.PrimalItem_WeaponMetalPick'"
        },
        {
          "Amount":1,
          "Quality":0,
          "ForceBlueprint":false,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItem_WeaponMetalHatchet.PrimalItem_WeaponMetalHatchet'"
        }
      ]
    }
  },
  "ShopItems":{
    "ingots100":{
      "Type":"item",
      "Description":"Metal Ingot (100x)",
      "Price":200,
      "Items":[
        {
          "Quality":0,
          "ForceBlueprint":false,
          "Amount":100,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Resources/PrimalItemResource_MetalIngot.PrimalItemResource_MetalIngot'"
        }
      ]
    },
    "DinoArea":{
      "Type":"item",
      "Description":"Area For Your Dinos!",
      "Price":200,
      "Items":[
        {
          "Quality":0,
          "ForceBlueprint":false,
          "Amount":6,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodGateframe.PrimalItemStructure_WoodGateframe'" 
        },
        {
          "Quality":0,
          "ForceBlueprint":false,
          "Amount":6,
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Wooden/PrimalItemStructure_WoodGate.PrimalItemStructure_WoodGate'"
        }
      ]
    },
    "Rock Drake":{
      "Type":"dino",
      "Description":"Gives a Tamed Rock Drake",
      "Level":150,
      "Price":2000,
      "MinLevel":1,
      "MaxLevel":150,
      "Blueprint":"Blueprint'/Game/Aberration/Dinos/RockDrake/RockDrake_Character_BP.RockDrake_Character_BP'" 
    },
    "Rex":{
      "Type":"dino",
      "Description":"Gives a Tamed Rex",
      "Level":150,
      "Price":1000,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Rex/Rex_Character_BP.Rex_Character_BP'"
    },
    "Achatina":{
      "Type":"dino",
      "Description":"Gives a Snail",
      "Level":150,
      "Price":100,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Achatina/Achatina_Character_BP.Achatina_Character_BP'" 
    },
      "Allosaurus":{
      "Type":"dino",
      "Description":"Gives a Allosaurus",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Allosaurus/Allo_Character_BP.Allo_Character_BP'"
    },
     "Ankylosaurus":{
      "Type":"dino",
      "Description":"Gives a Ankylo",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Ankylo/Ankylo_Character_BP.Ankylo_Character_BP'"
     },
      "Argentavis":{
      "Type":"dino",
      "Description":"Gives a Argentavis",
      "Level":150,
      "Price":600,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Argentavis/Argent_Character_BP.Argent_Character_BP'"
     },
     "Araneo":{
      "Type":"dino",
      "Description":"Gives a Araneo",
      "Level":150,
      "Price":200,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Spider-Small/SpiderS_Character_BP.SpiderS_Character_BP'"
     },
      "Arthropluera":{
      "Type":"dino",
      "Description":"Gives a Arthropluera",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Arthropluera/Arthro_Character_BP.Arthro_Character_BP'" 
     },
     "Baryonx":{
      "Type":"dino",
      "Description":"Gives a Baryonyx",
      "Level":150,
      "Price":200,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Baryonyx/Baryonyx_Character_BP.Baryonyx_Character_BP'" 
     },
      "Castoroides":{
      "Type":"dino",
      "Description":"Gives a Beaver",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Beaver/Beaver_Character_BP.Beaver_Character_BP'" 
    },
     "Daeodon":{
      "Type":"dino",
      "Description":"Gives a Pig",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Daeodon/Daeodon_Character_BP.Daeodon_Character_BP'" 
    },
      "Diplodocus":{
      "Type":"dino",
      "Description":"Gives a Disappointment",
      "Level":150,
      "Price":100,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Diplodocus/Diplodocus_Character_BP.Diplodocus_Character_BP'" 
     },
     "Doedicurus":{
      "Type":"dino",
      "Description":"Gives a Doedicurus",
      "Level":150,
      "Price":200,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Doedicurus/Doed_Character_BP.Doed_Character_BP'" 
    },
      "Bronto":{
      "Type":"dino",
      "Description":"Gives a Bronto",
      "Level":150,
      "Price":800,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Sauropod/Sauropod_Character_BP.Sauropod_Character_BP'"  
     },
     "Carnotaurus":{
      "Type":"dino",
      "Description":"Gives a Carno",
      "Level":150,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Carno/Carno_Character_BP.Carno_Character_BP'" 
     },
      "Bee":{
      "Type":"dino",
      "Description":"Gives a Giant Bee",
      "Level":150,
      "Price":400,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Bee/Bee_Character_BP.Bee_Character_BP'" 
    },
     "Giganotosaurus":{
      "Type":"dino",
      "Description":"Gives a Giga",
      "Level":150,
      "Price":1500,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Giganotosaurus/Gigant_Character_BP.Gigant_Character_BP'"
    },
      "Pteranodon":{
      "Type":"dino",
      "Description":"Gives a Pteranodon",
      "Level":150,
      "Price":100,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Ptero/Ptero_Character_BP.Ptero_Character_BP'"  
    },
     "Quetzal":{
      "Type":"dino",
      "Description":"Gives a Quetzale",
      "Level":150,
      "Price":800,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Quetzalcoatlus/Quetz_Character_BP.Quetz_Character_BP'"  
    },
      "Rex":{
      "Type":"dino",
      "Description":"Gives a T-Rex",
      "Level":150,
      "Price":1000,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Rex/Rex_Character_BP.Rex_Character_BP'"  
    },
     "Spinosaurus":{
      "Type":"dino",
      "Description":"Gives a Spino",
      "Level":150,
      "Price":500,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Spino/Spino_Character_BP.Spino_Character_BP'" 
    },
      "Stegosaurus":{
      "Type":"dino",
      "Description":"Gives a Stego",
      "Level":150,
      "Price":100,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Stego/Stego_Character_BP.Stego_Character_BP'"  
    },
     "Tapejara":{
      "Type":"dino",
      "Description":"Gives a Tapejara",
      "Level":150,
      "Price":400,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Tapejara/Tapejara_Character_BP.Tapejara_Character_BP'"  
    },
      "Therizinosaur":{
      "Type":"dino",
      "Description":"Gives a Therizinosaur",
      "Level":150,
      "Price":500,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Therizinosaurus/Therizino_Character_BP.Therizino_Character_BP'"  
    },
     "Titanosaur":{
      "Type":"dino",
      "Description":"Gives a Titanosaur",
      "Level":10,
      "Price":5000,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Titanosaur/Titanosaur_Character_BP.Titanosaur_Character_BP'" 
    },
      "Yutyrannus":{
      "Type":"dino",
      "Description":"Gives a Yutyrannus",
      "Level":150,
      "Price":1000,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/PrimalEarth/Dinos/Yutyrannus/Yutyrannus_Character_BP.Yutyrannus_Character_BP'"  
    },
     "Phoenix":{
      "Type":"dino",
      "Description":"Gives a Phoenix",
      "Level":100,
      "Price":300,
      "Neutered":false,
      "Blueprint":"Blueprint'/Game/ScorchedEarth/Dinos/Phoenix/Phoenix_Character_BP.Phoenix_Character_BP'" 
    },
    "exp1000":{
      "Type":"experience",
      "Description":"1000 points of experience and works on dinos",
      "GiveToDino":True,
      "Price":50,
      "Amount":1000.0
      },
       "tekengram":{  
      "Type":"unlockengram",
      "Description":"Engram TEK Boots & Gloves",
      "Price":20,
      "Items":[  
        {  
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Armor/TEK/PrimalItemArmor_TekBoots.PrimalItemArmor_TekBoots'"
        },
        {  
          "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Armor/TEK/PrimalItemArmor_TekGloves.PrimalItemArmor_TekGloves'"
        }
      ]
    },
      "allengrams":{
      "Type":"command",
      "Description":"All engrams",
      "Price":2000,
      "Items":[
      {
          "Command":"GiveEngrams"
    }
   ]
  }
 },
  "SellItems":{
    "metal":{
      "Type":"item",
      "Description":"100x metal",
      "Price":10,
      "Amount":50,
      "Blueprint":"Blueprint'/Game/PrimalEarth/CoreBlueprints/Resources/PrimalItemResource_Metal.PrimalItemResource_Metal'"
    }
  },
  "Messages":{
    "Sender":"ArkShop",
    "BoughtItem":"<RichColor Color=\"0, 1, 0, 1\">You have successfully bought item</>",
    "BoughtDino":"<RichColor Color=\"0, 1, 0, 1\">You have successfully bought dino</>",
    "BoughtBeacon":"<RichColor Color=\"0, 1, 0, 1\">You have successfully bought beacon</>",
    "BoughtExp":"<RichColor Color=\"0, 1, 0, 1\">You have successfully bought experience</>",
    "ReceivedPoints":"<RichColor Color=\"1, 1, 0, 1\">You have received {0} points! (total: {1})</>",
    "HavePoints":"You have {0} points",
    "NoPoints":"<RichColor Color=\"1, 0, 0, 1\">You don't have enough points</>",
    "WrongId":"<RichColor Color=\"1, 0, 0, 1\">Wrong id</>",
    "NoPermissionsKit":"<RichColor Color=\"1, 0, 0, 1\">You don't have permission to use this kit</>",
    "CantBuyKit":"<RichColor Color=\"1, 0, 0, 1\">You can't buy this kit</>",
    "BoughtKit":"<RichColor Color=\"0, 1, 0, 1\">You have successfully bought {0} kit</>",
    "AvailableKits":"Available kits for you:",
    "NoKits":"No available kits",
    "KitsLeft":"You have {0} {1} kits left",
    "NoKitsLeft":"You don't have {0} kits left",
    "CantGivePoints":"<RichColor Color=\"1, 0, 0, 1\">You can't give points to yourself</>",
    "RidingDino":"<RichColor Color=\"1, 0, 0, 1\">You can't buy this item while riding a dino</>",
    "SentPoints":"<RichColor Color=\"0, 1, 0, 1\">You have successfully sent {0} points to {1}</>",
    "GotPoints":"You have received {0} points from {1}",
    "NoPlayer":"<RichColor Color=\"1, 0, 0, 1\">Player doesn't exist</>",
    "FoundMorePlayers":"<RichColor Color=\"1, 0, 0, 1\">Found more than one player with the given name</>",
    "BuyUsage":"Usage: /buy id amount",
    "ShopUsage":"Usage: /shop page",
    "KitUsage":"Usage: /kit KitName",
    "BuyKitUsage":"Usage: /BuyKit KitName amount",
    "TradeUsage":"Usage: /trade 'Player Name' amount",
    "PointsCmd":"/points",
    "TradeCmd":"/trade",
    "BuyCmd":"/buy",
    "ShopCmd":"/shop",
    "KitCmd":"/kit",
    "BuyKitCmd":"/buykit",
    "SellCmd":"/sell",
    "ShopSellCmd":"/shopsell",
    "SellUsage":"Usage: /sell id amount",
    "NotEnoughItems":"<RichColor Color=\"1, 0, 0, 1\">You don't have enough items ({0}/{1})</>",
    "SoldItems":"<RichColor Color=\"0, 1, 0, 1\">You have successfully sold items</>",
    "BadLevel":"<RichColor Color=\"1, 0, 0, 1\">Required level: {0} - {1}</>",
    "KitsListPrice":"Price: {0}",
    "KitsListFormat":"\"{0}\" - {1}. {2} left. {3}\n",
    "StoreListDino":"{0}) {1}. Level: {2}. Id: {3}. Price: {4}\n",
    "StoreListItem":"{0}) {1}. Id: {2}. Price: {3}\n",
    "StoreListFormat":"{0}",
    "OnlyOnSpawnKit":"This kit can be used only on spawn"
  }
}

我不断收到错误消息:

  

[arkshop] [错误] [json.exception.parse_error.101]在5157处解析错误:语法错误-意外的'{';预期的'}'

请问有关如何修复它的帮助,这是针对ark服务器点系统的。我确定我做错了什么,只是想不通。我去了一个网站,它指出我在第一行中遇到了一个错误问题,因此我猜测它只是没有正确关闭在需要的位置。我希望这是唯一的问题,因为我是使用c ++代码的新手。

1 个答案:

答案 0 :(得分:0)

您可以使用任何JSON验证器(包括https://jsonlint.com/之类的在线验证器)来验证JSON文件。您当前的JSON有两个错误:

  1. import java.util.Collection; import java.util.Iterator; public class FBag<E> implements Iterable<E> { public static final FBag EMPTY = new FBag<>(null, null); private final FBag<E> next; private final E val; private FBag(E val, FBag<E> next) { this.val = val; this.next = next; } public FBag<E> add(E val) { return new FBag<>(val, this); } @Override public Iterator<E> iterator() { return new Iter<>(this); } public static FBag make(Collection c) { var p = EMPTY; for (var a : c) { p = p.add(a); } return p; } public static FBag make(Object[] c, int from, int to) { var p = EMPTY; for (var i = from; i < to; i++) { p = p.add(c[i]); } return p; } public FBag<E> remove(E val) { if (this == EMPTY) { return this; } if (this.val == val) { return next; } return new FBag<>(this.val, next.remove(val)); } private static class Iter<E1> implements Iterator { private FBag<E1> p; Iter(FBag<E1> p) { this.p = p; } @Override public boolean hasNext() { return p != EMPTY; } @Override public Object next() { assert p != EMPTY; var r = p.val; p = p.next; return r; } } } (在第363行),->如果要将"GiveToDino": True用作布尔值,请将True更改为true
  2. Rex(在第152和296行)是重复的密钥。您应该将其中一个键更改为其他键。

如果您在当前版本中解决了这两个错误,则将拥有有效的JSON。