aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionInfo.cs
diff options
context:
space:
mode:
authorRobert Adams2013-12-14 07:53:01 -0800
committerRobert Adams2013-12-14 07:53:01 -0800
commit13a9a4b653c5470e6a450bfd9b2049273a4ef7b2 (patch)
tree1168d93ebfff04893ec05a32c6bad456e1d00d32 /OpenSim/Framework/RegionInfo.cs
parentMerge branch 'master' into varregion (diff)
downloadopensim-SC_OLD-13a9a4b653c5470e6a450bfd9b2049273a4ef7b2.zip
opensim-SC_OLD-13a9a4b653c5470e6a450bfd9b2049273a4ef7b2.tar.gz
opensim-SC_OLD-13a9a4b653c5470e6a450bfd9b2049273a4ef7b2.tar.bz2
opensim-SC_OLD-13a9a4b653c5470e6a450bfd9b2049273a4ef7b2.tar.xz
varregion: rename 'LegacyRegionLocX' back to 'RegionLocX' and same for Y and Z.
Rename 'RegionWorldLocX' to 'WorldLocX' and same for Y and Z. This keeps the downward compatibility and follows the scheme of 'region' and 'world' location naming that is happening in the Util module.
Diffstat (limited to 'OpenSim/Framework/RegionInfo.cs')
-rw-r--r--OpenSim/Framework/RegionInfo.cs68
1 files changed, 22 insertions, 46 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 63b3d89..35278f8 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -144,9 +144,9 @@ namespace OpenSim.Framework
144 public UUID ScopeID = UUID.Zero; 144 public UUID ScopeID = UUID.Zero;
145 private UUID m_maptileStaticUUID = UUID.Zero; 145 private UUID m_maptileStaticUUID = UUID.Zero;
146 146
147 public uint RegionWorldLocX = 0; 147 public uint WorldLocX = 0;
148 public uint RegionWorldLocY = 0; 148 public uint WorldLocY = 0;
149 public uint RegionWorldLocZ = 0; 149 public uint WorldLocZ = 0;
150 public uint RegionSizeX = Constants.RegionSize; 150 public uint RegionSizeX = Constants.RegionSize;
151 public uint RegionSizeY = Constants.RegionSize; 151 public uint RegionSizeY = Constants.RegionSize;
152 public uint RegionSizeZ = Constants.RegionHeight; 152 public uint RegionSizeZ = Constants.RegionHeight;
@@ -452,52 +452,28 @@ namespace OpenSim.Framework
452 /// Coordinate is scaled as world coordinates divided by the legacy region size 452 /// Coordinate is scaled as world coordinates divided by the legacy region size
453 /// and is thus is the number of legacy regions. 453 /// and is thus is the number of legacy regions.
454 /// </summary> 454 /// </summary>
455 public uint LegacyRegionLocX
456 {
457 get { return RegionWorldLocX / Constants.RegionSize; }
458 set { RegionWorldLocX = value * Constants.RegionSize; }
459 }
460
461 /// <summary>
462 /// The y co-ordinate of this region in map tiles (e.g. 1000).
463 /// Coordinate is scaled as world coordinates divided by the legacy region size
464 /// and is thus is the number of legacy regions.
465 /// </summary>
466 public uint LegacyRegionLocY
467 {
468 get { return RegionWorldLocY / Constants.RegionSize; }
469 set { RegionWorldLocY = value * Constants.RegionSize; }
470 }
471
472 /// <summary>
473 /// The x co-ordinate of this region in map tiles (e.g. 1000).
474 /// Coordinate is scaled as world coordinates divided by the legacy region size
475 /// and is thus is the number of legacy regions.
476 /// DO NOT USE FOR NEW CODE! This entrypoint exists for downward compatability with external modules.
477 /// </summary>
478 public uint RegionLocX 455 public uint RegionLocX
479 { 456 {
480 get { return LegacyRegionLocX; } 457 get { return WorldLocX / Constants.RegionSize; }
481 set { LegacyRegionLocX = value; } 458 set { WorldLocX = value * Constants.RegionSize; }
482 } 459 }
483 460
484 /// <summary> 461 /// <summary>
485 /// The y co-ordinate of this region in map tiles (e.g. 1000). 462 /// The y co-ordinate of this region in map tiles (e.g. 1000).
486 /// Coordinate is scaled as world coordinates divided by the legacy region size 463 /// Coordinate is scaled as world coordinates divided by the legacy region size
487 /// and is thus is the number of legacy regions. 464 /// and is thus is the number of legacy regions.
488 /// DO NOT USE FOR NEW CODE! This entrypoint exists for downward compatability with external modules.
489 /// </summary> 465 /// </summary>
490 public uint RegionLocY 466 public uint RegionLocY
491 { 467 {
492 get { return LegacyRegionLocY; } 468 get { return WorldLocY / Constants.RegionSize; }
493 set { LegacyRegionLocY = value; } 469 set { WorldLocY = value * Constants.RegionSize; }
494 } 470 }
495 471
496 public void SetDefaultRegionSize() 472 public void SetDefaultRegionSize()
497 { 473 {
498 RegionWorldLocX = 0; 474 WorldLocX = 0;
499 RegionWorldLocY = 0; 475 WorldLocY = 0;
500 RegionWorldLocZ = 0; 476 WorldLocZ = 0;
501 RegionSizeX = Constants.RegionSize; 477 RegionSizeX = Constants.RegionSize;
502 RegionSizeY = Constants.RegionSize; 478 RegionSizeY = Constants.RegionSize;
503 RegionSizeZ = Constants.RegionHeight; 479 RegionSizeZ = Constants.RegionHeight;
@@ -508,7 +484,7 @@ namespace OpenSim.Framework
508 // compute the region coordinates from it. 484 // compute the region coordinates from it.
509 public ulong RegionHandle 485 public ulong RegionHandle
510 { 486 {
511 get { return Util.UIntsToLong(RegionWorldLocX, RegionWorldLocY); } 487 get { return Util.UIntsToLong(WorldLocX, WorldLocY); }
512 } 488 }
513 489
514 public void SetEndPoint(string ipaddr, int port) 490 public void SetEndPoint(string ipaddr, int port)
@@ -615,8 +591,8 @@ namespace OpenSim.Framework
615 591
616 string[] locationElements = location.Split(new char[] {','}); 592 string[] locationElements = location.Split(new char[] {','});
617 593
618 LegacyRegionLocX = Convert.ToUInt32(locationElements[0]); 594 RegionLocX = Convert.ToUInt32(locationElements[0]);
619 LegacyRegionLocY = Convert.ToUInt32(locationElements[1]); 595 RegionLocY = Convert.ToUInt32(locationElements[1]);
620 596
621 // Region size 597 // Region size
622 // Default to legacy region size if not specified. 598 // Default to legacy region size if not specified.
@@ -815,7 +791,7 @@ namespace OpenSim.Framework
815 791
816 config.Set("RegionUUID", RegionID.ToString()); 792 config.Set("RegionUUID", RegionID.ToString());
817 793
818 string location = String.Format("{0},{1}", LegacyRegionLocX, LegacyRegionLocY); 794 string location = String.Format("{0},{1}", RegionLocX, RegionLocY);
819 config.Set("Location", location); 795 config.Set("Location", location);
820 796
821 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize) 797 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize)
@@ -909,9 +885,9 @@ namespace OpenSim.Framework
909 "Region Name", RegionName, true); 885 "Region Name", RegionName, true);
910 886
911 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 887 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
912 "Grid Location (X Axis)", LegacyRegionLocX.ToString(), true); 888 "Grid Location (X Axis)", RegionLocX.ToString(), true);
913 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 889 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
914 "Grid Location (Y Axis)", LegacyRegionLocY.ToString(), true); 890 "Grid Location (Y Axis)", RegionLocY.ToString(), true);
915 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 891 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
916 "Size of region in X dimension", RegionSizeX.ToString(), true); 892 "Size of region in X dimension", RegionSizeX.ToString(), true);
917 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 893 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
@@ -1050,10 +1026,10 @@ namespace OpenSim.Framework
1050 RegionName = (string) configuration_result; 1026 RegionName = (string) configuration_result;
1051 break; 1027 break;
1052 case "sim_location_x": 1028 case "sim_location_x":
1053 LegacyRegionLocX = (uint) configuration_result; 1029 RegionLocX = (uint) configuration_result;
1054 break; 1030 break;
1055 case "sim_location_y": 1031 case "sim_location_y":
1056 LegacyRegionLocY = (uint) configuration_result; 1032 RegionLocY = (uint) configuration_result;
1057 break; 1033 break;
1058 case "sim_size_x": 1034 case "sim_size_x":
1059 RegionSizeX = (uint) configuration_result; 1035 RegionSizeX = (uint) configuration_result;
@@ -1144,8 +1120,8 @@ namespace OpenSim.Framework
1144 args["http_port"] = OSD.FromString(HttpPort.ToString()); 1120 args["http_port"] = OSD.FromString(HttpPort.ToString());
1145 args["server_uri"] = OSD.FromString(ServerURI); 1121 args["server_uri"] = OSD.FromString(ServerURI);
1146 1122
1147 args["region_xloc"] = OSD.FromString(LegacyRegionLocX.ToString()); 1123 args["region_xloc"] = OSD.FromString(RegionLocX.ToString());
1148 args["region_yloc"] = OSD.FromString(LegacyRegionLocY.ToString()); 1124 args["region_yloc"] = OSD.FromString(RegionLocY.ToString());
1149 args["region_size_x"] = OSD.FromString(RegionSizeX.ToString()); 1125 args["region_size_x"] = OSD.FromString(RegionSizeX.ToString());
1150 args["region_size_y"] = OSD.FromString(RegionSizeY.ToString()); 1126 args["region_size_y"] = OSD.FromString(RegionSizeY.ToString());
1151 args["region_size_z"] = OSD.FromString(RegionSizeZ.ToString()); 1127 args["region_size_z"] = OSD.FromString(RegionSizeZ.ToString());
@@ -1180,13 +1156,13 @@ namespace OpenSim.Framework
1180 { 1156 {
1181 uint locx; 1157 uint locx;
1182 UInt32.TryParse(args["region_xloc"].AsString(), out locx); 1158 UInt32.TryParse(args["region_xloc"].AsString(), out locx);
1183 LegacyRegionLocX = locx; 1159 RegionLocX = locx;
1184 } 1160 }
1185 if (args["region_yloc"] != null) 1161 if (args["region_yloc"] != null)
1186 { 1162 {
1187 uint locy; 1163 uint locy;
1188 UInt32.TryParse(args["region_yloc"].AsString(), out locy); 1164 UInt32.TryParse(args["region_yloc"].AsString(), out locy);
1189 LegacyRegionLocY = locy; 1165 RegionLocY = locy;
1190 } 1166 }
1191 if (args.ContainsKey("region_size_x")) 1167 if (args.ContainsKey("region_size_x"))
1192 RegionSizeX = (uint)args["region_size_x"].AsInteger(); 1168 RegionSizeX = (uint)args["region_size_x"].AsInteger();