diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 245c460644..c335a6e98e 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -202,6 +202,9 @@ namespace pCampBot "bot", false, "stand", "stand", "Stand all bots.", HandleStand); + m_console.Commands.AddCommand( + "bot", false, "set bots", "set bots ", "Set a setting for all bots.", HandleSetBots); + m_console.Commands.AddCommand( "bot", false, "show regions", "show regions", "Show regions known to bots", HandleShowRegions); @@ -519,6 +522,30 @@ namespace pCampBot Environment.Exit(0); } + private void HandleSetBots(string module, string[] cmd) + { + string key = cmd[2]; + string rawValue = cmd[3]; + + if (key == "SEND_AGENT_UPDATES") + { + bool newSendAgentUpdatesSetting; + + if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting)) + return; + + MainConsole.Instance.OutputFormat( + "Setting SEND_AGENT_UPDATES to {0} for all bots", newSendAgentUpdatesSetting); + + lock (m_bots) + m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting); + } + else + { + MainConsole.Instance.Output("Error: Only setting currently available is SEND_AGENT_UPDATES"); + } + } + private void HandleShowRegions(string module, string[] cmd) { string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}";