diff options
-rw-r--r-- | OpenSim/Tools/pCampBot/Bot.cs | 2 | ||||
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 26 |
2 files changed, 19 insertions, 9 deletions
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index 95dba9f..b6cd287 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs | |||
@@ -168,7 +168,7 @@ namespace pCampBot | |||
168 | b => | 168 | b => |
169 | { | 169 | { |
170 | Thread.Sleep(Random.Next(3000, 10000)); | 170 | Thread.Sleep(Random.Next(3000, 10000)); |
171 | 171 | ||
172 | // m_log.DebugFormat("[pCAMPBOT]: For {0} performing action {1}", Name, b.GetType()); | 172 | // m_log.DebugFormat("[pCAMPBOT]: For {0} performing action {1}", Name, b.GetType()); |
173 | b.Action(); | 173 | b.Action(); |
174 | } | 174 | } |
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index b9eabbf..d615b3f 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -161,28 +161,34 @@ namespace pCampBot | |||
161 | Array.ForEach<string>( | 161 | Array.ForEach<string>( |
162 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); | 162 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); |
163 | 163 | ||
164 | MainConsole.Instance.OutputFormat( | ||
165 | "[BOT MANAGER]: Starting {0} bots connecting to {1}, named {2} {3}_<n>", | ||
166 | botcount, | ||
167 | loginUri, | ||
168 | firstName, | ||
169 | lastNameStem); | ||
170 | |||
171 | MainConsole.Instance.OutputFormat("[BOT MANAGER]: Delay between logins is {0}ms", LoginDelay); | ||
172 | |||
164 | for (int i = 0; i < botcount; i++) | 173 | for (int i = 0; i < botcount; i++) |
165 | { | 174 | { |
166 | string lastName = string.Format("{0}_{1}", lastNameStem, i); | 175 | string lastName = string.Format("{0}_{1}", lastNameStem, i); |
167 | 176 | ||
177 | // We must give each bot its own list of instantiated behaviours since they store state. | ||
168 | List<IBehaviour> behaviours = new List<IBehaviour>(); | 178 | List<IBehaviour> behaviours = new List<IBehaviour>(); |
169 | 179 | ||
170 | // Hard-coded for now | 180 | // Hard-coded for now |
171 | if (behaviourSwitches.Contains("p")) | 181 | if (behaviourSwitches.Contains("p")) |
172 | behaviours.Add(new PhysicsBehaviour()); | 182 | behaviours.Add(new PhysicsBehaviour()); |
173 | 183 | ||
174 | if (behaviourSwitches.Contains("g")) | 184 | if (behaviourSwitches.Contains("g")) |
175 | behaviours.Add(new GrabbingBehaviour()); | 185 | behaviours.Add(new GrabbingBehaviour()); |
176 | 186 | ||
177 | if (behaviourSwitches.Contains("t")) | 187 | if (behaviourSwitches.Contains("t")) |
178 | behaviours.Add(new TeleportBehaviour()); | 188 | behaviours.Add(new TeleportBehaviour()); |
179 | 189 | ||
180 | if (behaviourSwitches.Contains("c")) | 190 | if (behaviourSwitches.Contains("c")) |
181 | behaviours.Add(new CrossBehaviour()); | 191 | behaviours.Add(new CrossBehaviour()); |
182 | |||
183 | MainConsole.Instance.OutputFormat( | ||
184 | "[BOT MANAGER]: Bot {0} {1} configured for behaviours {2}", | ||
185 | firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | ||
186 | 192 | ||
187 | StartBot(this, behaviours, firstName, lastName, password, loginUri); | 193 | StartBot(this, behaviours, firstName, lastName, password, loginUri); |
188 | } | 194 | } |
@@ -221,6 +227,10 @@ namespace pCampBot | |||
221 | BotManager bm, List<IBehaviour> behaviours, | 227 | BotManager bm, List<IBehaviour> behaviours, |
222 | string firstName, string lastName, string password, string loginUri) | 228 | string firstName, string lastName, string password, string loginUri) |
223 | { | 229 | { |
230 | MainConsole.Instance.OutputFormat( | ||
231 | "[BOT MANAGER]: Starting bot {0} {1}, behaviours are {2}", | ||
232 | firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | ||
233 | |||
224 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, loginUri); | 234 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, loginUri); |
225 | 235 | ||
226 | pb.OnConnected += handlebotEvent; | 236 | pb.OnConnected += handlebotEvent; |