diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index fcb6991..89224a6 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | |||
@@ -32,16 +32,17 @@ using System.Threading; | |||
32 | using log4net; | 32 | using log4net; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.RegionLoader.Filesystem; | ||
36 | using OpenSim.Framework.RegionLoader.Web; | ||
37 | using OpenSim.Region.CoreModules.Agent.AssetTransaction; | 35 | using OpenSim.Region.CoreModules.Agent.AssetTransaction; |
38 | using OpenSim.Region.CoreModules.Avatar.InstantMessage; | 36 | using OpenSim.Region.CoreModules.Avatar.InstantMessage; |
39 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; | 37 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; |
40 | using OpenSim.Region.CoreModules.Scripting.LoadImageURL; | 38 | using OpenSim.Region.CoreModules.Scripting.LoadImageURL; |
41 | using OpenSim.Region.CoreModules.Scripting.XMLRPC; | 39 | using OpenSim.Region.CoreModules.Scripting.XMLRPC; |
40 | using OpenSim.Services.Interfaces; | ||
41 | using Mono.Addins; | ||
42 | 42 | ||
43 | namespace OpenSim.ApplicationPlugins.LoadRegions | 43 | namespace OpenSim.ApplicationPlugins.LoadRegions |
44 | { | 44 | { |
45 | [Extension(Path="/OpenSim/Startup", Id="LoadRegions", NodeName="Plugin")] | ||
45 | public class LoadRegionsPlugin : IApplicationPlugin, IRegionCreator | 46 | public class LoadRegionsPlugin : IApplicationPlugin, IRegionCreator |
46 | { | 47 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -115,6 +116,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
115 | Environment.Exit(1); | 116 | Environment.Exit(1); |
116 | } | 117 | } |
117 | 118 | ||
119 | List<IScene> createdScenes = new List<IScene>(); | ||
120 | |||
118 | for (int i = 0; i < regionsToLoad.Length; i++) | 121 | for (int i = 0; i < regionsToLoad.Length; i++) |
119 | { | 122 | { |
120 | IScene scene; | 123 | IScene scene; |
@@ -123,17 +126,22 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
123 | ")"); | 126 | ")"); |
124 | 127 | ||
125 | bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); | 128 | bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); |
129 | |||
126 | m_openSim.CreateRegion(regionsToLoad[i], true, out scene); | 130 | m_openSim.CreateRegion(regionsToLoad[i], true, out scene); |
131 | createdScenes.Add(scene); | ||
132 | |||
127 | if (changed) | 133 | if (changed) |
128 | regionsToLoad[i].EstateSettings.Save(); | 134 | m_openSim.EstateDataService.StoreEstateSettings(regionsToLoad[i].EstateSettings); |
129 | 135 | } | |
130 | if (scene != null) | 136 | |
137 | foreach (IScene scene in createdScenes) | ||
138 | { | ||
139 | scene.Start(); | ||
140 | |||
141 | m_newRegionCreatedHandler = OnNewRegionCreated; | ||
142 | if (m_newRegionCreatedHandler != null) | ||
131 | { | 143 | { |
132 | m_newRegionCreatedHandler = OnNewRegionCreated; | 144 | m_newRegionCreatedHandler(scene); |
133 | if (m_newRegionCreatedHandler != null) | ||
134 | { | ||
135 | m_newRegionCreatedHandler(scene); | ||
136 | } | ||
137 | } | 145 | } |
138 | } | 146 | } |
139 | } | 147 | } |