Jump to content

compilation error

Pending 2.3.2

TuxGeek
TuxGeek

Posted

Hello, with the newest version of the plugin on carbon im getting this error

Requested 'PlayerRanks' for compilation
Failed to compile 'PlayerRanks':  (Invalid character after parsing property name. Expected ':' but got: ,. Path 'clan', line 29, position 13.)
   at bool Newtonsoft.Json.JsonTextReader.ParseProperty()
   at bool Newtonsoft.Json.JsonTextReader.ParseObject()
   at bool Newtonsoft.Json.JsonTextReader.Read()
   at object Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, string id)
   at object Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue)
   at object Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue)
   at object Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, bool checkAdditionalContent)
   at object Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at object Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at object Newtonsoft.Json.JsonConvert.DeserializeObject(string value, Type type, JsonSerializerSettings settings)
   at Dictionary<string, string> Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(string value, JsonSerializerSettings settings) x 2
   at Dictionary<string, string> Oxide.Core.Libraries.Lang.GetMessageFile(string plugin, string lang) in /__w/Carbon/Carbon/Carbon.Core/Carbon.Components/Carbon.Common/src/Oxide/Libraries/Lang.cs:line 93
   at new Oxide.Core.Libraries.Lang(BaseHookable plugin) in /__w/Carbon/Carbon/Carbon.Core/Carbon.Components/Carbon.Common/src/Oxide/Libraries/Lang.cs:line 14
   at void Oxide.Plugins.RustPlugin.Setup(string name, string author, VersionNumber version, string description) in /__w/Carbon/Carbon/Carbon.Core/Carbon.Components/Carbon.Common/src/Oxide/RustPlugin.cs:line 43
   at void Oxide.Plugins.RustPlugin.SetupMod(Package mod, string name, string author, VersionNumber version, string description) in /__w/Carbon/Carbon/Carbon.Core/Carbon.Components/Carbon.Common/src/Oxide/RustPlugin.cs:line 26
   at bool Carbon.Core.ModLoader.InitializePlugin(Type type, out RustPlugin plugin, Package package, Action<RustPlugin> preInit, bool precompiled) in /__w/Carbon/Carbon/Carbon.Core/Carbon.Components/Carbon.Common/src/Carbon/Modding/ModLoader.cs:line 236
   at IEnumerator Carbon.Managers.ScriptLoader.Compile()+MoveNext() in /__w/Carbon/Carbon/Carbon.Core/Carbon/src/Loaders/ScriptLoader.cs:line 498

  • Administrator
Steenamaroo

Posted

".Lang.GetMessageFile"
 

Have you modified the PlayerRanks lang file recently?
Delete it (back it up if you want) and reload the plugin.

TuxGeek

Posted

i deleted the file and it compiled however i never edited the file so im curious as to how that happened

  • Administrator
Steenamaroo

Posted

Do you still have it in your recycle bin or a backup?

If so PM it to me. 👍

The error was definitely with reading the lang file so at some point it got modified or damaged.

TuxGeek

Posted

i do not however the problem is fixed, The last backup i have is from right before force wipe and everything worked at that time. Here is the file from that time though

PlayerRanks.json

  • Administrator
Steenamaroo

Posted (edited)

That file looks fine, as you thought.

The error points to
`Invalid character after parsing property name. Expected ':' but got: ,. Path 'clan', line 29, position 13.`

That makes sense to me because line 29 it's right before 'losttitle' which, in older versions of PlayerRanks, had the variables backwards.

 

  "clan": "Clan",
  "tooktitle": "{0} has taken the title {1}.",
  "losttitle": "You have lost the title {0} to {1}.",

 

'losttitle', is the one that is wrong in most people's lang files,
so perhaps someone tried to fix that at some point?


Now that your file is working fine the fix for incorrect var placement would be to swap 0 + 1 in "losttitle"
like this

 

  "clan": "Clan",
  "tooktitle": "{0} has taken the title {1}.",
  "losttitle": "You have lost the title {1} to {0}.",

 

 

I have fixed this in PlayerRanks plugin but lang files don't automatically update changes for already existing entries,
leaving users to fix it manually.

 

Alternative, if your lang file is totally unmodified, you could just delete it then reload the plugin.
PlayerRanks will create a brand new file with the correction already in it.

Edited by Steenamaroo
TuxGeek

Posted

i deleted the lang file and let it recompile but it used the old order still so i set the 0 and 1 in the correct order for "losttitle". "tooktitle" was already correct

  • Administrator
Steenamaroo

Posted

Oh sorry, you're quite right. It's still wrong in the public version.
Noted and fixed for future updates. 👍

1.7m

Downloads

Total number of downloads.

7.9k

Customers

Total customers served.

119.4k

Files Sold

Total number of files sold.

2.4m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.