aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionInfo.cs
diff options
context:
space:
mode:
authorRobert Adams2013-09-23 10:38:38 -0700
committerRobert Adams2013-09-28 07:33:54 -0700
commitfa1c6883424792bfba04b23e52e258e29f80d380 (patch)
tree314704d533441233e667184e0cc43106c211d83a /OpenSim/Framework/RegionInfo.cs
parentVarRegion: add RegionSize[XYZ] to RegionInfo.cs. (diff)
downloadopensim-SC_OLD-fa1c6883424792bfba04b23e52e258e29f80d380.zip
opensim-SC_OLD-fa1c6883424792bfba04b23e52e258e29f80d380.tar.gz
opensim-SC_OLD-fa1c6883424792bfba04b23e52e258e29f80d380.tar.bz2
opensim-SC_OLD-fa1c6883424792bfba04b23e52e258e29f80d380.tar.xz
varregion: go back to using Constants.RegionSize so as not to break
external modules. People shouldn't use it but don't want to cause too much breakage of legacy modules.
Diffstat (limited to 'OpenSim/Framework/RegionInfo.cs')
-rw-r--r--OpenSim/Framework/RegionInfo.cs33
1 files changed, 13 insertions, 20 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 437c7ff..2d3c9ea 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -146,19 +146,12 @@ namespace OpenSim.Framework
146 public uint RegionWorldLocX = 0; 146 public uint RegionWorldLocX = 0;
147 public uint RegionWorldLocY = 0; 147 public uint RegionWorldLocY = 0;
148 public uint RegionWorldLocZ = 0; 148 public uint RegionWorldLocZ = 0;
149 public uint RegionSizeX = LegacyRegionSize; 149 public uint RegionSizeX = Constants.RegionSize;
150 public uint RegionSizeY = LegacyRegionSize; 150 public uint RegionSizeY = Constants.RegionSize;
151 public uint RegionSizeZ = Constants.RegionHeight; 151 public uint RegionSizeZ = Constants.RegionHeight;
152 152
153
154 private Dictionary<String, String> m_otherSettings = new Dictionary<string, string>(); 153 private Dictionary<String, String> m_otherSettings = new Dictionary<string, string>();
155 154
156 // Originally, regions were fixed size of 256 in X and Y.
157 // For downward compatability, 'RegionLocX' returns the region coordinates in the legacy region units.
158 // This is the constant used to convert world integer coordinates to legacy region units.
159 public const uint LegacyRegionSize = 256;
160
161
162 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. 155 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
163 156
164 // MT: Yes. Estates can't span trust boundaries. Therefore, it can be 157 // MT: Yes. Estates can't span trust boundaries. Therefore, it can be
@@ -460,8 +453,8 @@ namespace OpenSim.Framework
460 /// </summary> 453 /// </summary>
461 public uint LegacyRegionLocX 454 public uint LegacyRegionLocX
462 { 455 {
463 get { return RegionWorldLocX / LegacyRegionSize; } 456 get { return RegionWorldLocX / Constants.RegionSize; }
464 set { RegionWorldLocX = value * LegacyRegionSize; } 457 set { RegionWorldLocX = value * Constants.RegionSize; }
465 } 458 }
466 459
467 /// <summary> 460 /// <summary>
@@ -471,8 +464,8 @@ namespace OpenSim.Framework
471 /// </summary> 464 /// </summary>
472 public uint LegacyRegionLocY 465 public uint LegacyRegionLocY
473 { 466 {
474 get { return RegionWorldLocY / LegacyRegionSize; } 467 get { return RegionWorldLocY / Constants.RegionSize; }
475 set { RegionWorldLocY = value * LegacyRegionSize; } 468 set { RegionWorldLocY = value * Constants.RegionSize; }
476 } 469 }
477 470
478 /// <summary> 471 /// <summary>
@@ -492,8 +485,8 @@ namespace OpenSim.Framework
492 RegionWorldLocX = 0; 485 RegionWorldLocX = 0;
493 RegionWorldLocY = 0; 486 RegionWorldLocY = 0;
494 RegionWorldLocZ = 0; 487 RegionWorldLocZ = 0;
495 RegionSizeX = LegacyRegionSize; 488 RegionSizeX = Constants.RegionSize;
496 RegionSizeY = LegacyRegionSize; 489 RegionSizeY = Constants.RegionSize;
497 RegionSizeZ = Constants.RegionHeight; 490 RegionSizeZ = Constants.RegionHeight;
498 } 491 }
499 492
@@ -628,11 +621,11 @@ namespace OpenSim.Framework
628 // Region size 621 // Region size
629 // Default to legacy region size if not specified. 622 // Default to legacy region size if not specified.
630 allKeys.Remove("SizeX"); 623 allKeys.Remove("SizeX");
631 string configSizeX = config.GetString("SizeX", LegacyRegionSize.ToString()); 624 string configSizeX = config.GetString("SizeX", Constants.RegionSize.ToString());
632 config.Set("SizeX", configSizeX); 625 config.Set("SizeX", configSizeX);
633 RegionSizeX = Convert.ToUInt32(configSizeX); 626 RegionSizeX = Convert.ToUInt32(configSizeX);
634 allKeys.Remove("SizeY"); 627 allKeys.Remove("SizeY");
635 string configSizeY = config.GetString("SizeY", LegacyRegionSize.ToString()); 628 string configSizeY = config.GetString("SizeY", Constants.RegionSize.ToString());
636 config.Set("SizeY", configSizeX); 629 config.Set("SizeY", configSizeX);
637 RegionSizeY = Convert.ToUInt32(configSizeY); 630 RegionSizeY = Convert.ToUInt32(configSizeY);
638 allKeys.Remove("SizeZ"); 631 allKeys.Remove("SizeZ");
@@ -772,7 +765,7 @@ namespace OpenSim.Framework
772 string location = String.Format("{0},{1}", LegacyRegionLocX, LegacyRegionLocY); 765 string location = String.Format("{0},{1}", LegacyRegionLocX, LegacyRegionLocY);
773 config.Set("Location", location); 766 config.Set("Location", location);
774 767
775 if (RegionSizeX != LegacyRegionSize || RegionSizeY != LegacyRegionSize) 768 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize)
776 { 769 {
777 config.Set("SizeX", RegionSizeX); 770 config.Set("SizeX", RegionSizeX);
778 config.Set("SizeY", RegionSizeY); 771 config.Set("SizeY", RegionSizeY);
@@ -941,9 +934,9 @@ namespace OpenSim.Framework
941 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 934 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
942 "Grid Location (Y Axis)", "1000", false); 935 "Grid Location (Y Axis)", "1000", false);
943 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 936 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
944 "Size of region in X dimension", LegacyRegionSize.ToString(), false); 937 "Size of region in X dimension", Constants.RegionSize.ToString(), false);
945 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 938 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
946 "Size of region in Y dimension", LegacyRegionSize.ToString(), false); 939 "Size of region in Y dimension", Constants.RegionSize.ToString(), false);
947 configMember.addConfigurationOption("sim_size_z", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 940 configMember.addConfigurationOption("sim_size_z", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
948 "Size of region in Z dimension", Constants.RegionHeight.ToString(), false); 941 "Size of region in Z dimension", Constants.RegionHeight.ToString(), false);
949 942