diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
3 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 381c8f7..b1b2336f8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -38,10 +38,11 @@ using OpenMetaverse; | |||
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Serialization; | 39 | using OpenSim.Framework.Serialization; |
40 | using OpenSim.Framework.Serialization.External; | 40 | using OpenSim.Framework.Serialization.External; |
41 | using OpenSim.Framework.Communications.Cache; | 41 | |
42 | using OpenSim.Region.CoreModules.World.Terrain; | 42 | using OpenSim.Region.CoreModules.World.Terrain; |
43 | using OpenSim.Region.Framework.Interfaces; | 43 | using OpenSim.Region.Framework.Interfaces; |
44 | using OpenSim.Region.Framework.Scenes; | 44 | using OpenSim.Region.Framework.Scenes; |
45 | using OpenSim.Services.Interfaces; | ||
45 | 46 | ||
46 | namespace OpenSim.Region.CoreModules.World.Archiver | 47 | namespace OpenSim.Region.CoreModules.World.Archiver |
47 | { | 48 | { |
@@ -193,10 +194,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
193 | 194 | ||
194 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 195 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
195 | // otherwise, use the master avatar uuid instead | 196 | // otherwise, use the master avatar uuid instead |
196 | UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
197 | |||
198 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | ||
199 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
200 | 197 | ||
201 | // Reload serialized parcels | 198 | // Reload serialized parcels |
202 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | 199 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); |
@@ -205,7 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
205 | { | 202 | { |
206 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | 203 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); |
207 | if (!ResolveUserUuid(parcel.OwnerID)) | 204 | if (!ResolveUserUuid(parcel.OwnerID)) |
208 | parcel.OwnerID = masterAvatarId; | 205 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
209 | landData.Add(parcel); | 206 | landData.Add(parcel); |
210 | } | 207 | } |
211 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 208 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
@@ -244,13 +241,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
244 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 241 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
245 | { | 242 | { |
246 | if (!ResolveUserUuid(part.CreatorID)) | 243 | if (!ResolveUserUuid(part.CreatorID)) |
247 | part.CreatorID = masterAvatarId; | 244 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
248 | 245 | ||
249 | if (!ResolveUserUuid(part.OwnerID)) | 246 | if (!ResolveUserUuid(part.OwnerID)) |
250 | part.OwnerID = masterAvatarId; | 247 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
251 | 248 | ||
252 | if (!ResolveUserUuid(part.LastOwnerID)) | 249 | if (!ResolveUserUuid(part.LastOwnerID)) |
253 | part.LastOwnerID = masterAvatarId; | 250 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
254 | 251 | ||
255 | // And zap any troublesome sit target information | 252 | // And zap any troublesome sit target information |
256 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | 253 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); |
@@ -266,11 +263,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
266 | { | 263 | { |
267 | if (!ResolveUserUuid(kvp.Value.OwnerID)) | 264 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
268 | { | 265 | { |
269 | kvp.Value.OwnerID = masterAvatarId; | 266 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
270 | } | 267 | } |
271 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 268 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
272 | { | 269 | { |
273 | kvp.Value.CreatorID = masterAvatarId; | 270 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
274 | } | 271 | } |
275 | } | 272 | } |
276 | } | 273 | } |
@@ -304,8 +301,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
304 | { | 301 | { |
305 | if (!m_validUserUuids.ContainsKey(uuid)) | 302 | if (!m_validUserUuids.ContainsKey(uuid)) |
306 | { | 303 | { |
307 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(uuid); | 304 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); |
308 | if (profile != null && profile.UserProfile != null) | 305 | if (account != null) |
309 | m_validUserUuids.Add(uuid, true); | 306 | m_validUserUuids.Add(uuid, true); |
310 | else | 307 | else |
311 | m_validUserUuids.Add(uuid, false); | 308 | m_validUserUuids.Add(uuid, false); |
@@ -350,7 +347,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
350 | 347 | ||
351 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 348 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
352 | 349 | ||
353 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType); | 350 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString()); |
354 | asset.Data = data; | 351 | asset.Data = data; |
355 | 352 | ||
356 | // We're relying on the asset service to do the sensible thing and not store the asset if it already | 353 | // We're relying on the asset service to do the sensible thing and not store the asset if it already |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 2d2c570..2c04008 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
158 | 158 | ||
159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
160 | 160 | ||
161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType); | 161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType, UUID.Zero.ToString()); |
162 | asset.Description = metadata.Description; | 162 | asset.Description = metadata.Description; |
163 | asset.Data = data; | 163 | asset.Data = data; |
164 | 164 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index e77a23b..de16d89 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -34,7 +34,7 @@ using NUnit.Framework; | |||
34 | using NUnit.Framework.SyntaxHelpers; | 34 | using NUnit.Framework.SyntaxHelpers; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications.Cache; | 37 | |
38 | using OpenSim.Framework.Serialization; | 38 | using OpenSim.Framework.Serialization; |
39 | using OpenSim.Framework.Serialization.External; | 39 | using OpenSim.Framework.Serialization.External; |
40 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
63 | SerialiserModule serialiserModule = new SerialiserModule(); | 63 | SerialiserModule serialiserModule = new SerialiserModule(); |
64 | TerrainModule terrainModule = new TerrainModule(); | 64 | TerrainModule terrainModule = new TerrainModule(); |
65 | 65 | ||
66 | m_scene = SceneSetupHelpers.SetupScene("scene1"); | 66 | m_scene = SceneSetupHelpers.SetupScene("useraccounts"); |
67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); | 67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); |
68 | } | 68 | } |
69 | 69 | ||