diff options
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 33 |
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 | ||