aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
diff options
context:
space:
mode:
authorMW2009-02-26 15:21:06 +0000
committerMW2009-02-26 15:21:06 +0000
commitde82bf9eb53cdd3be94b5a730b81c70d1e244b70 (patch)
tree82c00d621abfb853d7571e3889792704fa6424bf /OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
parentAdd check in SceneManager to stop opensim.exe crashing if no regions/scenes w... (diff)
downloadopensim-SC-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.zip
opensim-SC-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.tar.gz
opensim-SC-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.tar.bz2
opensim-SC-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.tar.xz
Added a PostInitialise method to IApplicationPlugin, this allows us to do work in there knowing that all other ApplicationPlugins have been initialised by that time.
Moved the loadRegions code in LoadRegionsPlugin to the PostInitialise method.
Diffstat (limited to 'OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index c988ad8..24372fe 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -54,6 +54,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
54 public string Version { get { return m_version; } } 54 public string Version { get { return m_version; } }
55 public string Name { get { return m_name; } } 55 public string Name { get { return m_name; } }
56 56
57 protected OpenSimBase m_openSim;
58
57 public void Initialise() 59 public void Initialise()
58 { 60 {
59 m_log.Info("[LOADREGIONS]: " + Name + " cannot be default-initialized!"); 61 m_log.Info("[LOADREGIONS]: " + Name + " cannot be default-initialized!");
@@ -62,10 +64,15 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
62 64
63 public void Initialise(OpenSimBase openSim) 65 public void Initialise(OpenSimBase openSim)
64 { 66 {
67 m_openSim = openSim;
68 }
69
70 public void PostInitialise()
71 {
65 m_log.Info("[LOADREGIONS]: Load Regions addin being initialised"); 72 m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
66 73
67 IRegionLoader regionLoader; 74 IRegionLoader regionLoader;
68 if (openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") 75 if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
69 { 76 {
70 m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem"); 77 m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
71 regionLoader = new RegionLoaderFileSystem(); 78 regionLoader = new RegionLoaderFileSystem();
@@ -76,14 +83,14 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
76 regionLoader = new RegionLoaderWebServer(); 83 regionLoader = new RegionLoaderWebServer();
77 } 84 }
78 85
79 regionLoader.SetIniConfigSource(openSim.ConfigSource.Source); 86 regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
80 RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); 87 RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
81 88
82 openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); 89 m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
83 openSim.ModuleLoader.LoadDefaultSharedModule(new InstantMessageModule()); 90 m_openSim.ModuleLoader.LoadDefaultSharedModule(new InstantMessageModule());
84 openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule()); 91 m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
85 openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule()); 92 m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
86 openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); 93 m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
87 if (!CheckRegionsForSanity(regionsToLoad)) 94 if (!CheckRegionsForSanity(regionsToLoad))
88 { 95 {
89 m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations"); 96 m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations");
@@ -94,11 +101,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
94 { 101 {
95 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + 102 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() +
96 ")"); 103 ")");
97 openSim.CreateRegion(regionsToLoad[i], true); 104 m_openSim.CreateRegion(regionsToLoad[i], true);
98 } 105 }
99 106
100 openSim.ModuleLoader.PostInitialise(); 107 m_openSim.ModuleLoader.PostInitialise();
101 openSim.ModuleLoader.ClearCache(); 108 m_openSim.ModuleLoader.ClearCache();
102 } 109 }
103 110
104 public void Dispose() 111 public void Dispose()