diff options
author | Justin Clark-Casey (justincc) | 2012-06-26 00:40:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-26 00:40:46 +0100 |
commit | 1f22b29ca3d172624087185a4e9056a931f19703 (patch) | |
tree | 11f86d6827f91675af485e239202f307435fdf97 | |
parent | Add "show regions" console command to ROBUST to show all regions currently re... (diff) | |
download | opensim-SC_OLD-1f22b29ca3d172624087185a4e9056a931f19703.zip opensim-SC_OLD-1f22b29ca3d172624087185a4e9056a931f19703.tar.gz opensim-SC_OLD-1f22b29ca3d172624087185a4e9056a931f19703.tar.bz2 opensim-SC_OLD-1f22b29ca3d172624087185a4e9056a931f19703.tar.xz |
Add much easier ConsoleDisplayTable AddColumn() and AddRow() methods.
Use these for new "show regions" command rather than old cumbersome stuff.
-rw-r--r-- | OpenSim/Framework/Console/ConsoleDisplayTable.cs | 15 | ||||
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 11 |
2 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Framework/Console/ConsoleDisplayTable.cs b/OpenSim/Framework/Console/ConsoleDisplayTable.cs index e9d1628..c620dfe 100644 --- a/OpenSim/Framework/Console/ConsoleDisplayTable.cs +++ b/OpenSim/Framework/Console/ConsoleDisplayTable.cs | |||
@@ -79,6 +79,16 @@ namespace OpenSim.Framework.Console | |||
79 | return sb.ToString(); | 79 | return sb.ToString(); |
80 | } | 80 | } |
81 | 81 | ||
82 | public void AddColumn(string name, int width) | ||
83 | { | ||
84 | Columns.Add(new ConsoleDisplayTableColumn(name, width)); | ||
85 | } | ||
86 | |||
87 | public void AddRow(params string[] cells) | ||
88 | { | ||
89 | Rows.Add(new ConsoleDisplayTableRow(cells)); | ||
90 | } | ||
91 | |||
82 | public void AddToStringBuilder(StringBuilder sb) | 92 | public void AddToStringBuilder(StringBuilder sb) |
83 | { | 93 | { |
84 | string formatString = GetFormatString(); | 94 | string formatString = GetFormatString(); |
@@ -135,5 +145,10 @@ namespace OpenSim.Framework.Console | |||
135 | { | 145 | { |
136 | Cells = cells; | 146 | Cells = cells; |
137 | } | 147 | } |
148 | |||
149 | public ConsoleDisplayTableRow(params string[] cells) : this() | ||
150 | { | ||
151 | Cells = new List<string>(cells); | ||
152 | } | ||
138 | } | 153 | } |
139 | } \ No newline at end of file | 154 | } \ No newline at end of file |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index e4c3246..842a697 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -648,16 +648,15 @@ namespace OpenSim.Services.GridService | |||
648 | private void OutputRegionsToConsoleSummary(List<RegionData> regions) | 648 | private void OutputRegionsToConsoleSummary(List<RegionData> regions) |
649 | { | 649 | { |
650 | ConsoleDisplayTable dispTable = new ConsoleDisplayTable(); | 650 | ConsoleDisplayTable dispTable = new ConsoleDisplayTable(); |
651 | dispTable.Columns.Add(new ConsoleDisplayTableColumn("Name", 16)); | 651 | dispTable.AddColumn("Name", 16); |
652 | dispTable.Columns.Add(new ConsoleDisplayTableColumn("ID", 36)); | 652 | dispTable.AddColumn("ID", 36); |
653 | dispTable.Columns.Add(new ConsoleDisplayTableColumn("Owner ID", 36)); | 653 | dispTable.AddColumn("Owner ID", 36); |
654 | dispTable.Columns.Add(new ConsoleDisplayTableColumn("Flags", 60)); | 654 | dispTable.AddColumn("Flags", 60); |
655 | 655 | ||
656 | foreach (RegionData r in regions) | 656 | foreach (RegionData r in regions) |
657 | { | 657 | { |
658 | OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); | 658 | OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); |
659 | dispTable.Rows.Add( | 659 | dispTable.AddRow(r.RegionName, r.RegionID.ToString(), r.Data["owner_uuid"].ToString(), flags.ToString()); |
660 | new ConsoleDisplayTableRow(new List<string> { r.RegionName, r.RegionID.ToString(), r.Data["owner_uuid"].ToString(), flags.ToString() })); | ||
661 | } | 660 | } |
662 | 661 | ||
663 | MainConsole.Instance.Output(dispTable.ToString()); | 662 | MainConsole.Instance.Output(dispTable.ToString()); |