Remove the old style module loader and all references to it

This commit is contained in:
Melanie
2012-11-12 22:50:28 +00:00
parent e41374dd01
commit 8c130bcaf5
9 changed files with 21 additions and 425 deletions

View File

@@ -176,7 +176,6 @@ namespace OpenSim.Region.Framework.Scenes
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
protected string m_simulatorVersion = "OpenSimulator Server";
protected ModuleLoader m_moduleLoader;
protected AgentCircuitManager m_authenticateHandler;
protected SceneCommunicationService m_sceneGridService;
@@ -659,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes
public Scene(RegionInfo regInfo, AgentCircuitManager authen,
SceneCommunicationService sceneGridService,
ISimulationDataService simDataService, IEstateDataService estateDataService,
ModuleLoader moduleLoader, bool dumpAssetsToFile,
bool dumpAssetsToFile,
IConfigSource config, string simulatorVersion)
: this(regInfo)
{
@@ -670,7 +669,6 @@ namespace OpenSim.Region.Framework.Scenes
Random random = new Random();
m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
m_moduleLoader = moduleLoader;
m_authenticateHandler = authen;
m_sceneGridService = sceneGridService;
m_SimulationDataService = simDataService;

View File

@@ -67,12 +67,6 @@ namespace OpenSim.Region.Framework.Scenes
/// <value>
/// All the region modules attached to this scene.
/// </value>
public Dictionary<string, IRegionModule> Modules
{
get { return m_modules; }
}
protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>();
public Dictionary<string, IRegionModuleBase> RegionModules
{
get { return m_regionModules; }
@@ -272,16 +266,6 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public virtual void Close()
{
// Shut down all non shared modules.
foreach (IRegionModule module in Modules.Values)
{
if (!module.IsSharedModule)
{
module.Close();
}
}
Modules.Clear();
try
{
EventManager.TriggerShutdown();
@@ -311,19 +295,6 @@ namespace OpenSim.Region.Framework.Scenes
#region Module Methods
/// <summary>
/// Add a module to this scene.
/// </summary>
/// <param name="name"></param>
/// <param name="module"></param>
public void AddModule(string name, IRegionModule module)
{
if (!Modules.ContainsKey(name))
{
Modules.Add(name, module);
}
}
/// <summary>
/// Add a region-module to this scene. TODO: This will replace AddModule in the future.
/// </summary>
@@ -508,9 +479,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="shorthelp"></param>
/// <param name="longhelp"></param>
/// <param name="callback"></param>
public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
{
AddCommand(mod, command, shorthelp, longhelp, string.Empty, callback);
AddCommand(module, command, shorthelp, longhelp, string.Empty, callback);
}
/// <summary>
@@ -528,9 +499,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="longhelp"></param>
/// <param name="callback"></param>
public void AddCommand(
string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
{
AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback);
AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback);
}
/// <summary>
@@ -542,29 +513,14 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="longhelp"></param>
/// <param name="descriptivehelp"></param>
/// <param name="callback"></param>
public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
{
string moduleName = "";
if (mod != null)
{
if (mod is IRegionModule)
{
IRegionModule module = (IRegionModule)mod;
moduleName = module.Name;
}
else if (mod is IRegionModuleBase)
{
IRegionModuleBase module = (IRegionModuleBase)mod;
moduleName = module.Name;
}
else
{
throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
}
}
if (module != null)
moduleName = module.Name;
AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback);
AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback);
}
/// <summary>
@@ -580,7 +536,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="descriptivehelp"></param>
/// <param name="callback"></param>
public void AddCommand(
string category, object mod, string command,
string category, IRegionModuleBase module, string command,
string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
{
if (MainConsole.Instance == null)
@@ -588,22 +544,8 @@ namespace OpenSim.Region.Framework.Scenes
bool shared = false;
if (mod != null)
{
if (mod is IRegionModule)
{
IRegionModule module = (IRegionModule)mod;
shared = module.IsSharedModule;
}
else if (mod is IRegionModuleBase)
{
shared = mod is ISharedRegionModule;
}
else
{
throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
}
}
if (module != null)
shared = module is ISharedRegionModule;
MainConsole.Instance.Commands.AddCommand(
category, shared, command, shorthelp, longhelp, descriptivehelp, callback);

View File

@@ -144,22 +144,6 @@ namespace OpenSim.Region.Framework.Scenes
// collect known shared modules in sharedModules
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
lock (m_localScenes)
{
for (int i = 0; i < m_localScenes.Count; i++)
{
// extract known shared modules from scene
foreach (string k in m_localScenes[i].Modules.Keys)
{
if (m_localScenes[i].Modules[k].IsSharedModule &&
!sharedModules.ContainsKey(k))
sharedModules[k] = m_localScenes[i].Modules[k];
}
// close scene/region
m_localScenes[i].Close();
}
}
// all regions/scenes are now closed, we can now safely
// close all shared modules
foreach (IRegionModule mod in sharedModules.Values)