From ed7ddeecf2df370638feb0a83b70a0883a711650 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 23 Nov 2011 22:18:10 +0000
Subject: Print out what behaviours are active when pCampBot starts up
---
OpenSim/Tools/pCampBot/BotManager.cs | 39 +++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Tools/pCampBot/BotManager.cs')
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index c67b3e4..29cb1ba 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using System.Threading;
using OpenMetaverse;
@@ -48,7 +49,14 @@ namespace pCampBot
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// Command console
+ ///
protected CommandConsole m_console;
+
+ ///
+ /// Created bots, whether active or inactive.
+ ///
protected List m_lBot;
///
@@ -56,6 +64,9 @@ namespace pCampBot
///
public Random Rng { get; private set; }
+ ///
+ /// Overall configuration.
+ ///
public IConfig Config { get; private set; }
///
@@ -140,22 +151,26 @@ namespace pCampBot
Array.ForEach(
cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b));
+ List behaviours = new List();
+
+ // Hard-coded for now
+ if (behaviourSwitches.Contains("p"))
+ behaviours.Add(new PhysicsBehaviour());
+
+ if (behaviourSwitches.Contains("g"))
+ behaviours.Add(new GrabbingBehaviour());
+
+ if (behaviourSwitches.Contains("t"))
+ behaviours.Add(new TeleportBehaviour());
+
+ MainConsole.Instance.OutputFormat(
+ "[BOT MANAGER]: Bots configured for behaviours {0}",
+ string.Join(",", behaviours.ConvertAll(b => b.Name).ToArray()));
+
for (int i = 0; i < botcount; i++)
{
string lastName = string.Format("{0}_{1}", lastNameStem, i);
- List behaviours = new List();
-
- // Hard-coded for now
- if (behaviourSwitches.Contains("p"))
- behaviours.Add(new PhysicsBehaviour());
-
- if (behaviourSwitches.Contains("g"))
- behaviours.Add(new GrabbingBehaviour());
-
- if (behaviourSwitches.Contains("t"))
- behaviours.Add(new TeleportBehaviour());
-
StartBot(this, behaviours, firstName, lastName, password, loginUri);
}
}
--
cgit v1.1