diff options
author | Diva Canto | 2014-07-06 15:17:27 -0700 |
---|---|---|
committer | Diva Canto | 2014-07-06 15:17:27 -0700 |
commit | 108978be1e854462290314a3549c082bdc986b35 (patch) | |
tree | e53dc89374244665392a866451794a265f411618 | |
parent | Lookup username given key(uuid) XML-RPC (diff) | |
parent | Add experimental "show grid size" robust console command. (diff) | |
download | opensim-SC_OLD-108978be1e854462290314a3549c082bdc986b35.zip opensim-SC_OLD-108978be1e854462290314a3549c082bdc986b35.tar.gz opensim-SC_OLD-108978be1e854462290314a3549c082bdc986b35.tar.bz2 opensim-SC_OLD-108978be1e854462290314a3549c082bdc986b35.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 477f54b..e0e2f03 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -118,12 +118,19 @@ namespace OpenSim.Services.GridService | |||
118 | "For example, show region at 1000 1000", | 118 | "For example, show region at 1000 1000", |
119 | HandleShowRegionAt); | 119 | HandleShowRegionAt); |
120 | 120 | ||
121 | MainConsole.Instance.Commands.AddCommand("Regions", true, | 121 | MainConsole.Instance.Commands.AddCommand("General", true, |
122 | "set region flags", | 122 | "show grid size", |
123 | "set region flags <Region name> <flags>", | 123 | "show grid size", |
124 | "Set database flags for region", | 124 | "Show the current grid size (excluding hyperlink references)", |
125 | String.Empty, | 125 | String.Empty, |
126 | HandleSetFlags); | 126 | HandleShowGridSize); |
127 | |||
128 | MainConsole.Instance.Commands.AddCommand("Regions", true, | ||
129 | "set region flags", | ||
130 | "set region flags <Region name> <flags>", | ||
131 | "Set database flags for region", | ||
132 | String.Empty, | ||
133 | HandleSetFlags); | ||
127 | } | 134 | } |
128 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); | 135 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); |
129 | } | 136 | } |
@@ -620,6 +627,28 @@ namespace OpenSim.Services.GridService | |||
620 | OutputRegionsToConsoleSummary(regions); | 627 | OutputRegionsToConsoleSummary(regions); |
621 | } | 628 | } |
622 | 629 | ||
630 | private void HandleShowGridSize(string module, string[] cmd) | ||
631 | { | ||
632 | List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero); | ||
633 | |||
634 | double size = 0; | ||
635 | |||
636 | foreach (RegionData region in regions) | ||
637 | { | ||
638 | int flags = Convert.ToInt32(region.Data["flags"]); | ||
639 | |||
640 | if ((flags & (int)Framework.RegionFlags.Hyperlink) == 0) | ||
641 | size += region.sizeX * region.sizeY; | ||
642 | } | ||
643 | |||
644 | MainConsole.Instance.Output("This is a very rough approximation."); | ||
645 | MainConsole.Instance.Output("Although it will not count regions that are actually links to others over the Hypergrid, "); | ||
646 | MainConsole.Instance.Output("it will count regions that are inactive but were not deregistered from the grid service"); | ||
647 | MainConsole.Instance.Output("(e.g. simulator crashed rather than shutting down cleanly).\n"); | ||
648 | |||
649 | MainConsole.Instance.OutputFormat("Grid size: {0} km squared.", size / 1000000); | ||
650 | } | ||
651 | |||
623 | private void HandleShowRegion(string module, string[] cmd) | 652 | private void HandleShowRegion(string module, string[] cmd) |
624 | { | 653 | { |
625 | if (cmd.Length != 4) | 654 | if (cmd.Length != 4) |