aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs28
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;
32using log4net; 32using log4net;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.RegionLoader.Filesystem;
36using OpenSim.Framework.RegionLoader.Web;
37using OpenSim.Region.CoreModules.Agent.AssetTransaction; 35using OpenSim.Region.CoreModules.Agent.AssetTransaction;
38using OpenSim.Region.CoreModules.Avatar.InstantMessage; 36using OpenSim.Region.CoreModules.Avatar.InstantMessage;
39using OpenSim.Region.CoreModules.Scripting.DynamicTexture; 37using OpenSim.Region.CoreModules.Scripting.DynamicTexture;
40using OpenSim.Region.CoreModules.Scripting.LoadImageURL; 38using OpenSim.Region.CoreModules.Scripting.LoadImageURL;
41using OpenSim.Region.CoreModules.Scripting.XMLRPC; 39using OpenSim.Region.CoreModules.Scripting.XMLRPC;
40using OpenSim.Services.Interfaces;
41using Mono.Addins;
42 42
43namespace OpenSim.ApplicationPlugins.LoadRegions 43namespace 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 }