diff options
author | Melanie | 2011-01-28 02:34:45 +0000 |
---|---|---|
committer | Melanie | 2011-01-28 02:34:45 +0000 |
commit | 80bf95b7b4ccdbe3a28e9f8ee8764843a3ad46e5 (patch) | |
tree | 3ec33fe5a21dbbb2d2eb4a6cb72d18c426a672f7 /OpenSim | |
parent | Thank you, Goetz, for a patch to fix prim count display in cut regions. (diff) | |
parent | Refactor: Break out LoadObjects() and LoadParcels() from a longer method (diff) | |
download | opensim-SC_OLD-80bf95b7b4ccdbe3a28e9f8ee8764843a3ad46e5.zip opensim-SC_OLD-80bf95b7b4ccdbe3a28e9f8ee8764843a3ad46e5.tar.gz opensim-SC_OLD-80bf95b7b4ccdbe3a28e9f8ee8764843a3ad46e5.tar.bz2 opensim-SC_OLD-80bf95b7b4ccdbe3a28e9f8ee8764843a3ad46e5.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 72 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 16 |
2 files changed, 58 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 44fd994..fd8f546 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) |
@@ -327,11 +318,36 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
327 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; | 318 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount; |
328 | 319 | ||
329 | if (ignoredObjects > 0) | 320 | if (ignoredObjects > 0) |
330 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 321 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
331 | 322 | } | |
332 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 323 | |
333 | 324 | /// <summary> | |
334 | m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage); | 325 | /// Load serialized parcels. |
326 | /// </summary> | ||
327 | /// <param name="serialisedParcels"></param> | ||
328 | protected void LoadParcels(List<string> serialisedParcels) | ||
329 | { | ||
330 | // Reload serialized parcels | ||
331 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | ||
332 | List<LandData> landData = new List<LandData>(); | ||
333 | foreach (string serialisedParcel in serialisedParcels) | ||
334 | { | ||
335 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | ||
336 | if (!ResolveUserUuid(parcel.OwnerID)) | ||
337 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
338 | |||
339 | // m_log.DebugFormat( | ||
340 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", | ||
341 | // parcel.Name, parcel.LocalID, parcel.Area); | ||
342 | |||
343 | landData.Add(parcel); | ||
344 | } | ||
345 | |||
346 | if (!m_merge) | ||
347 | m_scene.LandChannel.Clear(false); | ||
348 | |||
349 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | ||
350 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | ||
335 | } | 351 | } |
336 | 352 | ||
337 | /// <summary> | 353 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 893e35c..98ba8c3 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1653,9 +1653,21 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1653 | 1653 | ||
1654 | protected void ClearCommand(Object[] args) | 1654 | protected void ClearCommand(Object[] args) |
1655 | { | 1655 | { |
1656 | Clear(true); | 1656 | string response = MainConsole.Instance.CmdPrompt( |
1657 | string.Format( | ||
1658 | "Are you sure that you want to clear all land parcels from {0} (y or n)", | ||
1659 | m_scene.RegionInfo.RegionName), | ||
1660 | "n"); | ||
1657 | 1661 | ||
1658 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); | 1662 | if (response.ToLower() == "y") |
1663 | { | ||
1664 | Clear(true); | ||
1665 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); | ||
1666 | } | ||
1667 | else | ||
1668 | { | ||
1669 | MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.RegionInfo.RegionName); | ||
1670 | } | ||
1659 | } | 1671 | } |
1660 | 1672 | ||
1661 | protected void ShowParcelsCommand(Object[] args) | 1673 | protected void ShowParcelsCommand(Object[] args) |