Get "show modules" console command to show modules in alphabetical order, and group shared and non-shared modules together

This is to make it easier to tell if a region has a certain module active or not
0.7.4-extended
Justin Clark-Casey (justincc) 2013-02-27 22:25:03 +00:00
parent 889efb6bef
commit 4d9307753a
1 changed files with 20 additions and 7 deletions

View File

@ -30,6 +30,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -846,14 +847,26 @@ namespace OpenSim
); );
SceneManager.ForEachScene( SceneManager.ForEachScene(
delegate(Scene scene) { scene =>
MainConsole.Instance.Output("Loaded new region modules in" + scene.RegionInfo.RegionName + " are:"); {
MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name);
List<IRegionModuleBase> sharedModules = new List<IRegionModuleBase>();
List<IRegionModuleBase> nonSharedModules = new List<IRegionModuleBase>();
foreach (IRegionModuleBase module in scene.RegionModules.Values) foreach (IRegionModuleBase module in scene.RegionModules.Values)
{ {
Type type = module.GetType().GetInterface("ISharedRegionModule"); if (module.GetType().GetInterface("ISharedRegionModule") != null)
string module_type = type != null ? "Shared" : "Non-Shared"; nonSharedModules.Add(module);
MainConsole.Instance.OutputFormat("New Region Module ({0}): {1}", module_type, module.Name); else
sharedModules.Add(module);
} }
foreach (IRegionModuleBase module in sharedModules.OrderBy(m => m.Name))
MainConsole.Instance.OutputFormat("New Region Module (Shared): {0}", module.Name);
foreach (IRegionModuleBase module in sharedModules.OrderBy(m => m.Name))
MainConsole.Instance.OutputFormat("New Region Module (Non-Shared): {0}", module.Name);
} }
); );