aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-20 18:41:09 +0100
committerJustin Clark-Casey (justincc)2013-08-20 18:41:09 +0100
commita3e1b278a1d82e231f85bf0bf181ed79bbdaa7f2 (patch)
treeab031752a9ab84a0a89cb5d6e6d9f617c6304fa8 /OpenSim/Tools/pCampBot
parentAdd --regex options to "sit user name" and "stand user name" console commands... (diff)
downloadopensim-SC_OLD-a3e1b278a1d82e231f85bf0bf181ed79bbdaa7f2.zip
opensim-SC_OLD-a3e1b278a1d82e231f85bf0bf181ed79bbdaa7f2.tar.gz
opensim-SC_OLD-a3e1b278a1d82e231f85bf0bf181ed79bbdaa7f2.tar.bz2
opensim-SC_OLD-a3e1b278a1d82e231f85bf0bf181ed79bbdaa7f2.tar.xz
Add pCampbot "show bot" console command to show more detailed information on a particular bot (e.g. what sims they are connected to)
Diffstat (limited to 'OpenSim/Tools/pCampBot')
-rw-r--r--OpenSim/Tools/pCampBot/Bot.cs11
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs49
2 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs
index 27c086e..d418288 100644
--- a/OpenSim/Tools/pCampBot/Bot.cs
+++ b/OpenSim/Tools/pCampBot/Bot.cs
@@ -97,11 +97,20 @@ namespace pCampBot
97 /// </summary> 97 /// </summary>
98 public ConnectionState ConnectionState { get; private set; } 98 public ConnectionState ConnectionState { get; private set; }
99 99
100 public List<Simulator> Simulators
101 {
102 get
103 {
104 lock (Client.Network.Simulators)
105 return new List<Simulator>(Client.Network.Simulators);
106 }
107 }
108
100 /// <summary> 109 /// <summary>
101 /// The number of connections that this bot has to different simulators. 110 /// The number of connections that this bot has to different simulators.
102 /// </summary> 111 /// </summary>
103 /// <value>Includes both root and child connections.</value> 112 /// <value>Includes both root and child connections.</value>
104 public int ConnectionsCount 113 public int SimulatorsCount
105 { 114 {
106 get 115 get
107 { 116 {
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index f5b5256..303c8dd 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -208,6 +208,10 @@ namespace pCampBot
208 m_console.Commands.AddCommand( 208 m_console.Commands.AddCommand(
209 "bot", false, "show bots", "show bots", "Shows the status of all bots", HandleShowBotsStatus); 209 "bot", false, "show bots", "show bots", "Shows the status of all bots", HandleShowBotsStatus);
210 210
211 m_console.Commands.AddCommand(
212 "bot", false, "show bot", "show bot <first-name> <last-name>",
213 "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus);
214
211 m_bots = new List<Bot>(); 215 m_bots = new List<Bot>();
212 } 216 }
213 217
@@ -549,7 +553,7 @@ namespace pCampBot
549 totals[pb.ConnectionState]++; 553 totals[pb.ConnectionState]++;
550 554
551 cdt.AddRow( 555 cdt.AddRow(
552 pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState, pb.ConnectionsCount); 556 pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState, pb.SimulatorsCount);
553 } 557 }
554 } 558 }
555 559
@@ -563,6 +567,49 @@ namespace pCampBot
563 MainConsole.Instance.Output(cdl.ToString()); 567 MainConsole.Instance.Output(cdl.ToString());
564 } 568 }
565 569
570 private void HandleShowBotStatus(string module, string[] cmd)
571 {
572 if (cmd.Length != 4)
573 {
574 MainConsole.Instance.Output("Usage: show bot <first-name> <last-name>");
575 return;
576 }
577
578 string name = string.Format("{0} {1}", cmd[2], cmd[3]);
579
580 Bot bot;
581
582 lock (m_bots)
583 bot = m_bots.Find(b => b.Name == name);
584
585 if (bot == null)
586 {
587 MainConsole.Instance.Output("No bot found with name {0}", name);
588 return;
589 }
590
591 ConsoleDisplayList cdl = new ConsoleDisplayList();
592 cdl.AddRow("Name", bot.Name);
593 cdl.AddRow("Status", bot.ConnectionState);
594
595 Simulator currentSim = bot.Client.Network.CurrentSim;
596 cdl.AddRow("Region", currentSim != null ? currentSim.Name : "(none)");
597
598 List<Simulator> connectedSimulators = bot.Simulators;
599 List<string> simulatorNames = connectedSimulators.ConvertAll<string>(cs => cs.Name);
600 cdl.AddRow("Connections", string.Join(", ", simulatorNames));
601
602 MainConsole.Instance.Output(cdl.ToString());
603
604 MainConsole.Instance.Output("Settings");
605
606 ConsoleDisplayList statusCdl = new ConsoleDisplayList();
607 GridClient botClient = bot.Client;
608 statusCdl.AddRow("SEND_AGENT_UPDATES", botClient.Settings.SEND_AGENT_UPDATES);
609
610 MainConsole.Instance.Output(statusCdl.ToString());
611 }
612
566 internal void Grid_GridRegion(object o, GridRegionEventArgs args) 613 internal void Grid_GridRegion(object o, GridRegionEventArgs args)
567 { 614 {
568 lock (RegionsKnown) 615 lock (RegionsKnown)