diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index a6dbaba..bf0ff75 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -245,6 +245,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
245 | // Reload serialized prims | 245 | // Reload serialized prims |
246 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 246 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
247 | 247 | ||
248 | UUID oldTelehubUUID = m_scene.RegionInfo.RegionSettings.TelehubObject; | ||
249 | |||
248 | IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); | 250 | IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); |
249 | int sceneObjectsLoadedCount = 0; | 251 | int sceneObjectsLoadedCount = 0; |
250 | 252 | ||
@@ -266,11 +268,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
266 | 268 | ||
267 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); | 269 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); |
268 | 270 | ||
271 | bool isTelehub = (sceneObject.UUID == oldTelehubUUID); | ||
272 | |||
269 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned | 273 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned |
270 | // on the same region server and multiple examples a single object archive to be imported | 274 | // on the same region server and multiple examples a single object archive to be imported |
271 | // to the same scene (when this is possible). | 275 | // to the same scene (when this is possible). |
272 | sceneObject.ResetIDs(); | 276 | sceneObject.ResetIDs(); |
273 | 277 | ||
278 | if (isTelehub) | ||
279 | { | ||
280 | // Change the Telehub Object to the new UUID | ||
281 | m_scene.RegionInfo.RegionSettings.TelehubObject = sceneObject.UUID; | ||
282 | m_scene.RegionInfo.RegionSettings.Save(); | ||
283 | oldTelehubUUID = UUID.Zero; | ||
284 | } | ||
285 | |||
274 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 286 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
275 | // or creator data is present. Otherwise, use the estate owner instead. | 287 | // or creator data is present. Otherwise, use the estate owner instead. |
276 | foreach (SceneObjectPart part in sceneObject.Parts) | 288 | foreach (SceneObjectPart part in sceneObject.Parts) |
@@ -329,7 +341,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
329 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; | 341 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; |
330 | 342 | ||
331 | if (ignoredObjects > 0) | 343 | if (ignoredObjects > 0) |
332 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 344 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
345 | |||
346 | if (oldTelehubUUID != UUID.Zero) | ||
347 | { | ||
348 | m_log.WarnFormat("Telehub object not found: {0}", oldTelehubUUID); | ||
349 | m_scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; | ||
350 | m_scene.RegionInfo.RegionSettings.ClearSpawnPoints(); | ||
351 | } | ||
333 | } | 352 | } |
334 | 353 | ||
335 | /// <summary> | 354 | /// <summary> |
@@ -505,6 +524,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
505 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; | 524 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; |
506 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; | 525 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; |
507 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; | 526 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; |
527 | currentRegionSettings.TelehubObject = loadedRegionSettings.TelehubObject; | ||
528 | currentRegionSettings.ClearSpawnPoints(); | ||
529 | foreach (SpawnPoint sp in loadedRegionSettings.SpawnPoints()) | ||
530 | currentRegionSettings.AddSpawnPoint(sp); | ||
508 | 531 | ||
509 | currentRegionSettings.Save(); | 532 | currentRegionSettings.Save(); |
510 | 533 | ||