From a90a5f52dd5f053a83a09fdd70ca08148ef641ce Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Aug 2013 19:38:20 +0100 Subject: Show number of connections each bot has established in "show bots" command. --- OpenSim/Tools/pCampBot/BotManager.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tools/pCampBot/BotManager.cs') 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 private void HandleShowStatus(string module, string[] cmd) { - string outputFormat = "{0,-30} {1, -30} {2,-14}"; - MainConsole.Instance.OutputFormat(outputFormat, "Name", "Region", "Status"); + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Name", 30); + cdt.AddColumn("Region", 30); + cdt.AddColumn("Status", 14); + cdt.AddColumn("Connections", 11); Dictionary totals = new Dictionary(); foreach (object o in Enum.GetValues(typeof(ConnectionState))) @@ -409,19 +412,19 @@ namespace pCampBot Simulator currentSim = pb.Client.Network.CurrentSim; totals[pb.ConnectionState]++; - MainConsole.Instance.OutputFormat( - outputFormat, - pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState); + cdt.AddRow( + pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.ConnectionState, pb.ConnectionsCount); } } + MainConsole.Instance.Output(cdt.ToString()); + ConsoleDisplayList cdl = new ConsoleDisplayList(); foreach (KeyValuePair kvp in totals) cdl.AddRow(kvp.Key, kvp.Value); - - MainConsole.Instance.OutputFormat("\n{0}", cdl.ToString()); + MainConsole.Instance.Output(cdl.ToString()); } /* -- cgit v1.1