Hi there,
When I attempt to to perform "oxide.reload" using rust.RunServerCommand I get the following error.
I do not get the error when performing oxide.reload through RCON. I tried using the PluginManager and Interface classes to perform reload, but received the same error.Code:Failed to load plugin (ArgumentException: An element with the same key already exists in the dictionary.) [Oxide] 5:57 PM [Debug] at System.Collections.Generic.Dictionary`2[System.String,Jint.Runtime.Descriptors.PropertyDescriptor].Add (System.String key, Jint.Runtime.Descriptors.PropertyDescriptor value) [0x00000] in <filename unknown>:0 at Jint.Native.Object.ObjectInstance.FastAddProperty (System.String name, JsValue value, Boolean writable, Boolean enumerable, Boolean configurable) [0x00000] in <filename unknown>:0 at Oxide.Ext.JavaScript.Plugins.JavaScriptPlugin.Load () [0x00000] in <filename unknown>:0 at Oxide.Ext.JavaScript.Plugins.JavaScriptPluginLoader.Load (System.String directory, System.String name) [0x00000] in <filename unknown>:0 at Oxide.Core.OxideMod.LoadPlugin (System.String name) [0x00000] in <filename unknown>:0
Failed to load plugin (ArgumentException)
Discussion in 'Rust Development' started by Your Old Best Friend, Apr 16, 2015.
-
Wulf Community Admin
Which plugin are you trying to reload? The actual important part of the error says that you already have a plugin installed that is likely using the same command as the one you are trying to reload.
-
I have 2 custom unreleased mods that are doing this, both Javascript. RankAndTitles does this as well, also Javascript.
-
Wulf Community Admin
-
[DOUBLEPOST=1429222202][/DOUBLEPOST] -
Wulf Community Admin
-
[DOUBLEPOST=1429222484][/DOUBLEPOST]I just tested the oxide.reload through RunServerCommand on m-Teleportation.lua which also registers several chat commands. That reloaded successfully, unlike any of the Javascript plugins.
[DOUBLEPOST=1429222606][/DOUBLEPOST]It seems to be only Javascript plugins when a reload is attempted through Oxide RunServerCommand/PluginManager.
[DOUBLEPOST=1429222823][/DOUBLEPOST]Okay I think I get what you are saying now. You are asking me if any of the other mods are accessing my mod through commands and that therefore is preventing a successful reload. I don't think that is the case, I will investigate more.
[DOUBLEPOST=1429223498][/DOUBLEPOST]It works perfectly through RCON. -
"An element with the same key already exists in the dictionary" - should explain everything.
Look at what's happeping on reload, how those Dictionary being filled and with what. -
Calytic Community Admin Community Mod
Just letting people know who might search for this, I managed to figure a fix using the following code:
Code:var p = plugins.Find(pluginName); if(p !== null) { this.Plugin.Manager.RemovePlugin(p); this.Plugin.Manager.AddPlugin(p); }