aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-22 23:11:05 +0100
committerJustin Clark-Casey (justincc)2013-08-22 23:11:05 +0100
commit51c7fb1969f4850750de4b37827e5e2e9d85f3e0 (patch)
tree29adcd196daaf08987996dc4084bf4d26c533952 /OpenSim/Tools
parentStop "handle sit user name" command from trying to sit avatars on objects whi... (diff)
downloadopensim-SC_OLD-51c7fb1969f4850750de4b37827e5e2e9d85f3e0.zip
opensim-SC_OLD-51c7fb1969f4850750de4b37827e5e2e9d85f3e0.tar.gz
opensim-SC_OLD-51c7fb1969f4850750de4b37827e5e2e9d85f3e0.tar.bz2
opensim-SC_OLD-51c7fb1969f4850750de4b37827e5e2e9d85f3e0.tar.xz
Add "set bots" command to make it possible to set SEND_AGENT_UPDATES on all bots whilst pCampbot is running
Diffstat (limited to 'OpenSim/Tools')
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 245c460..c335a6e 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -203,6 +203,9 @@ namespace pCampBot
203 HandleStand); 203 HandleStand);
204 204
205 m_console.Commands.AddCommand( 205 m_console.Commands.AddCommand(
206 "bot", false, "set bots", "set bots <key> <value>", "Set a setting for all bots.", HandleSetBots);
207
208 m_console.Commands.AddCommand(
206 "bot", false, "show regions", "show regions", "Show regions known to bots", HandleShowRegions); 209 "bot", false, "show regions", "show regions", "Show regions known to bots", HandleShowRegions);
207 210
208 m_console.Commands.AddCommand( 211 m_console.Commands.AddCommand(
@@ -519,6 +522,30 @@ namespace pCampBot
519 Environment.Exit(0); 522 Environment.Exit(0);
520 } 523 }
521 524
525 private void HandleSetBots(string module, string[] cmd)
526 {
527 string key = cmd[2];
528 string rawValue = cmd[3];
529
530 if (key == "SEND_AGENT_UPDATES")
531 {
532 bool newSendAgentUpdatesSetting;
533
534 if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting))
535 return;
536
537 MainConsole.Instance.OutputFormat(
538 "Setting SEND_AGENT_UPDATES to {0} for all bots", newSendAgentUpdatesSetting);
539
540 lock (m_bots)
541 m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting);
542 }
543 else
544 {
545 MainConsole.Instance.Output("Error: Only setting currently available is SEND_AGENT_UPDATES");
546 }
547 }
548
522 private void HandleShowRegions(string module, string[] cmd) 549 private void HandleShowRegions(string module, string[] cmd)
523 { 550 {
524 string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}"; 551 string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}";