aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-03 17:07:57 +0100
committerJustin Clark-Casey (justincc)2013-09-04 00:47:34 +0100
commit6570f5dcfedf076dea51613fff6a19febf1c8ff4 (patch)
treea7c524c7a8de58bdd7197f065c563799be9cb81b /OpenSim/Tools/pCampBot
parentminor simplification of some unix date functions in Util. No functional change. (diff)
downloadopensim-SC_OLD-6570f5dcfedf076dea51613fff6a19febf1c8ff4.zip
opensim-SC_OLD-6570f5dcfedf076dea51613fff6a19febf1c8ff4.tar.gz
opensim-SC_OLD-6570f5dcfedf076dea51613fff6a19febf1c8ff4.tar.bz2
opensim-SC_OLD-6570f5dcfedf076dea51613fff6a19febf1c8ff4.tar.xz
Show behaviours of pCampbot bots in "show bots" and "show bot" console commands
Diffstat (limited to 'OpenSim/Tools/pCampBot')
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs5
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs6
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs6
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs6
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs1
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs6
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs22
-rw-r--r--OpenSim/Tools/pCampBot/Interfaces/IBehaviour.cs5
8 files changed, 45 insertions, 12 deletions
diff --git a/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs
index 9a9371d..66d5542 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs
@@ -35,6 +35,11 @@ namespace pCampBot
35{ 35{
36 public class AbstractBehaviour : IBehaviour 36 public class AbstractBehaviour : IBehaviour
37 { 37 {
38 /// <summary>
39 /// Abbreviated name of this behaviour.
40 /// </summary>
41 public string AbbreviatedName { get; protected set; }
42
38 public string Name { get; protected set; } 43 public string Name { get; protected set; }
39 44
40 public Bot Bot { get; protected set; } 45 public Bot Bot { get; protected set; }
diff --git a/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs
index 1e01c64..4d806fc 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs
@@ -47,7 +47,11 @@ namespace pCampBot
47 47
48 public const int m_regionCrossingTimeout = 1000 * 60; 48 public const int m_regionCrossingTimeout = 1000 * 60;
49 49
50 public CrossBehaviour() { Name = "Cross"; } 50 public CrossBehaviour()
51 {
52 AbbreviatedName = "c";
53 Name = "Cross";
54 }
51 55
52 public override void Action() 56 public override void Action()
53 { 57 {
diff --git a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs
index 66a336a..6acc27d 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs
@@ -41,7 +41,11 @@ namespace pCampBot
41 /// </remarks> 41 /// </remarks>
42 public class GrabbingBehaviour : AbstractBehaviour 42 public class GrabbingBehaviour : AbstractBehaviour
43 { 43 {
44 public GrabbingBehaviour() { Name = "Grabbing"; } 44 public GrabbingBehaviour()
45 {
46 AbbreviatedName = "g";
47 Name = "Grabbing";
48 }
45 49
46 public override void Action() 50 public override void Action()
47 { 51 {
diff --git a/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs
index 9cf8a54..9a3075c 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs
@@ -38,6 +38,10 @@ namespace pCampBot
38 /// </summary> 38 /// </summary>
39 public class NoneBehaviour : AbstractBehaviour 39 public class NoneBehaviour : AbstractBehaviour
40 { 40 {
41 public NoneBehaviour() { Name = "None"; } 41 public NoneBehaviour()
42 {
43 AbbreviatedName = "n";
44 Name = "None";
45 }
42 } 46 }
43} \ No newline at end of file 47} \ No newline at end of file
diff --git a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
index daa7485..47b4d46 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
@@ -46,6 +46,7 @@ namespace pCampBot
46 46
47 public PhysicsBehaviour() 47 public PhysicsBehaviour()
48 { 48 {
49 AbbreviatedName = "p";
49 Name = "Physics"; 50 Name = "Physics";
50 talkarray = readexcuses(); 51 talkarray = readexcuses();
51 } 52 }
diff --git a/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs
index fbb4e96..5f7edda 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs
@@ -42,7 +42,11 @@ namespace pCampBot
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 public TeleportBehaviour() { Name = "Teleport"; } 45 public TeleportBehaviour()
46 {
47 AbbreviatedName = "t";
48 Name = "Teleport";
49 }
46 50
47 public override void Action() 51 public override void Action()
48 { 52 {
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 5c3835b..35a24d1 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -572,10 +572,11 @@ namespace pCampBot
572 private void HandleShowBotsStatus(string module, string[] cmd) 572 private void HandleShowBotsStatus(string module, string[] cmd)
573 { 573 {
574 ConsoleDisplayTable cdt = new ConsoleDisplayTable(); 574 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
575 cdt.AddColumn("Name", 30); 575 cdt.AddColumn("Name", 24);
576 cdt.AddColumn("Region", 30); 576 cdt.AddColumn("Region", 24);
577 cdt.AddColumn("Status", 14); 577 cdt.AddColumn("Status", 13);
578 cdt.AddColumn("Connections", 11); 578 cdt.AddColumn("Conns", 5);
579 cdt.AddColumn("Behaviours", 20);
579 580
580 Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>(); 581 Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>();
581 foreach (object o in Enum.GetValues(typeof(ConnectionState))) 582 foreach (object o in Enum.GetValues(typeof(ConnectionState)))
@@ -583,13 +584,17 @@ namespace pCampBot
583 584
584 lock (m_bots) 585 lock (m_bots)
585 { 586 {
586 foreach (Bot pb in m_bots) 587 foreach (Bot bot in m_bots)
587 { 588 {
588 Simulator currentSim = pb.Client.Network.CurrentSim; 589 Simulator currentSim = bot.Client.Network.CurrentSim;
589 totals[pb.ConnectionState]++; 590 totals[bot.ConnectionState]++;
590 591
591 cdt.AddRow( 592 cdt.AddRow(
592 pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState, pb.SimulatorsCount); 593 bot.Name,
594 currentSim != null ? currentSim.Name : "(none)",
595 bot.ConnectionState,
596 bot.SimulatorsCount,
597 string.Join(",", bot.Behaviours.ConvertAll<string>(behaviour => behaviour.AbbreviatedName)));
593 } 598 }
594 } 599 }
595 600
@@ -645,6 +650,7 @@ namespace pCampBot
645 MainConsole.Instance.Output("Settings"); 650 MainConsole.Instance.Output("Settings");
646 651
647 ConsoleDisplayList statusCdl = new ConsoleDisplayList(); 652 ConsoleDisplayList statusCdl = new ConsoleDisplayList();
653 statusCdl.AddRow("Behaviours", string.Join(", ", bot.Behaviours.ConvertAll<string>(b => b.Name)));
648 GridClient botClient = bot.Client; 654 GridClient botClient = bot.Client;
649 statusCdl.AddRow("SEND_AGENT_UPDATES", botClient.Settings.SEND_AGENT_UPDATES); 655 statusCdl.AddRow("SEND_AGENT_UPDATES", botClient.Settings.SEND_AGENT_UPDATES);
650 656
diff --git a/OpenSim/Tools/pCampBot/Interfaces/IBehaviour.cs b/OpenSim/Tools/pCampBot/Interfaces/IBehaviour.cs
index 9c984be..f8a661b 100644
--- a/OpenSim/Tools/pCampBot/Interfaces/IBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Interfaces/IBehaviour.cs
@@ -32,6 +32,11 @@ namespace pCampBot.Interfaces
32 public interface IBehaviour 32 public interface IBehaviour
33 { 33 {
34 /// <summary> 34 /// <summary>
35 /// Abbreviated name of this behaviour.
36 /// </summary>
37 string AbbreviatedName { get; }
38
39 /// <summary>
35 /// Name of this behaviour. 40 /// Name of this behaviour.
36 /// </summary> 41 /// </summary>
37 string Name { get; } 42 string Name { get; }