aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver
diff options
context:
space:
mode:
authorUbitUmarov2015-09-02 19:54:53 +0100
committerUbitUmarov2015-09-02 19:54:53 +0100
commita11edceb00b5b86f825bd957bdac9edb91f893dd (patch)
treec192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Region/CoreModules/World/Archiver
parentbad merge? (diff)
downloadopensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip
opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz
opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2
opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz
seems to compile ( tests comented out)
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs84
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs33
2 files changed, 4 insertions, 113 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index f0b0f4a..406f4a8 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -162,13 +162,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
162 162
163 private UUID m_defaultUser; 163 private UUID m_defaultUser;
164 164
165<<<<<<< HEAD
166 private UUID m_defaultUser;
167
168 public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary<string,object>options)
169=======
170 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)
171>>>>>>> avn/ubitvar
172 { 166 {
173 m_rootScene = scene; 167 m_rootScene = scene;
174 168
@@ -177,11 +171,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
177 m_defaultUser = (UUID)options["default-user"]; 171 m_defaultUser = (UUID)options["default-user"];
178 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());
179 } 173 }
180<<<<<<< HEAD
181 else
182=======
183 else 174 else
184>>>>>>> avn/ubitvar
185 { 175 {
186 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; 176 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
187 } 177 }
@@ -200,10 +190,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
200 } 190 }
201 191
202 m_errorMessage = String.Empty; 192 m_errorMessage = String.Empty;
203<<<<<<< HEAD
204=======
205 193
206>>>>>>> avn/ubitvar
207 m_merge = options.ContainsKey("merge"); 194 m_merge = options.ContainsKey("merge");
208 m_forceTerrain = options.ContainsKey("force-terrain"); 195 m_forceTerrain = options.ContainsKey("force-terrain");
209 m_forceParcels = options.ContainsKey("force-parcels"); 196 m_forceParcels = options.ContainsKey("force-parcels");
@@ -212,34 +199,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver
212 m_requestId = requestId; 199 m_requestId = requestId;
213 m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero; 200 m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero;
214 m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f; 201 m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f;
215<<<<<<< HEAD
216 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"]
217 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f);
218
219 // Zero can never be a valid user or group id
220 m_validUserUuids[UUID.Zero] = false;
221 m_validGroupUuids[UUID.Zero] = false;
222=======
223 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] 202 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"]
224 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); 203 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f);
225 204
226 m_requestId = requestId;
227
228 // Zero can never be a valid user id (or group) 205 // Zero can never be a valid user id (or group)
229 m_validUserUuids[UUID.Zero] = false; 206 m_validUserUuids[UUID.Zero] = false;
230 m_validGroupUuids[UUID.Zero] = false; 207 m_validGroupUuids[UUID.Zero] = false;
231 208
232>>>>>>> avn/ubitvar
233
234 m_groupsModule = m_rootScene.RequestModuleInterface<IGroupsModule>(); 209 m_groupsModule = m_rootScene.RequestModuleInterface<IGroupsModule>();
235 m_assetService = m_rootScene.AssetService; 210 m_assetService = m_rootScene.AssetService;
236 } 211 }
237 212
238<<<<<<< HEAD
239 public ArchiveReadRequest(Scene scene, Stream loadStream, Guid requestId, Dictionary<string, object>options)
240=======
241 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)
242>>>>>>> avn/ubitvar
243 { 214 {
244 m_rootScene = scene; 215 m_rootScene = scene;
245 m_loadPath = null; 216 m_loadPath = null;
@@ -249,11 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
249 m_requestId = requestId; 220 m_requestId = requestId;
250 221
251 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; 222 m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
252<<<<<<< HEAD
253
254=======
255 223
256>>>>>>> avn/ubitvar
257 // Zero can never be a valid user id 224 // Zero can never be a valid user id
258 m_validUserUuids[UUID.Zero] = false; 225 m_validUserUuids[UUID.Zero] = false;
259 226
@@ -327,24 +294,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
327 if ((successfulAssetRestores + failedAssetRestores) % 250 == 0) 294 if ((successfulAssetRestores + failedAssetRestores) % 250 == 0)
328 m_log.Debug("[ARCHIVER]: Loaded " + successfulAssetRestores + " assets and failed to load " + failedAssetRestores + " assets..."); 295 m_log.Debug("[ARCHIVER]: Loaded " + successfulAssetRestores + " assets and failed to load " + failedAssetRestores + " assets...");
329 } 296 }
330<<<<<<< HEAD
331 else if (filePath.StartsWith(ArchiveConstants.TERRAINS_PATH) && (!m_merge || m_forceTerrain)) 297 else if (filePath.StartsWith(ArchiveConstants.TERRAINS_PATH) && (!m_merge || m_forceTerrain))
332=======
333 else if ((!m_merge || m_forceTerrain) && filePath.StartsWith(ArchiveConstants.TERRAINS_PATH))
334>>>>>>> avn/ubitvar
335 { 298 {
336 LoadTerrain(scene, filePath, data); 299 LoadTerrain(scene, filePath, data);
337 } 300 }
338 else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH)) 301 else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH))
339 { 302 {
340 LoadRegionSettings(scene, filePath, data, dearchivedScenes); 303 LoadRegionSettings(scene, filePath, data, dearchivedScenes);
341<<<<<<< HEAD
342 } 304 }
343 else if (filePath.StartsWith(ArchiveConstants.LANDDATA_PATH) && (!m_merge || m_forceParcels)) 305 else if (filePath.StartsWith(ArchiveConstants.LANDDATA_PATH) && (!m_merge || m_forceParcels))
344=======
345 }
346 else if ((!m_merge || m_forceParcels) && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH))
347>>>>>>> avn/ubitvar
348 { 306 {
349 sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data)); 307 sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data));
350 } 308 }
@@ -565,10 +523,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
565 } 523 }
566 } 524 }
567 525
568<<<<<<< HEAD
569
570=======
571>>>>>>> avn/ubitvar
572 bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero); 526 bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero);
573 527
574 // 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
@@ -585,10 +539,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
585 } 539 }
586 540
587 ModifySceneObject(scene, sceneObject); 541 ModifySceneObject(scene, sceneObject);
588<<<<<<< HEAD
589=======
590
591>>>>>>> avn/ubitvar
592 542
593 if (scene.AddRestoredSceneObject(sceneObject, true, false)) 543 if (scene.AddRestoredSceneObject(sceneObject, true, false))
594 { 544 {
@@ -649,8 +599,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
649 // being no copy/no mod for everyone 599 // being no copy/no mod for everyone
650 lock (part.TaskInventory) 600 lock (part.TaskInventory)
651 { 601 {
652<<<<<<< HEAD
653=======
654 // And zap any troublesome sit target information 602 // And zap any troublesome sit target information
655 part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); 603 part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
656 part.SitTargetPosition = new Vector3(0, 0, 0); 604 part.SitTargetPosition = new Vector3(0, 0, 0);
@@ -659,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
659 // Not doing so results in inventory items 607 // Not doing so results in inventory items
660 // being no copy/no mod for everyone 608 // being no copy/no mod for everyone
661 part.TaskInventory.LockItemsForRead(true); 609 part.TaskInventory.LockItemsForRead(true);
662>>>>>>> avn/ubitvar 610
663 TaskInventoryDictionary inv = part.TaskInventory; 611 TaskInventoryDictionary inv = part.TaskInventory;
664 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) 612 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
665 { 613 {
@@ -680,18 +628,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
680 if (!ResolveGroupUuid(kvp.Value.GroupID)) 628 if (!ResolveGroupUuid(kvp.Value.GroupID))
681 kvp.Value.GroupID = UUID.Zero; 629 kvp.Value.GroupID = UUID.Zero;
682 } 630 }
683<<<<<<< HEAD
684=======
685 part.TaskInventory.LockItemsForRead(false); 631 part.TaskInventory.LockItemsForRead(false);
686>>>>>>> avn/ubitvar 632
687 } 633 }
688 } 634 }
689 } 635 }
690 636
691<<<<<<< HEAD
692
693=======
694>>>>>>> avn/ubitvar
695 /// <summary> 637 /// <summary>
696 /// Load serialized parcels. 638 /// Load serialized parcels.
697 /// </summary> 639 /// </summary>
@@ -712,11 +654,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
712 parcel.AABBMin += parcelDisp; 654 parcel.AABBMin += parcelDisp;
713 parcel.AABBMax += parcelDisp; 655 parcel.AABBMax += parcelDisp;
714 } 656 }
715<<<<<<< HEAD 657
716
717=======
718
719>>>>>>> avn/ubitvar
720 // Validate User and Group UUID's 658 // Validate User and Group UUID's
721 659
722 if (!ResolveGroupUuid(parcel.GroupID)) 660 if (!ResolveGroupUuid(parcel.GroupID))
@@ -731,26 +669,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver
731 } 669 }
732 else 670 else
733 { 671 {
734<<<<<<< HEAD
735 parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
736=======
737 parcel.OwnerID = m_defaultUser; 672 parcel.OwnerID = m_defaultUser;
738 parcel.GroupID = UUID.Zero; 673 parcel.GroupID = UUID.Zero;
739>>>>>>> avn/ubitvar
740 parcel.IsGroupOwned = false; 674 parcel.IsGroupOwned = false;
741 } 675 }
742 } 676 }
743 else 677 else
744 { 678 {
745 if (!ResolveUserUuid(scene, parcel.OwnerID)) 679 if (!ResolveUserUuid(scene, parcel.OwnerID))
746<<<<<<< HEAD
747 parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
748=======
749 parcel.OwnerID = m_defaultUser; 680 parcel.OwnerID = m_defaultUser;
750 681
751 if (!ResolveGroupUuid(parcel.GroupID)) 682 if (!ResolveGroupUuid(parcel.GroupID))
752 parcel.GroupID = UUID.Zero; 683 parcel.GroupID = UUID.Zero;
753>>>>>>> avn/ubitvar
754 } 684 }
755 685
756 List<LandAccessEntry> accessList = new List<LandAccessEntry>(); 686 List<LandAccessEntry> accessList = new List<LandAccessEntry>();
@@ -879,10 +809,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
879 if (data == null) 809 if (data == null)
880 return false; 810 return false;
881 } 811 }
882<<<<<<< HEAD
883 812
884=======
885>>>>>>> avn/ubitvar
886 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 813 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
887 814
888 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString()); 815 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString());
@@ -1004,11 +931,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
1004 private bool LoadTerrain(Scene scene, string terrainPath, byte[] data) 931 private bool LoadTerrain(Scene scene, string terrainPath, byte[] data)
1005 { 932 {
1006 ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>(); 933 ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
1007<<<<<<< HEAD
1008
1009=======
1010
1011>>>>>>> avn/ubitvar
1012 using (MemoryStream ms = new MemoryStream(data)) 934 using (MemoryStream ms = new MemoryStream(data))
1013 { 935 {
1014 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 0fb8a32..4178a57 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -111,19 +111,7 @@ 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<<<<<<< HEAD 114
115
116 OptionSet options = new OptionSet();
117 options.Add("m|merge", delegate (string v) { mergeOar = (v != null); });
118 options.Add("s|skip-assets", delegate (string v) { skipAssets = (v != null); });
119 options.Add("force-terrain", delegate (string v) { forceTerrain = (v != null); });
120 options.Add("forceterrain", delegate (string v) { forceTerrain = (v != null); }); // downward compatibility
121 options.Add("force-parcels", delegate (string v) { forceParcels = (v != null); });
122 options.Add("forceparcels", delegate (string v) { forceParcels = (v != null); }); // downward compatibility
123 options.Add("no-objects", delegate (string v) { noObjects = (v != null); });
124 options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; });
125 options.Add("displacement=", delegate (string v) {
126=======
127 115
128 OptionSet options = new OptionSet(); 116 OptionSet options = new OptionSet();
129 options.Add("m|merge", delegate(string v) { mergeOar = (v != null); }); 117 options.Add("m|merge", delegate(string v) { mergeOar = (v != null); });
@@ -136,7 +124,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
136 options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; }); 124 options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; });
137 options.Add("displacement=", delegate(string v) 125 options.Add("displacement=", delegate(string v)
138 { 126 {
139>>>>>>> avn/ubitvar
140 try 127 try
141 { 128 {
142 displacement = v == null ? Vector3.Zero : Vector3.Parse(v); 129 displacement = v == null ? Vector3.Zero : Vector3.Parse(v);
@@ -163,12 +150,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
163 // Convert to radians for internals 150 // Convert to radians for internals
164 rotation = Util.Clamp<float>(rotation, -359f, 359f) / 180f * (float)Math.PI; 151 rotation = Util.Clamp<float>(rotation, -359f, 359f) / 180f * (float)Math.PI;
165 }); 152 });
166<<<<<<< HEAD
167 options.Add("rotation-center=", delegate (string v) {
168=======
169 options.Add("rotation-center=", delegate(string v) 153 options.Add("rotation-center=", delegate(string v)
170 { 154 {
171>>>>>>> avn/ubitvar
172 try 155 try
173 { 156 {
174 rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v); 157 rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v);
@@ -308,21 +291,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
308 Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); 291 Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
309 DearchiveRegion(loadPath, Guid.Empty, archiveOptions); 292 DearchiveRegion(loadPath, Guid.Empty, archiveOptions);
310 } 293 }
311<<<<<<< HEAD
312
313 public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string,object> options)
314 {
315 m_log.InfoFormat(
316 "[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath);
317
318=======
319 294
320 public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string, object> options) 295 public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string, object> options)
321 { 296 {
322 m_log.InfoFormat( 297 m_log.InfoFormat(
323 "[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);
324 299
325>>>>>>> avn/ubitvar
326 new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); 300 new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion();
327 } 301 }
328 302
@@ -331,11 +305,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
331 Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); 305 Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
332 DearchiveRegion(loadStream, Guid.Empty, archiveOptions); 306 DearchiveRegion(loadStream, Guid.Empty, archiveOptions);
333 } 307 }
334<<<<<<< HEAD
335
336=======
337
338>>>>>>> avn/ubitvar
339 public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary<string, object> options) 308 public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary<string, object> options)
340 { 309 {
341 new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion(); 310 new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion();