diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 39 |
1 files changed, 27 insertions, 12 deletions
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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Linq; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Threading; | 32 | using System.Threading; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
@@ -48,7 +49,14 @@ namespace pCampBot | |||
48 | { | 49 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 51 | ||
52 | /// <summary> | ||
53 | /// Command console | ||
54 | /// </summary> | ||
51 | protected CommandConsole m_console; | 55 | protected CommandConsole m_console; |
56 | |||
57 | /// <summary> | ||
58 | /// Created bots, whether active or inactive. | ||
59 | /// </summary> | ||
52 | protected List<Bot> m_lBot; | 60 | protected List<Bot> m_lBot; |
53 | 61 | ||
54 | /// <summary> | 62 | /// <summary> |
@@ -56,6 +64,9 @@ namespace pCampBot | |||
56 | /// </summary> | 64 | /// </summary> |
57 | public Random Rng { get; private set; } | 65 | public Random Rng { get; private set; } |
58 | 66 | ||
67 | /// <summary> | ||
68 | /// Overall configuration. | ||
69 | /// </summary> | ||
59 | public IConfig Config { get; private set; } | 70 | public IConfig Config { get; private set; } |
60 | 71 | ||
61 | /// <summary> | 72 | /// <summary> |
@@ -140,22 +151,26 @@ namespace pCampBot | |||
140 | Array.ForEach<string>( | 151 | Array.ForEach<string>( |
141 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); | 152 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); |
142 | 153 | ||
154 | List<IBehaviour> behaviours = new List<IBehaviour>(); | ||
155 | |||
156 | // Hard-coded for now | ||
157 | if (behaviourSwitches.Contains("p")) | ||
158 | behaviours.Add(new PhysicsBehaviour()); | ||
159 | |||
160 | if (behaviourSwitches.Contains("g")) | ||
161 | behaviours.Add(new GrabbingBehaviour()); | ||
162 | |||
163 | if (behaviourSwitches.Contains("t")) | ||
164 | behaviours.Add(new TeleportBehaviour()); | ||
165 | |||
166 | MainConsole.Instance.OutputFormat( | ||
167 | "[BOT MANAGER]: Bots configured for behaviours {0}", | ||
168 | string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | ||
169 | |||
143 | for (int i = 0; i < botcount; i++) | 170 | for (int i = 0; i < botcount; i++) |
144 | { | 171 | { |
145 | string lastName = string.Format("{0}_{1}", lastNameStem, i); | 172 | string lastName = string.Format("{0}_{1}", lastNameStem, i); |
146 | 173 | ||
147 | List<IBehaviour> behaviours = new List<IBehaviour>(); | ||
148 | |||
149 | // Hard-coded for now | ||
150 | if (behaviourSwitches.Contains("p")) | ||
151 | behaviours.Add(new PhysicsBehaviour()); | ||
152 | |||
153 | if (behaviourSwitches.Contains("g")) | ||
154 | behaviours.Add(new GrabbingBehaviour()); | ||
155 | |||
156 | if (behaviourSwitches.Contains("t")) | ||
157 | behaviours.Add(new TeleportBehaviour()); | ||
158 | |||
159 | StartBot(this, behaviours, firstName, lastName, password, loginUri); | 174 | StartBot(this, behaviours, firstName, lastName, password, loginUri); |
160 | } | 175 | } |
161 | } | 176 | } |