diff options
author | Justin Clark-Casey (justincc) | 2012-05-19 04:56:47 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-19 04:56:47 +0100 |
commit | 5759313f7f3ff121d20e5eb44013e2bbb4bc2eee (patch) | |
tree | bf0cf144375c811944fbc805c6d19ac00946df9b /OpenSim/Region/CoreModules | |
parent | refactor: Add RegionConnection.PosX and PosY to return position in meters rat... (diff) | |
download | opensim-SC-5759313f7f3ff121d20e5eb44013e2bbb4bc2eee.zip opensim-SC-5759313f7f3ff121d20e5eb44013e2bbb4bc2eee.tar.gz opensim-SC-5759313f7f3ff121d20e5eb44013e2bbb4bc2eee.tar.bz2 opensim-SC-5759313f7f3ff121d20e5eb44013e2bbb4bc2eee.tar.xz |
Add size of region to OAR control file. Megaregions (sw root OARs when saved) will have a size larger than 256x256
Not yet read. Do not rely on this information yet, it may change.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index e54774b..504f09b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -391,36 +391,46 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
391 | xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); | 391 | xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); |
392 | xtw.WriteElementString("id", UUID.Random().ToString()); | 392 | xtw.WriteElementString("id", UUID.Random().ToString()); |
393 | xtw.WriteEndElement(); | 393 | xtw.WriteEndElement(); |
394 | 394 | ||
395 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); | 395 | xtw.WriteStartElement("region_info"); |
396 | 396 | ||
397 | bool isMegaregion; | 397 | bool isMegaregion; |
398 | Vector2 size; | ||
399 | IRegionCombinerModule rcMod = null; | ||
398 | 400 | ||
399 | // FIXME: This is only here for regression test purposes since they do not supply a module. Need to fix | 401 | // FIXME: This is only here for regression test purposes since they do not supply a module. Need to fix |
400 | // this, possibly by doing control file creation somewhere else. | 402 | // this, possibly by doing control file creation somewhere else. |
401 | if (m_module != null && m_module.RegionCombinerModule != null) | 403 | if (m_module != null) |
402 | { | 404 | rcMod = m_module.RegionCombinerModule; |
403 | IRegionCombinerModule mod = m_module.RegionCombinerModule; | 405 | |
404 | isMegaregion = mod.IsRootForMegaregion(m_scene.RegionInfo.RegionID); | 406 | if (rcMod != null) |
405 | } | 407 | isMegaregion = rcMod.IsRootForMegaregion(m_scene.RegionInfo.RegionID); |
406 | else | 408 | else |
407 | { | ||
408 | isMegaregion = false; | 409 | isMegaregion = false; |
409 | } | 410 | |
410 | 411 | if (isMegaregion) | |
412 | size = rcMod.GetSizeOfMegaregion(m_scene.RegionInfo.RegionID); | ||
413 | else | ||
414 | size = new Vector2((float)Constants.RegionSize, (float)Constants.RegionSize); | ||
415 | |||
411 | xtw.WriteElementString("is_megaregion", isMegaregion.ToString()); | 416 | xtw.WriteElementString("is_megaregion", isMegaregion.ToString()); |
417 | xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); | ||
418 | |||
419 | xtw.WriteEndElement(); | ||
412 | 420 | ||
421 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); | ||
422 | |||
413 | xtw.WriteEndElement(); | 423 | xtw.WriteEndElement(); |
414 | 424 | ||
415 | xtw.Flush(); | 425 | xtw.Flush(); |
416 | xtw.Close(); | ||
417 | } | 426 | } |
418 | 427 | ||
419 | s = sw.ToString(); | 428 | s = sw.ToString(); |
420 | } | 429 | } |
421 | 430 | ||
422 | // Console.WriteLine( | 431 | if (m_scene != null) |
423 | // "[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s); | 432 | Console.WriteLine( |
433 | "[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s); | ||
424 | 434 | ||
425 | return s; | 435 | return s; |
426 | } | 436 | } |