diff --git a/BSBshared/API/API_interface.cs b/BSBshared/API/API_interface.cs index 5f91049..d257171 100644 --- a/BSBshared/API/API_interface.cs +++ b/BSBshared/API/API_interface.cs @@ -36,7 +36,7 @@ namespace BetterSecondBotShared.API } return null; } - protected virtual void LoadCommandsList() + protected virtual void LoadCommandsList(bool wikimode) { foreach (var com in GetAPICommandClasses()) { @@ -47,7 +47,12 @@ namespace BetterSecondBotShared.API API_interface D = (API_interface)Activator.CreateInstance(com); if (D != null) { - if (subtype_map.ContainsKey(D.CommandNameLower) == false) + string name = D.CommandNameLower; + if(wikimode == true) + { + name = D.CommandName; + } + if (subtype_map.ContainsKey(name) == false) { string worknamespace = com.Namespace; worknamespace = worknamespace.Replace("BSB.Commands.", ""); @@ -57,8 +62,8 @@ namespace BetterSecondBotShared.API worknamespace = worknamespace.Replace("BetterSecondBot.HttpServer.Control.", ""); worknamespace = worknamespace.Replace("BetterSecondBot.HttpServer.control.", ""); worknamespace = worknamespace.Replace("CMD_", ""); - subtype_map.Add(D.CommandNameLower, D.GetType()); - subtype_workspace_map.Add(D.CommandNameLower, worknamespace); + subtype_map.Add(name, D.GetType()); + subtype_workspace_map.Add(name, worknamespace); } else { @@ -102,7 +107,7 @@ namespace BetterSecondBotShared.API { if (subtype_map.Count() == 0) { - LoadCommandsList(); + LoadCommandsList(false); } return subtype_map.ContainsKey(command); } diff --git a/CLI/WikiMake/wikimake.cs b/CLI/WikiMake/wikimake.cs index 7f44766..f0cbb80 100644 --- a/CLI/WikiMake/wikimake.cs +++ b/CLI/WikiMake/wikimake.cs @@ -289,12 +289,12 @@ namespace BetterSecondBot.WikiMake InterfaceWiki("JSON", defaultJson); // CMD - BSB.Commands.CoreCommandsInterface cmd = new BSB.Commands.CoreCommandsInterface(null); + BSB.Commands.CoreCommandsInterface cmd = new BSB.Commands.CoreCommandsInterface(null,true); api_reports.Add("Core", new KeyValuePair(cmd.ApiCommandsCount, "Good")); InterfaceWiki("Core", cmd, true); // RLVapi - BSB.RLV.RLVcontrol RLVapi = new BSB.RLV.RLVcontrol(null); + BSB.RLV.RLVcontrol RLVapi = new BSB.RLV.RLVcontrol(null,true); api_reports.Add("RLVapi", new KeyValuePair(RLVapi.ApiCommandsCount, "Limited")); InterfaceWiki("RLVapi", RLVapi, true); diff --git a/Core/Commands/commandlib.cs b/Core/Commands/commandlib.cs index 9a4a6c5..7279d0d 100644 --- a/Core/Commands/commandlib.cs +++ b/Core/Commands/commandlib.cs @@ -125,11 +125,11 @@ namespace BSB.Commands } } - public CoreCommandsInterface(CommandsBot linktobot) + public CoreCommandsInterface(CommandsBot linktobot, bool wikimode) { bot = linktobot; API_type = typeof(CoreCommand); - LoadCommandsList(); + LoadCommandsList(wikimode); } protected HttpClient HTTPclient = new HttpClient(); diff --git a/Core/RLV/RLV_commandlib.cs b/Core/RLV/RLV_commandlib.cs index 58fe378..2adf549 100644 --- a/Core/RLV/RLV_commandlib.cs +++ b/Core/RLV/RLV_commandlib.cs @@ -21,11 +21,11 @@ namespace BSB.RLV last_caller_uuid = callerUUID; } - public RLVcontrol(RLVbot linktobot) + public RLVcontrol(RLVbot linktobot, bool wikimode) { bot = linktobot; API_type = typeof(RLV_command); - LoadCommandsList(); + LoadCommandsList(wikimode); } protected List suppress_warning = new List(); diff --git a/Core/bottypes/CommandsBot.cs b/Core/bottypes/CommandsBot.cs index 098d4d1..131d3e5 100644 --- a/Core/bottypes/CommandsBot.cs +++ b/Core/bottypes/CommandsBot.cs @@ -14,7 +14,7 @@ namespace BSB.bottypes { protected CommandsBot() { - CommandsInterface = new Commands.CoreCommandsInterface(this); + CommandsInterface = new Commands.CoreCommandsInterface(this,false); } protected List CommandHistory = new List(); @@ -194,7 +194,7 @@ namespace BSB.bottypes { if (reconnect == false) { - CommandsInterface = new Commands.CoreCommandsInterface(this); + CommandsInterface = new Commands.CoreCommandsInterface(this,false); } Client.Self.RequestBalance(); base.AfterBotLoginHandler(); diff --git a/Core/bottypes/RLVbot.cs b/Core/bottypes/RLVbot.cs index 05484fe..68dade0 100644 --- a/Core/bottypes/RLVbot.cs +++ b/Core/bottypes/RLVbot.cs @@ -21,7 +21,7 @@ namespace BSB.bottypes if (myconfig.Setting_AllowRLV == true) { Info("RLV: Enabled"); - RLVinterface = new RLV.RLVcontrol(this); + RLVinterface = new RLV.RLVcontrol(this,false); } } }