diff options
author | Justin Clark-Casey (justincc) | 2013-08-19 19:38:20 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-08-19 19:38:20 +0100 |
commit | a90a5f52dd5f053a83a09fdd70ca08148ef641ce (patch) | |
tree | e3988b8959bce2c59ff33d46c730d755adeec1ed /OpenSim/Tools/pCampBot/BotManager.cs | |
parent | Remove mono compiler warnings from UserProfilesModule (diff) | |
download | opensim-SC-a90a5f52dd5f053a83a09fdd70ca08148ef641ce.zip opensim-SC-a90a5f52dd5f053a83a09fdd70ca08148ef641ce.tar.gz opensim-SC-a90a5f52dd5f053a83a09fdd70ca08148ef641ce.tar.bz2 opensim-SC-a90a5f52dd5f053a83a09fdd70ca08148ef641ce.tar.xz |
Show number of connections each bot has established in "show bots" command.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index dee02c3..8f31bdf 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -395,8 +395,11 @@ namespace pCampBot | |||
395 | 395 | ||
396 | private void HandleShowStatus(string module, string[] cmd) | 396 | private void HandleShowStatus(string module, string[] cmd) |
397 | { | 397 | { |
398 | string outputFormat = "{0,-30} {1, -30} {2,-14}"; | 398 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
399 | MainConsole.Instance.OutputFormat(outputFormat, "Name", "Region", "Status"); | 399 | cdt.AddColumn("Name", 30); |
400 | cdt.AddColumn("Region", 30); | ||
401 | cdt.AddColumn("Status", 14); | ||
402 | cdt.AddColumn("Connections", 11); | ||
400 | 403 | ||
401 | Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>(); | 404 | Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>(); |
402 | foreach (object o in Enum.GetValues(typeof(ConnectionState))) | 405 | foreach (object o in Enum.GetValues(typeof(ConnectionState))) |
@@ -409,19 +412,19 @@ namespace pCampBot | |||
409 | Simulator currentSim = pb.Client.Network.CurrentSim; | 412 | Simulator currentSim = pb.Client.Network.CurrentSim; |
410 | totals[pb.ConnectionState]++; | 413 | totals[pb.ConnectionState]++; |
411 | 414 | ||
412 | MainConsole.Instance.OutputFormat( | 415 | cdt.AddRow( |
413 | outputFormat, | 416 | pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState, pb.ConnectionsCount); |
414 | pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState); | ||
415 | } | 417 | } |
416 | } | 418 | } |
417 | 419 | ||
420 | MainConsole.Instance.Output(cdt.ToString()); | ||
421 | |||
418 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | 422 | ConsoleDisplayList cdl = new ConsoleDisplayList(); |
419 | 423 | ||
420 | foreach (KeyValuePair<ConnectionState, int> kvp in totals) | 424 | foreach (KeyValuePair<ConnectionState, int> kvp in totals) |
421 | cdl.AddRow(kvp.Key, kvp.Value); | 425 | cdl.AddRow(kvp.Key, kvp.Value); |
422 | 426 | ||
423 | 427 | MainConsole.Instance.Output(cdl.ToString()); | |
424 | MainConsole.Instance.OutputFormat("\n{0}", cdl.ToString()); | ||
425 | } | 428 | } |
426 | 429 | ||
427 | /* | 430 | /* |