KeyNotFoundException at StatsUICommandError

Players reported ZLevelsRemastered not working this morning. Found this in my console:

11/10/2021 13:18:57 | Failed to call hook 'StatsUICommand' on plugin 'ZLevelsRemastered v3.0.0' (KeyNotFoundException: The given key was not present in the dictionary.)
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <eae584ce26bc40229c1b1aa476bfa589>:0
at Oxide.Plugins.ZLevelsRemastered.StatsUICommand (BasePlayer player, System.String command, System.String[] args) [0x00012] in <6e007f97ff1f492da0ed3d1fc0b30d51>:0
at Oxide.Plugins.ZLevelsRemastered.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00d74] in <6e007f97ff1f492da0ed3d1fc0b30d51>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <9882f28dc2204b4dba514a9ad18f5042>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <9882f28dc2204b4dba514a9ad18f5042>:0

I reloaded the plugin with no errors, so I assume it's working again but I wanted to share that in case it can help identify a problem.

ok thanks ill look into it

It's down again this morning. Same error. Reloading it will probably fix it, but this happened after the server was restarted.

seems like something was removed from the config. can you post it via pastebin?

nivex

seems like something was removed from the config. can you post it via pastebin?

https://pastebin.com/uhbQQPgu

If it's a config issue, why does it load fine when I do a manual o.reload but when the server starts, that's where it fails?

added this to line 1159:

if (!playerPrefs.PlayerInfo.ContainsKey(player.userID)) UpdatePlayer(player);​

it should hopefully fix the issue. either way its fixed in next update

nivex

added this to line 1159:

if (!playerPrefs.PlayerInfo.ContainsKey(player.userID)) UpdatePlayer(player);​

it should hopefully fix the issue. either way its fixed in next update

Do I replace that line with what you posted? If so, I get this error:

11/12 06:19:24 | Error while compiling: ZLevelsRemastered.cs(1166,12): error CS1525: Unexpected symbol `else'

no just add it to the first line in that method

nivex

no just add it to the first line in that method

What do you mean "to the first line in that method" ?  I ask cause we're having issues where crafting no longer gives experience to ZLevels. We wiped all players ZLevels to start fresh, and Crafting is the only one not being recognized and updating, so I thought this might help, but maybe not for this issue.

go to the line I stated, go under the bracket to the first line, and then insert the above code on that line and press enter. save the file. load the plugin

nivex

go to the line I stated, go under the bracket to the first line, and then insert the above code on that line and press enter. save the file. load the plugin


How's this?

perfect

The funny thing is that I haven't applied this fix and the error isn't happening anymore. 

FDSHh1dppsApsWB.jpg BetterDeadThanZed

The funny thing is that I haven't applied this fix and the error isn't happening anymore. 

For us, we can't get crafting to work, even after downloading the latest and installing it. So I don't get what's going on.

@Pouncer012 you're still getting errors after trying that fix?