Add "show regions" console command to ROBUST to show all regions currently registered.
Command is not added in standalone, which has its own version of "show regions" that can also show estate name0.7.3-extended
parent
02fe1a676e
commit
005ca12a99
|
@ -91,6 +91,18 @@ namespace OpenSim.Services.GridService
|
||||||
String.Empty,
|
String.Empty,
|
||||||
HandleDeregisterRegion);
|
HandleDeregisterRegion);
|
||||||
|
|
||||||
|
// A messy way of stopping this command being added if we are in standalone (since the simulator
|
||||||
|
// has an identically named command
|
||||||
|
//
|
||||||
|
// XXX: We're relying on the OpenSimulator version being registered first, which is not well defined.
|
||||||
|
if (MainConsole.Instance.Commands.Resolve(new string[] { "show", "regions" }).Length == 0)
|
||||||
|
MainConsole.Instance.Commands.AddCommand("Regions", true,
|
||||||
|
"show regions",
|
||||||
|
"show all regions",
|
||||||
|
"Show details on all regions",
|
||||||
|
String.Empty,
|
||||||
|
HandleShowRegions);
|
||||||
|
|
||||||
MainConsole.Instance.Commands.AddCommand("Regions", true,
|
MainConsole.Instance.Commands.AddCommand("Regions", true,
|
||||||
"show region name",
|
"show region name",
|
||||||
"show region name <Region name>",
|
"show region name <Region name>",
|
||||||
|
@ -547,6 +559,20 @@ namespace OpenSim.Services.GridService
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleShowRegions(string module, string[] cmd)
|
||||||
|
{
|
||||||
|
if (cmd.Length != 2)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Syntax: show regions");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero);
|
||||||
|
|
||||||
|
OutputRegionsToConsoleSummary(regions);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void HandleShowRegion(string module, string[] cmd)
|
private void HandleShowRegion(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
if (cmd.Length != 4)
|
if (cmd.Length != 4)
|
||||||
|
@ -619,6 +645,24 @@ namespace OpenSim.Services.GridService
|
||||||
OutputRegionToConsole(r);
|
OutputRegionToConsole(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OutputRegionsToConsoleSummary(List<RegionData> regions)
|
||||||
|
{
|
||||||
|
ConsoleDisplayTable dispTable = new ConsoleDisplayTable();
|
||||||
|
dispTable.Columns.Add(new ConsoleDisplayTableColumn("Name", 16));
|
||||||
|
dispTable.Columns.Add(new ConsoleDisplayTableColumn("ID", 36));
|
||||||
|
dispTable.Columns.Add(new ConsoleDisplayTableColumn("Owner ID", 36));
|
||||||
|
dispTable.Columns.Add(new ConsoleDisplayTableColumn("Flags", 60));
|
||||||
|
|
||||||
|
foreach (RegionData r in regions)
|
||||||
|
{
|
||||||
|
OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
|
||||||
|
dispTable.Rows.Add(
|
||||||
|
new ConsoleDisplayTableRow(new List<string> { r.RegionName, r.RegionID.ToString(), r.Data["owner_uuid"].ToString(), flags.ToString() }));
|
||||||
|
}
|
||||||
|
|
||||||
|
MainConsole.Instance.Output(dispTable.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
private int ParseFlags(int prev, string flags)
|
private int ParseFlags(int prev, string flags)
|
||||||
{
|
{
|
||||||
OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)prev;
|
OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)prev;
|
||||||
|
|
Loading…
Reference in New Issue