Failed to call hook 'OnServerInitialized' on plugin 'CupboardLimiter v1.2.2' (ArgumentException: An item with the same key has already been added. Key: 40161)
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <fb001e01371b4adca20013e0ac763896>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <fb001e01371b4adca20013e0ac763896>:0
at Oxide.Plugins.CupboardLimiter.OnServerInitialized () [0x000c2] in <d9b213cef9964843877a890d2298a83a>:0
at Oxide.Plugins.CupboardLimiter.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001fa] in <d9b213cef9964843877a890d2298a83a>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <3606d2af539c45e4b5c61658e6a8b307>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0 ArgumentException at OnServerInitializedFixed
tried a clean install ?
Running this on my own server and dont have the error
Thanks for the quick response! I did try clean install - steam update and then Oxide v2.0.4919 followed by only that plugin and it errors on server startup in the console. If I swap to 1.2.1 and restart, no error. Swap back to 1.2.2 and restart the server and the error is there.
UPDATE/Fixed: Ok I'm sleep deprived ... so when I said clean install I didn't wipe the map and all data etc. After doing that no error on startup. Maybe the new performance stuff in 1.2.2 doesn't like existing TC's? Either way a map wipe seems to take care of the error will update status if it reappears later, thank you!
Ty for reporting the issue ill have some testing adding this midwipe
Check on server startup error messages. After a TC is placed on the map, the error is there. Doing more testing - pure vanilla no other plugins will give more details.
Thx i still dont have your issue and i allso run raidable bases (excluded from listing tho).
bool debug = false;inside the plugin can be set to true and reupload it and do a extra reload to have the debug mode active (have not added this to cfg yet).
to see what happens on certain actions (this will be extended to have a more expanded overview on actions)
you can find this allmost on top of main coding block
Okay I finally got some time to test this, here are results -
1) 03/01/2021 - updated rust server, oxide v2.0.4919 - no plugins except CupboardLimiter v1.2.2 (debug on)
all server data (map, bp's etc) wiped and server startup, no errors
2) quit/restart server to check for any startup errors ... no errors
3) log in with a player and place down a foundation and then a tc on it, then log out player
[Cupboard Limiter] a cupboard is spawning in world
[Cupboard Limiter] sleep|offline check
[Cupboard Limiter] bypass was triggered
4) quit/restart rust server
Failed to call hook 'OnServerInitialized' on plugin 'CupboardLimiter v1.2.2' (ArgumentException: An item with the same key has already been added. Key: 9329)
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <fb001e01371b4adca20013e0ac763896>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <fb001e01371b4adca20013e0ac763896>:0
at Oxide.Plugins.CupboardLimiter.OnServerInitialized () [0x000c2] in <7e132cccd5bd4a50b597f00fca90cac3>:0
at Oxide.Plugins.CupboardLimiter.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001fa] in <7e132cccd5bd4a50b597f00fca90cac3>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <3606d2af539c45e4b5c61658e6a8b307>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0
The error happens in the server console when the server is restarting.
If rolled back to v1.21 the error doesn't happen.
Give it a try, you should be able to recreate this.
So far i have seen this once during startup
Ill see for a small delay when startup is finished to start the routine.
Thx for the reports
Anytime, thank you for the plugin! :)
should be fixed in version 1.2.3
Nice timing! Grabbing now and will be testing this wipe. Assume fixed if I don't report back here and thank you!