diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 72 |
1 files changed, 44 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 29d0713..b1dec4c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -217,31 +217,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
217 | m_scene.DeleteAllSceneObjects(); | 217 | m_scene.DeleteAllSceneObjects(); |
218 | } | 218 | } |
219 | 219 | ||
220 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 220 | LoadParcels(serialisedParcels); |
221 | // otherwise, use the master avatar uuid instead | 221 | LoadObjects(serialisedSceneObjects); |
222 | 222 | ||
223 | // Reload serialized parcels | 223 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
224 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | ||
225 | List<LandData> landData = new List<LandData>(); | ||
226 | foreach (string serialisedParcel in serialisedParcels) | ||
227 | { | ||
228 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | ||
229 | if (!ResolveUserUuid(parcel.OwnerID)) | ||
230 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
231 | |||
232 | // m_log.DebugFormat( | ||
233 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", | ||
234 | // parcel.Name, parcel.LocalID, parcel.Area); | ||
235 | |||
236 | landData.Add(parcel); | ||
237 | } | ||
238 | |||
239 | if (!m_merge) | ||
240 | m_scene.LandChannel.Clear(false); | ||
241 | |||
242 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | ||
243 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | ||
244 | 224 | ||
225 | m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage); | ||
226 | } | ||
227 | |||
228 | /// <summary> | ||
229 | /// Load serialized scene objects. | ||
230 | /// </summary> | ||
231 | /// <param name="serialisedSceneObjects"></param> | ||
232 | protected void LoadObjects(List<string> serialisedSceneObjects) | ||
233 | { | ||
245 | // Reload serialized prims | 234 | // Reload serialized prims |
246 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 235 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
247 | 236 | ||
@@ -271,6 +260,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
271 | // to the same scene (when this is possible). | 260 | // to the same scene (when this is possible). |
272 | sceneObject.ResetIDs(); | 261 | sceneObject.ResetIDs(); |
273 | 262 | ||
263 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | ||
264 | // or creator data is present. Otherwise, use the estate owner instead. | ||
274 | foreach (SceneObjectPart part in sceneObject.Parts) | 265 | foreach (SceneObjectPart part in sceneObject.Parts) |
275 | { | 266 | { |
276 | if (part.CreatorData == null || part.CreatorData == string.Empty) | 267 | if (part.CreatorData == null || part.CreatorData == string.Empty) |
@@ -345,11 +336,36 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
345 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; | 336 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; |
346 | 337 | ||
347 | if (ignoredObjects > 0) | 338 | if (ignoredObjects > 0) |
348 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 339 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
349 | 340 | } | |
350 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 341 | |
351 | 342 | /// <summary> | |
352 | m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage); | 343 | /// Load serialized parcels. |
344 | /// </summary> | ||
345 | /// <param name="serialisedParcels"></param> | ||
346 | protected void LoadParcels(List<string> serialisedParcels) | ||
347 | { | ||
348 | // Reload serialized parcels | ||
349 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | ||
350 | List<LandData> landData = new List<LandData>(); | ||
351 | foreach (string serialisedParcel in serialisedParcels) | ||
352 | { | ||
353 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | ||
354 | if (!ResolveUserUuid(parcel.OwnerID)) | ||
355 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
356 | |||
357 | // m_log.DebugFormat( | ||
358 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", | ||
359 | // parcel.Name, parcel.LocalID, parcel.Area); | ||
360 | |||
361 | landData.Add(parcel); | ||
362 | } | ||
363 | |||
364 | if (!m_merge) | ||
365 | m_scene.LandChannel.Clear(false); | ||
366 | |||
367 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | ||
368 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | ||
353 | } | 369 | } |
354 | 370 | ||
355 | /// <summary> | 371 | /// <summary> |