KeyNotFoundException at GetConfigStringFixed

looks like this is triggered after palyer dies

Failed to call hook 'OnTick' on plugin 'Diseases v1.0.4' (KeyNotFoundException: The given key was not present in the dictionary.)
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <fb001e01371b4adca20013e0ac763896>:0 
  at Oxide.Plugins.Diseases.GetConfigString (System.String menu, System.String key) [0x00012] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.Diseases.ShowIndicatorCUI (BasePlayer player) [0x0000c] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.Diseases+Disease.Infect (BaseEntity entity, System.Boolean force) [0x000fc] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.Diseases.AttemptOutbreak (Oxide.Plugins.Diseases+Disease disease, System.Boolean force) [0x00104] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.Diseases.OnTick () [0x0004f] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.Diseases.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0056e] in <1ccd47d87d8d4789950165f76ff85f01>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <80b90e8213db44b29ec2d4111764172c>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ec05e0208c9149bba43236ca58fea105>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ec05e0208c9149bba43236ca58fea105>:0 

Spent all day rewriting the plugin, this issue (and others) should be fixed in 1.0.5. *Fingers crossed*

gotta watch those NRE's,
sometimes it gets real crazy with them hiding out in objects nested 3 or 4 layers down an object chain....

Merged post

ok this is not fixed, it is still occuring

Still getting this...
Even after update  & reboot.

Generally after there are more players on the server.

Alright I have a little more experience to tackle this now, I'll try to get to it soon.

yep.. it only does it with more players... so maybe a re-entancy issue...

Merged post

ok... same as other plugin , delete config.
perhaps you should stick a version number in your config file...

8YO1cglnMhMSvTB.jpg razorfishsl

yep.. it only does it with more players... so maybe a re-entancy issue...

Merged post

ok... same as other plugin , delete config.
perhaps you should stick a version number in your config file...

I revamped how the config is handled now in 1.1.1, it will just pull the default value now if theres an error in the config. The disease data file though is still very sensitive... so be careful with that.

I also did away with my old method of handling ticks with checking timestamps and used the standard method of timers. I also utilized "entity.IsValid() instead of entity != null", which will hopefully fix a lot of the null reference issues.

In addition, theres also a new config option to set the "maximum number of infected entities" so you can have some say in how much resources this plugin will eat up.

Let me know if you find any more serious issues with this new version... hopefully its relatively stable now.

just be a bit careful with ".IsValid"  since it is an object call, it can STILL fail, not to mention it is WAY slower that !=null, so use it sparingly.

Perhaps some work on your development flow... towards say... testing... ;-)
Writing code is easy, most of the time goes into thinking & testing... and more testing.... then some more...

What is sometimes not considered is the secondary impacts of  throwing errors...
1. significant delays during the call to output routines
2. unwinding the stack.
3. the MASSIVE log files that can result & relevent disk write hits. (I had a case recently of 1-2 GB a day of log files with 1 plugin )

anyway lets give  the new one a spin

Locked automatically