aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs72
1 files changed, 72 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index e04662f..a5b5917 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -69,6 +69,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
69 69
70 private void DearchiveRegion() 70 private void DearchiveRegion()
71 { 71 {
72 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions
73 DearchiveRegion0DotStar();
74 }
75
76 private void DearchiveRegion0DotStar()
77 {
72 TarArchiveReader archive 78 TarArchiveReader archive
73 = new TarArchiveReader( 79 = new TarArchiveReader(
74 new GZipStream(GetStream(m_loadPath), CompressionMode.Decompress)); 80 new GZipStream(GetStream(m_loadPath), CompressionMode.Decompress));
@@ -107,6 +113,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
107 { 113 {
108 LoadTerrain(filePath, data); 114 LoadTerrain(filePath, data);
109 } 115 }
116 else if (filePath.StartsWith(ArchiveConstants.SETTINGS_PATH))
117 {
118 LoadRegionSettings(filePath, data);
119 }
110 } 120 }
111 121
112 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 122 //m_log.Debug("[ARCHIVER]: Reached end of archive");
@@ -267,6 +277,68 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
267 return false; 277 return false;
268 } 278 }
269 } 279 }
280
281 /// <summary>
282 /// Load region settings data
283 /// </summary>
284 /// <param name="settingsPath"></param>
285 /// <param name="data"></param>
286 /// <returns>
287 /// true if settings were loaded successfully, false otherwise
288 /// </returns>
289 private bool LoadRegionSettings(string settingsPath, byte[] data)
290 {
291 RegionSettings loadedRegionSettings;
292
293 try
294 {
295 loadedRegionSettings = RegionSettingsSerializer.Deserialize(data);
296 }
297 catch (Exception e)
298 {
299 m_log.ErrorFormat(
300 "[ARCHIVER]: Could not parse region settings file {0}. Ignoring. Exception was {1}",
301 settingsPath, e);
302 return false;
303 }
304
305 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
306
307 currentRegionSettings.AgentLimit = loadedRegionSettings.AgentLimit;
308 currentRegionSettings.AllowDamage = loadedRegionSettings.AllowDamage;
309 currentRegionSettings.AllowLandJoinDivide = loadedRegionSettings.AllowLandJoinDivide;
310 currentRegionSettings.AllowLandResell = loadedRegionSettings.AllowLandResell;
311 currentRegionSettings.BlockFly = loadedRegionSettings.BlockFly;
312 currentRegionSettings.BlockShowInSearch = loadedRegionSettings.BlockShowInSearch;
313 currentRegionSettings.BlockTerraform = loadedRegionSettings.BlockTerraform;
314 currentRegionSettings.DisableCollisions = loadedRegionSettings.DisableCollisions;
315 currentRegionSettings.DisablePhysics = loadedRegionSettings.DisablePhysics;
316 currentRegionSettings.DisableScripts = loadedRegionSettings.DisableScripts;
317 currentRegionSettings.Elevation1NE = loadedRegionSettings.Elevation1NE;
318 currentRegionSettings.Elevation1NW = loadedRegionSettings.Elevation1NW;
319 currentRegionSettings.Elevation1SE = loadedRegionSettings.Elevation1SE;
320 currentRegionSettings.Elevation1SW = loadedRegionSettings.Elevation1SW;
321 currentRegionSettings.Elevation2NE = loadedRegionSettings.Elevation2NE;
322 currentRegionSettings.Elevation2NW = loadedRegionSettings.Elevation2NW;
323 currentRegionSettings.Elevation2SE = loadedRegionSettings.Elevation2SE;
324 currentRegionSettings.Elevation2SW = loadedRegionSettings.Elevation2SW;
325 currentRegionSettings.FixedSun = loadedRegionSettings.FixedSun;
326 currentRegionSettings.ObjectBonus = loadedRegionSettings.ObjectBonus;
327 currentRegionSettings.RestrictPushing = loadedRegionSettings.RestrictPushing;
328 currentRegionSettings.TerrainLowerLimit = loadedRegionSettings.TerrainLowerLimit;
329 currentRegionSettings.TerrainRaiseLimit = loadedRegionSettings.TerrainRaiseLimit;
330 currentRegionSettings.TerrainTexture1 = loadedRegionSettings.TerrainTexture1;
331 currentRegionSettings.TerrainTexture2 = loadedRegionSettings.TerrainTexture2;
332 currentRegionSettings.TerrainTexture3 = loadedRegionSettings.TerrainTexture3;
333 currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
334 currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
335 currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
336
337 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
338 estateModule.sendRegionHandshakeToAll();
339
340 return true;
341 }
270 342
271 /// <summary> 343 /// <summary>
272 /// Load terrain data 344 /// Load terrain data