aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorMW2009-02-26 15:21:06 +0000
committerMW2009-02-26 15:21:06 +0000
commitde82bf9eb53cdd3be94b5a730b81c70d1e244b70 (patch)
tree82c00d621abfb853d7571e3889792704fa6424bf /OpenSim/ApplicationPlugins
parentAdd check in SceneManager to stop opensim.exe crashing if no regions/scenes w... (diff)
downloadopensim-SC_OLD-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.zip
opensim-SC_OLD-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.tar.gz
opensim-SC_OLD-de82bf9eb53cdd3be94b5a730b81c70d1e244b70.tar.bz2
opensim-SC_OLD-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')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs27
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs4
-rw-r--r--OpenSim/ApplicationPlugins/Rest/RestPlugin.cs4
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs4
4 files changed, 29 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()
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 065f1ed..7f6ca9a 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -131,6 +131,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
131 } 131 }
132 } 132 }
133 133
134 public void PostInitialise()
135 {
136 }
137
134 public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) 138 public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request)
135 { 139 {
136 XmlRpcResponse response = new XmlRpcResponse(); 140 XmlRpcResponse response = new XmlRpcResponse();
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
index aa70886..a0d4209 100644
--- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
+++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
@@ -246,6 +246,10 @@ namespace OpenSim.ApplicationPlugins.Rest
246 } 246 }
247 } 247 }
248 248
249 public virtual void PostInitialise()
250 {
251 }
252
249 private List<RestStreamHandler> _handlers = new List<RestStreamHandler>(); 253 private List<RestStreamHandler> _handlers = new List<RestStreamHandler>();
250 private Dictionary<string, IHttpAgentHandler> _agents = new Dictionary<string, IHttpAgentHandler>(); 254 private Dictionary<string, IHttpAgentHandler> _agents = new Dictionary<string, IHttpAgentHandler>();
251 255
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs b/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs
index b4b5d5b..39bb88e 100644
--- a/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs
+++ b/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs
@@ -63,6 +63,10 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine
63 //m_OpenSim.Shutdown(); 63 //m_OpenSim.Shutdown();
64 } 64 }
65 65
66 public void PostInitialise()
67 {
68 }
69
66 70
67 #region IApplicationPlugin stuff 71 #region IApplicationPlugin stuff
68 /// <summary> 72 /// <summary>