aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/BotManager.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-12 22:49:17 +0100
committerJustin Clark-Casey (justincc)2013-08-12 22:49:17 +0100
commitc49ea491a3d081ff788cc33ca29030690db3a939 (patch)
tree9cd0a55cab888a58d5e267829832278c6cd01cff /OpenSim/Tools/pCampBot/BotManager.cs
parentDon't try and send group updates to NPCs via event queue, since NPCs have no ... (diff)
downloadopensim-SC-c49ea491a3d081ff788cc33ca29030690db3a939.zip
opensim-SC-c49ea491a3d081ff788cc33ca29030690db3a939.tar.gz
opensim-SC-c49ea491a3d081ff788cc33ca29030690db3a939.tar.bz2
opensim-SC-c49ea491a3d081ff788cc33ca29030690db3a939.tar.xz
Make show bots pCampbot console command print connected, connecting, etc. bot totals at end.
Diffstat (limited to '')
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 1a46380..74bd36a 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -330,17 +330,30 @@ namespace pCampBot
330 string outputFormat = "{0,-30} {1, -30} {2,-14}"; 330 string outputFormat = "{0,-30} {1, -30} {2,-14}";
331 MainConsole.Instance.OutputFormat(outputFormat, "Name", "Region", "Status"); 331 MainConsole.Instance.OutputFormat(outputFormat, "Name", "Region", "Status");
332 332
333 Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>();
334 foreach (object o in Enum.GetValues(typeof(ConnectionState)))
335 totals[(ConnectionState)o] = 0;
336
333 lock (m_lBot) 337 lock (m_lBot)
334 { 338 {
335 foreach (Bot pb in m_lBot) 339 foreach (Bot pb in m_lBot)
336 { 340 {
337 Simulator currentSim = pb.Client.Network.CurrentSim; 341 Simulator currentSim = pb.Client.Network.CurrentSim;
342 totals[pb.ConnectionState]++;
338 343
339 MainConsole.Instance.OutputFormat( 344 MainConsole.Instance.OutputFormat(
340 outputFormat, 345 outputFormat,
341 pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState); 346 pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState);
342 } 347 }
343 } 348 }
349
350 ConsoleDisplayList cdl = new ConsoleDisplayList();
351
352 foreach (KeyValuePair<ConnectionState, int> kvp in totals)
353 cdl.AddRow(kvp.Key, kvp.Value);
354
355
356 MainConsole.Instance.OutputFormat("\n{0}", cdl.ToString());
344 } 357 }
345 358
346 /* 359 /*