diff options
author | Melanie | 2011-11-19 22:26:41 +0100 |
---|---|---|
committer | Melanie | 2011-11-19 22:26:41 +0100 |
commit | dec8b9c98dae977d6d9a94cc21d296f10957cf44 (patch) | |
tree | 27c5a94ae30b1acb7d0f0cd120f6060fb1ef5be2 /OpenSim/Region | |
parent | Merge branch 'bigmerge' of ssh://3dhosting.de/var/git/careminster into bigmerge (diff) | |
parent | Merge branch 'master' into bigmerge (diff) | |
download | opensim-SC_OLD-dec8b9c98dae977d6d9a94cc21d296f10957cf44.zip opensim-SC_OLD-dec8b9c98dae977d6d9a94cc21d296f10957cf44.tar.gz opensim-SC_OLD-dec8b9c98dae977d6d9a94cc21d296f10957cf44.tar.bz2 opensim-SC_OLD-dec8b9c98dae977d6d9a94cc21d296f10957cf44.tar.xz |
Merge branch 'bigmerge' of ssh://3dhosting.de/var/git/careminster into bigmerge
Diffstat (limited to 'OpenSim/Region')
7 files changed, 84 insertions, 50 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index f71bf46..40cc536 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs | |||
@@ -25,11 +25,12 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | ||
29 | using Nini.Config; | ||
30 | using System; | 28 | using System; |
31 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
32 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Server.Base; | 35 | using OpenSim.Server.Base; |
35 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
@@ -119,10 +120,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
119 | 120 | ||
120 | #region INeighbourService | 121 | #region INeighbourService |
121 | 122 | ||
122 | public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | 123 | public OpenSim.Services.Interfaces.GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) |
123 | { | 124 | { |
124 | m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.", | 125 | uint x, y; |
125 | thisRegion.RegionName, regionHandle); | 126 | Utils.LongToUInts(regionHandle, out x, out y); |
127 | |||
128 | m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from region {0} to region at {1}-{2}", | ||
129 | thisRegion.RegionName, x / Constants.RegionSize, y / Constants.RegionSize); | ||
130 | |||
126 | foreach (Scene s in m_Scenes) | 131 | foreach (Scene s in m_Scenes) |
127 | { | 132 | { |
128 | if (s.RegionInfo.RegionHandle == regionHandle) | 133 | if (s.RegionInfo.RegionHandle == regionHandle) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 9714c36..faa1def 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -196,7 +196,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for SendCreateChildAgent", destination.RegionName); | ||
200 | reason = "Did not find region " + destination.RegionName; | 199 | reason = "Did not find region " + destination.RegionName; |
201 | return false; | 200 | return false; |
202 | } | 201 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index a93ffaa..4805ccb 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -86,6 +86,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
86 | private volatile bool m_tainted; | 86 | private volatile bool m_tainted; |
87 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); | 87 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); |
88 | 88 | ||
89 | /// <summary> | ||
90 | /// Human readable list of terrain file extensions that are supported. | ||
91 | /// </summary> | ||
92 | private string m_supportedFileExtensions = ""; | ||
93 | |||
89 | #region ICommandableModule Members | 94 | #region ICommandableModule Members |
90 | 95 | ||
91 | public ICommander CommandInterface | 96 | public ICommander CommandInterface |
@@ -135,6 +140,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
135 | 140 | ||
136 | InstallDefaultEffects(); | 141 | InstallDefaultEffects(); |
137 | LoadPlugins(); | 142 | LoadPlugins(); |
143 | |||
144 | // Generate user-readable extensions list | ||
145 | string supportedFilesSeparator = ""; | ||
146 | |||
147 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) | ||
148 | { | ||
149 | m_supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")"; | ||
150 | supportedFilesSeparator = ", "; | ||
151 | } | ||
138 | } | 152 | } |
139 | 153 | ||
140 | public void RegionLoaded(Scene scene) | 154 | public void RegionLoaded(Scene scene) |
@@ -251,20 +265,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
251 | if (filename.EndsWith(loader.Key)) | 265 | if (filename.EndsWith(loader.Key)) |
252 | { | 266 | { |
253 | loader.Value.SaveFile(filename, m_channel); | 267 | loader.Value.SaveFile(filename, m_channel); |
268 | m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename); | ||
254 | return; | 269 | return; |
255 | } | 270 | } |
256 | } | 271 | } |
257 | } | 272 | } |
258 | catch (NotImplementedException) | ||
259 | { | ||
260 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); | ||
261 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | ||
262 | } | ||
263 | catch (IOException ioe) | 273 | catch (IOException ioe) |
264 | { | 274 | { |
265 | m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message)); | 275 | m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message)); |
266 | throw new TerrainException(String.Format("Unable to save heightmap: {0}", ioe.Message)); | ||
267 | } | 276 | } |
277 | |||
278 | m_log.ErrorFormat( | ||
279 | "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", | ||
280 | m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); | ||
268 | } | 281 | } |
269 | 282 | ||
270 | /// <summary> | 283 | /// <summary> |
@@ -345,6 +358,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
345 | float duration = 0.25f; | 358 | float duration = 0.25f; |
346 | if (action == 0) | 359 | if (action == 0) |
347 | duration = 4.0f; | 360 | duration = 4.0f; |
361 | |||
348 | client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId); | 362 | client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId); |
349 | } | 363 | } |
350 | 364 | ||
@@ -534,6 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
534 | m_channel = channel; | 548 | m_channel = channel; |
535 | UpdateRevertMap(); | 549 | UpdateRevertMap(); |
536 | } | 550 | } |
551 | |||
537 | return; | 552 | return; |
538 | } | 553 | } |
539 | } | 554 | } |
@@ -566,10 +581,17 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
566 | fileWidth, fileHeight, | 581 | fileWidth, fileHeight, |
567 | (int)Constants.RegionSize, | 582 | (int)Constants.RegionSize, |
568 | (int)Constants.RegionSize); | 583 | (int)Constants.RegionSize); |
584 | |||
585 | m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename); | ||
569 | } | 586 | } |
587 | |||
570 | return; | 588 | return; |
571 | } | 589 | } |
572 | } | 590 | } |
591 | |||
592 | m_log.ErrorFormat( | ||
593 | "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", | ||
594 | m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); | ||
573 | } | 595 | } |
574 | } | 596 | } |
575 | 597 | ||
@@ -1126,32 +1148,23 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1126 | 1148 | ||
1127 | private void InstallInterfaces() | 1149 | private void InstallInterfaces() |
1128 | { | 1150 | { |
1129 | // Load / Save | ||
1130 | string supportedFileExtensions = ""; | ||
1131 | string supportedFilesSeparator = ""; | ||
1132 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) | ||
1133 | { | ||
1134 | supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")"; | ||
1135 | supportedFilesSeparator = ", "; | ||
1136 | } | ||
1137 | |||
1138 | Command loadFromFileCommand = | 1151 | Command loadFromFileCommand = |
1139 | new Command("load", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadFile, "Loads a terrain from a specified file."); | 1152 | new Command("load", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadFile, "Loads a terrain from a specified file."); |
1140 | loadFromFileCommand.AddArgument("filename", | 1153 | loadFromFileCommand.AddArgument("filename", |
1141 | "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + | 1154 | "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + |
1142 | supportedFileExtensions, "String"); | 1155 | m_supportedFileExtensions, "String"); |
1143 | 1156 | ||
1144 | Command saveToFileCommand = | 1157 | Command saveToFileCommand = |
1145 | new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveFile, "Saves the current heightmap to a specified file."); | 1158 | new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveFile, "Saves the current heightmap to a specified file."); |
1146 | saveToFileCommand.AddArgument("filename", | 1159 | saveToFileCommand.AddArgument("filename", |
1147 | "The destination filename for your heightmap, the file extension determines the format to save in. Supported extensions include: " + | 1160 | "The destination filename for your heightmap, the file extension determines the format to save in. Supported extensions include: " + |
1148 | supportedFileExtensions, "String"); | 1161 | m_supportedFileExtensions, "String"); |
1149 | 1162 | ||
1150 | Command loadFromTileCommand = | 1163 | Command loadFromTileCommand = |
1151 | new Command("load-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadTileFile, "Loads a terrain from a section of a larger file."); | 1164 | new Command("load-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadTileFile, "Loads a terrain from a section of a larger file."); |
1152 | loadFromTileCommand.AddArgument("filename", | 1165 | loadFromTileCommand.AddArgument("filename", |
1153 | "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + | 1166 | "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + |
1154 | supportedFileExtensions, "String"); | 1167 | m_supportedFileExtensions, "String"); |
1155 | loadFromTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); | 1168 | loadFromTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); |
1156 | loadFromTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); | 1169 | loadFromTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); |
1157 | loadFromTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", | 1170 | loadFromTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", |
@@ -1163,7 +1176,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1163 | new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file."); | 1176 | new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file."); |
1164 | saveToTileCommand.AddArgument("filename", | 1177 | saveToTileCommand.AddArgument("filename", |
1165 | "The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " + | 1178 | "The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " + |
1166 | supportedFileExtensions, "String"); | 1179 | m_supportedFileExtensions, "String"); |
1167 | saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); | 1180 | saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); |
1168 | saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); | 1181 | saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); |
1169 | saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", | 1182 | saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 0049384..547e693 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -102,9 +102,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
102 | 102 | ||
103 | public event OnPluginConsoleDelegate OnPluginConsole; | 103 | public event OnPluginConsoleDelegate OnPluginConsole; |
104 | 104 | ||
105 | public delegate void OnShutdownDelegate(); | 105 | /// <summary> |
106 | 106 | /// Triggered when the entire simulator is shutdown. | |
107 | public event OnShutdownDelegate OnShutdown; | 107 | /// </summary> |
108 | public event Action OnShutdown; | ||
108 | 109 | ||
109 | public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); | 110 | public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); |
110 | public delegate void ScriptResetDelegate(uint localID, UUID itemID); | 111 | public delegate void ScriptResetDelegate(uint localID, UUID itemID); |
@@ -117,9 +118,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
117 | 118 | ||
118 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 119 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
119 | 120 | ||
120 | public delegate void SceneShuttingDownDelegate(Scene scene); | 121 | /// <summary> |
121 | 122 | /// Triggered when an individual scene is shutdown. | |
122 | public event SceneShuttingDownDelegate OnSceneShuttingDown; | 123 | /// </summary> |
124 | /// <remarks> | ||
125 | /// This does not automatically mean that the entire simulator is shutting down. Listen to OnShutdown for that | ||
126 | /// notification. | ||
127 | /// </remarks> | ||
128 | public event Action<Scene> OnSceneShuttingDown; | ||
123 | 129 | ||
124 | /// <summary> | 130 | /// <summary> |
125 | /// Fired when an object is touched/grabbed. | 131 | /// Fired when an object is touched/grabbed. |
@@ -893,10 +899,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
893 | 899 | ||
894 | public void TriggerShutdown() | 900 | public void TriggerShutdown() |
895 | { | 901 | { |
896 | OnShutdownDelegate handlerShutdown = OnShutdown; | 902 | Action handlerShutdown = OnShutdown; |
897 | if (handlerShutdown != null) | 903 | if (handlerShutdown != null) |
898 | { | 904 | { |
899 | foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList()) | 905 | foreach (Action d in handlerShutdown.GetInvocationList()) |
900 | { | 906 | { |
901 | try | 907 | try |
902 | { | 908 | { |
@@ -2236,10 +2242,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2236 | 2242 | ||
2237 | public void TriggerSceneShuttingDown(Scene s) | 2243 | public void TriggerSceneShuttingDown(Scene s) |
2238 | { | 2244 | { |
2239 | SceneShuttingDownDelegate handler = OnSceneShuttingDown; | 2245 | Action<Scene> handler = OnSceneShuttingDown; |
2240 | if (handler != null) | 2246 | if (handler != null) |
2241 | { | 2247 | { |
2242 | foreach (SceneShuttingDownDelegate d in handler.GetInvocationList()) | 2248 | foreach (Action<Scene> d in handler.GetInvocationList()) |
2243 | { | 2249 | { |
2244 | try | 2250 | try |
2245 | { | 2251 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b6067ea..66341a1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5222,18 +5222,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
5222 | return offsets.ToArray(); | 5222 | return offsets.ToArray(); |
5223 | } | 5223 | } |
5224 | 5224 | ||
5225 | /// <summary> | ||
5226 | /// Regenerate the maptile for this scene. | ||
5227 | /// </summary> | ||
5228 | /// <param name="sender"></param> | ||
5229 | /// <param name="e"></param> | ||
5225 | public void RegenerateMaptile(object sender, ElapsedEventArgs e) | 5230 | public void RegenerateMaptile(object sender, ElapsedEventArgs e) |
5226 | { | 5231 | { |
5227 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); | 5232 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); |
5228 | if (mapModule != null) | 5233 | if (mapModule != null) |
5229 | { | ||
5230 | mapModule.GenerateMaptile(); | 5234 | mapModule.GenerateMaptile(); |
5231 | |||
5232 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); | ||
5233 | |||
5234 | if (error != String.Empty) | ||
5235 | throw new Exception(error); | ||
5236 | } | ||
5237 | } | 5235 | } |
5238 | 5236 | ||
5239 | // public void CleanDroppedAttachments() | 5237 | // public void CleanDroppedAttachments() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 12058c8..27833e8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -174,7 +174,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
174 | { | 174 | { |
175 | // We're ignoring a collection was modified error because this data gets old and outdated fast. | 175 | // We're ignoring a collection was modified error because this data gets old and outdated fast. |
176 | } | 176 | } |
177 | |||
178 | } | 177 | } |
179 | 178 | ||
180 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); | 179 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); |
@@ -185,13 +184,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
185 | /// </summary> | 184 | /// </summary> |
186 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) | 185 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) |
187 | { | 186 | { |
188 | |||
189 | //m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); | ||
190 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. | 187 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. |
191 | 188 | ||
192 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 189 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
193 | uint x = 0, y = 0; | 190 | uint x = 0, y = 0; |
194 | Utils.LongToUInts(regionHandle, out x, out y); | 191 | Utils.LongToUInts(regionHandle, out x, out y); |
192 | |||
195 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 193 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
196 | m_scene.SimulationService.CloseChildAgent(destination, agentID); | 194 | m_scene.SimulationService.CloseChildAgent(destination, agentID); |
197 | } | 195 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 402377d..65c7416 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -91,6 +91,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
91 | private bool m_KillTimedOutScripts; | 91 | private bool m_KillTimedOutScripts; |
92 | private string m_ScriptEnginesPath = null; | 92 | private string m_ScriptEnginesPath = null; |
93 | 93 | ||
94 | /// <summary> | ||
95 | /// Is the entire simulator in the process of shutting down? | ||
96 | /// </summary> | ||
97 | private bool m_SimulatorShuttingDown; | ||
98 | |||
94 | private static List<XEngine> m_ScriptEngines = | 99 | private static List<XEngine> m_ScriptEngines = |
95 | new List<XEngine>(); | 100 | new List<XEngine>(); |
96 | 101 | ||
@@ -537,12 +542,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
537 | // Must be done explicitly because they have infinite | 542 | // Must be done explicitly because they have infinite |
538 | // lifetime | 543 | // lifetime |
539 | // | 544 | // |
540 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 545 | if (!m_SimulatorShuttingDown) |
541 | if (m_DomainScripts[instance.AppDomain].Count == 0) | ||
542 | { | 546 | { |
543 | m_DomainScripts.Remove(instance.AppDomain); | 547 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
544 | UnloadAppDomain(instance.AppDomain); | 548 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
549 | { | ||
550 | m_DomainScripts.Remove(instance.AppDomain); | ||
551 | UnloadAppDomain(instance.AppDomain); | ||
552 | } | ||
545 | } | 553 | } |
554 | |||
555 | m_Scripts.Clear(); | ||
556 | m_PrimObjects.Clear(); | ||
557 | m_Assemblies.Clear(); | ||
558 | m_DomainScripts.Clear(); | ||
546 | } | 559 | } |
547 | lockScriptsForRead(false); | 560 | lockScriptsForRead(false); |
548 | lockScriptsForWrite(true); | 561 | lockScriptsForWrite(true); |
@@ -1512,6 +1525,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1512 | 1525 | ||
1513 | public void OnShutdown() | 1526 | public void OnShutdown() |
1514 | { | 1527 | { |
1528 | m_SimulatorShuttingDown = true; | ||
1529 | |||
1515 | List<IScriptInstance> instances = new List<IScriptInstance>(); | 1530 | List<IScriptInstance> instances = new List<IScriptInstance>(); |
1516 | 1531 | ||
1517 | lockScriptsForRead(true); | 1532 | lockScriptsForRead(true); |
@@ -1907,4 +1922,4 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1907 | return true; | 1922 | return true; |
1908 | } | 1923 | } |
1909 | } | 1924 | } |
1910 | } \ No newline at end of file | 1925 | } |