aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs40
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs8
3 files changed, 44 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 9c6706f..406f4a8 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -160,10 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
160 160
161 private IAssetService m_assetService = null; 161 private IAssetService m_assetService = null;
162 162
163
164 private UUID m_defaultUser; 163 private UUID m_defaultUser;
165 164
166 public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary<string,object>options) 165 public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary<string, object> options)
167 { 166 {
168 m_rootScene = scene; 167 m_rootScene = scene;
169 168
@@ -172,7 +171,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
172 m_defaultUser = (UUID)options["default-user"]; 171 m_defaultUser = (UUID)options["default-user"];
173 m_log.InfoFormat("Using User {0} as default user", m_defaultUser.ToString()); 172 m_log.InfoFormat("Using User {0} as default user", m_defaultUser.ToString());
174 } 173 }
175 else 174 else
176 { 175 {
177 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; 176 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
178 } 177 }
@@ -189,8 +188,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
189 + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); 188 + "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
190 m_log.Error(e); 189 m_log.Error(e);
191 } 190 }
192 191
193 m_errorMessage = String.Empty; 192 m_errorMessage = String.Empty;
193
194 m_merge = options.ContainsKey("merge"); 194 m_merge = options.ContainsKey("merge");
195 m_forceTerrain = options.ContainsKey("force-terrain"); 195 m_forceTerrain = options.ContainsKey("force-terrain");
196 m_forceParcels = options.ContainsKey("force-parcels"); 196 m_forceParcels = options.ContainsKey("force-parcels");
@@ -199,10 +199,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
199 m_requestId = requestId; 199 m_requestId = requestId;
200 m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero; 200 m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero;
201 m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f; 201 m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f;
202 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] 202 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"]
203 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); 203 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f);
204 204
205 // Zero can never be a valid user or group id 205 // Zero can never be a valid user id (or group)
206 m_validUserUuids[UUID.Zero] = false; 206 m_validUserUuids[UUID.Zero] = false;
207 m_validGroupUuids[UUID.Zero] = false; 207 m_validGroupUuids[UUID.Zero] = false;
208 208
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
210 m_assetService = m_rootScene.AssetService; 210 m_assetService = m_rootScene.AssetService;
211 } 211 }
212 212
213 public ArchiveReadRequest(Scene scene, Stream loadStream, Guid requestId, Dictionary<string, object>options) 213 public ArchiveReadRequest(Scene scene, Stream loadStream, Guid requestId, Dictionary<string, object> options)
214 { 214 {
215 m_rootScene = scene; 215 m_rootScene = scene;
216 m_loadPath = null; 216 m_loadPath = null;
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
220 m_requestId = requestId; 220 m_requestId = requestId;
221 221
222 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; 222 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
223 223
224 // Zero can never be a valid user id 224 // Zero can never be a valid user id
225 m_validUserUuids[UUID.Zero] = false; 225 m_validUserUuids[UUID.Zero] = false;
226 226
@@ -523,7 +523,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
523 } 523 }
524 } 524 }
525 525
526
527 bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero); 526 bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero);
528 527
529 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned 528 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
@@ -600,6 +599,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
600 // being no copy/no mod for everyone 599 // being no copy/no mod for everyone
601 lock (part.TaskInventory) 600 lock (part.TaskInventory)
602 { 601 {
602 // And zap any troublesome sit target information
603 part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
604 part.SitTargetPosition = new Vector3(0, 0, 0);
605
606 // Fix ownership/creator of inventory items
607 // Not doing so results in inventory items
608 // being no copy/no mod for everyone
609 part.TaskInventory.LockItemsForRead(true);
610
603 TaskInventoryDictionary inv = part.TaskInventory; 611 TaskInventoryDictionary inv = part.TaskInventory;
604 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) 612 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
605 { 613 {
@@ -620,11 +628,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
620 if (!ResolveGroupUuid(kvp.Value.GroupID)) 628 if (!ResolveGroupUuid(kvp.Value.GroupID))
621 kvp.Value.GroupID = UUID.Zero; 629 kvp.Value.GroupID = UUID.Zero;
622 } 630 }
631 part.TaskInventory.LockItemsForRead(false);
632
623 } 633 }
624 } 634 }
625 } 635 }
626 636
627
628 /// <summary> 637 /// <summary>
629 /// Load serialized parcels. 638 /// Load serialized parcels.
630 /// </summary> 639 /// </summary>
@@ -645,7 +654,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
645 parcel.AABBMin += parcelDisp; 654 parcel.AABBMin += parcelDisp;
646 parcel.AABBMax += parcelDisp; 655 parcel.AABBMax += parcelDisp;
647 } 656 }
648 657
649 // Validate User and Group UUID's 658 // Validate User and Group UUID's
650 659
651 if (!ResolveGroupUuid(parcel.GroupID)) 660 if (!ResolveGroupUuid(parcel.GroupID))
@@ -660,14 +669,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver
660 } 669 }
661 else 670 else
662 { 671 {
663 parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; 672 parcel.OwnerID = m_defaultUser;
673 parcel.GroupID = UUID.Zero;
664 parcel.IsGroupOwned = false; 674 parcel.IsGroupOwned = false;
665 } 675 }
666 } 676 }
667 else 677 else
668 { 678 {
669 if (!ResolveUserUuid(scene, parcel.OwnerID)) 679 if (!ResolveUserUuid(scene, parcel.OwnerID))
670 parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; 680 parcel.OwnerID = m_defaultUser;
681
682 if (!ResolveGroupUuid(parcel.GroupID))
683 parcel.GroupID = UUID.Zero;
671 } 684 }
672 685
673 List<LandAccessEntry> accessList = new List<LandAccessEntry>(); 686 List<LandAccessEntry> accessList = new List<LandAccessEntry>();
@@ -918,7 +931,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
918 private bool LoadTerrain(Scene scene, string terrainPath, byte[] data) 931 private bool LoadTerrain(Scene scene, string terrainPath, byte[] data)
919 { 932 {
920 ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>(); 933 ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
921
922 using (MemoryStream ms = new MemoryStream(data)) 934 using (MemoryStream ms = new MemoryStream(data))
923 { 935 {
924 if (m_displacement != Vector3.Zero || m_rotation != 0f) 936 if (m_displacement != Vector3.Zero || m_rotation != 0f)
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 6a09caf..4178a57 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -111,17 +111,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
111 String defaultUser = ""; 111 String defaultUser = "";
112 float rotation = 0f; 112 float rotation = 0f;
113 Vector3 rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0); 113 Vector3 rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0);
114 114
115
115 OptionSet options = new OptionSet(); 116 OptionSet options = new OptionSet();
116 options.Add("m|merge", delegate (string v) { mergeOar = (v != null); }); 117 options.Add("m|merge", delegate(string v) { mergeOar = (v != null); });
117 options.Add("s|skip-assets", delegate (string v) { skipAssets = (v != null); }); 118 options.Add("s|skip-assets", delegate(string v) { skipAssets = (v != null); });
118 options.Add("force-terrain", delegate (string v) { forceTerrain = (v != null); }); 119 options.Add("force-terrain", delegate(string v) { forceTerrain = (v != null); });
119 options.Add("forceterrain", delegate (string v) { forceTerrain = (v != null); }); // downward compatibility 120 options.Add("forceterrain", delegate(string v) { forceTerrain = (v != null); }); // downward compatibility
120 options.Add("force-parcels", delegate (string v) { forceParcels = (v != null); }); 121 options.Add("force-parcels", delegate(string v) { forceParcels = (v != null); });
121 options.Add("forceparcels", delegate (string v) { forceParcels = (v != null); }); // downward compatibility 122 options.Add("forceparcels", delegate(string v) { forceParcels = (v != null); }); // downward compatibility
122 options.Add("no-objects", delegate (string v) { noObjects = (v != null); }); 123 options.Add("no-objects", delegate(string v) { noObjects = (v != null); });
123 options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; }); 124 options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; });
124 options.Add("displacement=", delegate (string v) { 125 options.Add("displacement=", delegate(string v)
126 {
125 try 127 try
126 { 128 {
127 displacement = v == null ? Vector3.Zero : Vector3.Parse(v); 129 displacement = v == null ? Vector3.Zero : Vector3.Parse(v);
@@ -148,7 +150,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
148 // Convert to radians for internals 150 // Convert to radians for internals
149 rotation = Util.Clamp<float>(rotation, -359f, 359f) / 180f * (float)Math.PI; 151 rotation = Util.Clamp<float>(rotation, -359f, 359f) / 180f * (float)Math.PI;
150 }); 152 });
151 options.Add("rotation-center=", delegate (string v) { 153 options.Add("rotation-center=", delegate(string v)
154 {
152 try 155 try
153 { 156 {
154 rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v); 157 rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v);
@@ -288,12 +291,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
288 Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); 291 Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
289 DearchiveRegion(loadPath, Guid.Empty, archiveOptions); 292 DearchiveRegion(loadPath, Guid.Empty, archiveOptions);
290 } 293 }
291 294
292 public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string,object> options) 295 public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string, object> options)
293 { 296 {
294 m_log.InfoFormat( 297 m_log.InfoFormat(
295 "[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath); 298 "[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath);
296 299
297 new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); 300 new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion();
298 } 301 }
299 302
@@ -302,7 +305,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
302 Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); 305 Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
303 DearchiveRegion(loadStream, Guid.Empty, archiveOptions); 306 DearchiveRegion(loadStream, Guid.Empty, archiveOptions);
304 } 307 }
305
306 public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary<string, object> options) 308 public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary<string, object> options)
307 { 309 {
308 new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion(); 310 new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion();
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index db66c83..895b55d 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -271,18 +271,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
271 271
272 if (asset != null) 272 if (asset != null)
273 { 273 {
274 if (m_options.ContainsKey("verbose")) 274// m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id);
275 m_log.InfoFormat("[ARCHIVER]: Writing asset {0}", id);
276
277 m_foundAssetUuids.Add(asset.FullID); 275 m_foundAssetUuids.Add(asset.FullID);
278 276
279 m_assetsArchiver.WriteAsset(PostProcess(asset)); 277 m_assetsArchiver.WriteAsset(PostProcess(asset));
280 } 278 }
281 else 279 else
282 { 280 {
283 if (m_options.ContainsKey("verbose")) 281// m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id);
284 m_log.InfoFormat("[ARCHIVER]: Recording asset {0} as not found", id);
285
286 m_notFoundAssetUuids.Add(new UUID(id)); 282 m_notFoundAssetUuids.Add(new UUID(id));
287 } 283 }
288 284