diff options
Added IRegistryCore and RegistryCore to OpenSim.Framework.
Added a ApplicationRegistry to OpenSimBase.
Changed LoadRegionsPlugin so it registers itself to that application registry.
Added a event to LoadRegionsPlugin, that is triggered when it creates a new scene ,although maybe this event should actually be in opensimBase incase other plugins are creating regions (like the RemoteAdminPlugin).
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 4d809b0..2b74aa3 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -120,7 +120,14 @@ namespace OpenSim | |||
120 | get { return m_moduleLoader; } | 120 | get { return m_moduleLoader; } |
121 | set { m_moduleLoader = value; } | 121 | set { m_moduleLoader = value; } |
122 | } | 122 | } |
123 | protected ModuleLoader m_moduleLoader; | 123 | protected ModuleLoader m_moduleLoader; |
124 | |||
125 | protected RegistryCore m_applicationRegistry = new RegistryCore(); | ||
126 | |||
127 | public RegistryCore ApplicationRegistry | ||
128 | { | ||
129 | get { return m_applicationRegistry; } | ||
130 | } | ||
124 | 131 | ||
125 | /// <summary> | 132 | /// <summary> |
126 | /// Constructor. | 133 | /// Constructor. |
@@ -176,7 +183,7 @@ namespace OpenSim | |||
176 | base.StartupSpecific(); | 183 | base.StartupSpecific(); |
177 | 184 | ||
178 | m_stats = StatsManager.StartCollectingSimExtraStats(); | 185 | m_stats = StatsManager.StartCollectingSimExtraStats(); |
179 | 186 | ||
180 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_configSettings.LibrariesXMLFile); | 187 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_configSettings.LibrariesXMLFile); |
181 | 188 | ||
182 | // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) | 189 | // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) |
@@ -194,6 +201,7 @@ namespace OpenSim | |||
194 | m_moduleLoader = new ModuleLoader(m_config.Source); | 201 | m_moduleLoader = new ModuleLoader(m_config.Source); |
195 | 202 | ||
196 | LoadPlugins(); | 203 | LoadPlugins(); |
204 | |||
197 | 205 | ||
198 | foreach (IApplicationPlugin plugin in m_plugins) | 206 | foreach (IApplicationPlugin plugin in m_plugins) |
199 | { | 207 | { |
@@ -202,7 +210,10 @@ namespace OpenSim | |||
202 | 210 | ||
203 | 211 | ||
204 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) | 212 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) |
205 | m_commsManager.GridService.RegionLoginsEnabled = true; | 213 | if ((m_commsManager != null) && (m_commsManager.GridService != null)) |
214 | { | ||
215 | m_commsManager.GridService.RegionLoginsEnabled = true; | ||
216 | } | ||
206 | 217 | ||
207 | // If console exists add plugin commands. | 218 | // If console exists add plugin commands. |
208 | if (m_console != null) | 219 | if (m_console != null) |
@@ -541,9 +552,9 @@ namespace OpenSim | |||
541 | /// <param name="regionInfo"></param> | 552 | /// <param name="regionInfo"></param> |
542 | /// <param name="portadd_flag"></param> | 553 | /// <param name="portadd_flag"></param> |
543 | /// <returns></returns> | 554 | /// <returns></returns> |
544 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo, bool portadd_flag) | 555 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) |
545 | { | 556 | { |
546 | return CreateRegion(regionInfo, portadd_flag, false); | 557 | return CreateRegion(regionInfo, portadd_flag, false, out scene); |
547 | } | 558 | } |
548 | 559 | ||
549 | /// <summary> | 560 | /// <summary> |
@@ -551,9 +562,9 @@ namespace OpenSim | |||
551 | /// </summary> | 562 | /// </summary> |
552 | /// <param name="regionInfo"></param> | 563 | /// <param name="regionInfo"></param> |
553 | /// <returns></returns> | 564 | /// <returns></returns> |
554 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo) | 565 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo, out IScene scene) |
555 | { | 566 | { |
556 | return CreateRegion(regionInfo, false, true); | 567 | return CreateRegion(regionInfo, false, true, out scene); |
557 | } | 568 | } |
558 | 569 | ||
559 | /// <summary> | 570 | /// <summary> |
@@ -563,7 +574,7 @@ namespace OpenSim | |||
563 | /// <param name="portadd_flag"></param> | 574 | /// <param name="portadd_flag"></param> |
564 | /// <param name="do_post_init"></param> | 575 | /// <param name="do_post_init"></param> |
565 | /// <returns></returns> | 576 | /// <returns></returns> |
566 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init) | 577 | public IClientNetworkServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) |
567 | { | 578 | { |
568 | int port = regionInfo.InternalEndPoint.Port; | 579 | int port = regionInfo.InternalEndPoint.Port; |
569 | 580 | ||
@@ -640,6 +651,7 @@ namespace OpenSim | |||
640 | } | 651 | } |
641 | } | 652 | } |
642 | 653 | ||
654 | mscene = scene; | ||
643 | return clientServer; | 655 | return clientServer; |
644 | } | 656 | } |
645 | 657 | ||
@@ -722,8 +734,8 @@ namespace OpenSim | |||
722 | m_clientServers[clientServerElement].Server.Close(); | 734 | m_clientServers[clientServerElement].Server.Close(); |
723 | m_clientServers.RemoveAt(clientServerElement); | 735 | m_clientServers.RemoveAt(clientServerElement); |
724 | } | 736 | } |
725 | 737 | IScene scene; | |
726 | CreateRegion(whichRegion, true); | 738 | CreateRegion(whichRegion, true, out scene); |
727 | } | 739 | } |
728 | 740 | ||
729 | # region Setup methods | 741 | # region Setup methods |
@@ -738,7 +750,7 @@ namespace OpenSim | |||
738 | /// Handler to supply the current status of this sim | 750 | /// Handler to supply the current status of this sim |
739 | /// </summary> | 751 | /// </summary> |
740 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service | 752 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service |
741 | protected class SimStatusHandler : IStreamedRequestHandler | 753 | public class SimStatusHandler : IStreamedRequestHandler |
742 | { | 754 | { |
743 | public byte[] Handle(string path, Stream request, | 755 | public byte[] Handle(string path, Stream request, |
744 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 756 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |