diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
3 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 38db239..0c4069f 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) |
@@ -347,7 +359,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
347 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; | 359 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; |
348 | 360 | ||
349 | if (ignoredObjects > 0) | 361 | if (ignoredObjects > 0) |
350 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 362 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
363 | |||
364 | if (oldTelehubUUID != UUID.Zero) | ||
365 | { | ||
366 | m_log.WarnFormat("Telehub object not found: {0}", oldTelehubUUID); | ||
367 | m_scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; | ||
368 | m_scene.RegionInfo.RegionSettings.ClearSpawnPoints(); | ||
369 | } | ||
351 | } | 370 | } |
352 | 371 | ||
353 | /// <summary> | 372 | /// <summary> |
@@ -523,6 +542,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
523 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; | 542 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; |
524 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; | 543 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; |
525 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; | 544 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; |
545 | currentRegionSettings.TelehubObject = loadedRegionSettings.TelehubObject; | ||
546 | currentRegionSettings.ClearSpawnPoints(); | ||
547 | foreach (SpawnPoint sp in loadedRegionSettings.SpawnPoints()) | ||
548 | currentRegionSettings.AddSpawnPoint(sp); | ||
526 | 549 | ||
527 | currentRegionSettings.Save(); | 550 | currentRegionSettings.Save(); |
528 | 551 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index eabe46e..5679ad5 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
328 | /// <returns></returns> | 328 | /// <returns></returns> |
329 | public string CreateControlFile(Dictionary<string, object> options) | 329 | public string CreateControlFile(Dictionary<string, object> options) |
330 | { | 330 | { |
331 | int majorVersion = MAX_MAJOR_VERSION, minorVersion = 7; | 331 | int majorVersion = MAX_MAJOR_VERSION, minorVersion = 8; |
332 | // | 332 | // |
333 | // if (options.ContainsKey("version")) | 333 | // if (options.ContainsKey("version")) |
334 | // { | 334 | // { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 053c6f5..394ca27 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -534,6 +534,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
534 | rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); | 534 | rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); |
535 | rs.UseEstateSun = true; | 535 | rs.UseEstateSun = true; |
536 | rs.WaterHeight = 23; | 536 | rs.WaterHeight = 23; |
537 | rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111"); | ||
538 | rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); | ||
537 | 539 | ||
538 | tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); | 540 | tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); |
539 | 541 | ||
@@ -580,6 +582,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
580 | Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080"))); | 582 | Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080"))); |
581 | Assert.That(loadedRs.UseEstateSun, Is.True); | 583 | Assert.That(loadedRs.UseEstateSun, Is.True); |
582 | Assert.That(loadedRs.WaterHeight, Is.EqualTo(23)); | 584 | Assert.That(loadedRs.WaterHeight, Is.EqualTo(23)); |
585 | Assert.AreEqual(UUID.Zero, loadedRs.TelehubObject); // because no object was found with the original UUID | ||
586 | Assert.AreEqual(0, loadedRs.SpawnPoints().Count); | ||
583 | } | 587 | } |
584 | 588 | ||
585 | /// <summary> | 589 | /// <summary> |