aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2015-03-28 07:50:04 -0700
committerRobert Adams2015-03-28 07:50:04 -0700
commit08c72a8dc1e54114559521a6c2952905ecf6f105 (patch)
treecdc1f379109500504516755fcd3d4e9c6c4e3218 /OpenSim
parentvarregion: refactor use of 'double heightmap[,]' into references to new class... (diff)
downloadopensim-SC_OLD-08c72a8dc1e54114559521a6c2952905ecf6f105.zip
opensim-SC_OLD-08c72a8dc1e54114559521a6c2952905ecf6f105.tar.gz
opensim-SC_OLD-08c72a8dc1e54114559521a6c2952905ecf6f105.tar.bz2
opensim-SC_OLD-08c72a8dc1e54114559521a6c2952905ecf6f105.tar.xz
varregion: remove use of Constants.RegionSize is various places.
More use of the Util routines for conversion of region handles into addresses.
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs6
-rw-r--r--OpenSim/Data/IRegionData.cs8
-rw-r--r--OpenSim/Framework/RegionInfo.cs1
-rw-r--r--OpenSim/Framework/UserProfileData.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs9
5 files changed, 21 insertions, 15 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 2120116..cb96a55 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -1155,7 +1155,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1155 // Set home position 1155 // Set home position
1156 1156
1157 GridRegion home = scene.GridService.GetRegionByPosition(scopeID, 1157 GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
1158 (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); 1158 (int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
1159 if (null == home) 1159 if (null == home)
1160 { 1160 {
1161 m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstName, lastName); 1161 m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstName, lastName);
@@ -1385,7 +1385,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1385 if ((null != regionXLocation) && (null != regionYLocation)) 1385 if ((null != regionXLocation) && (null != regionYLocation))
1386 { 1386 {
1387 GridRegion home = scene.GridService.GetRegionByPosition(scopeID, 1387 GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
1388 (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); 1388 (int)Util.RegionToWorldLoc((uint)regionXLocation), (int)Util.RegionToWorldLoc((uint)regionYLocation));
1389 if (null == home) { 1389 if (null == home) {
1390 m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName); 1390 m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName);
1391 } else { 1391 } else {
@@ -3116,7 +3116,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
3116 // Set home position 3116 // Set home position
3117 3117
3118 GridRegion home = scene.GridService.GetRegionByPosition(scopeID, 3118 GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
3119 (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); 3119 (int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
3120 if (null == home) { 3120 if (null == home) {
3121 m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]); 3121 m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]);
3122 } else { 3122 } else {
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 463c621..ca9b327 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -52,14 +52,14 @@ namespace OpenSim.Data
52 public int sizeY; 52 public int sizeY;
53 53
54 /// <summary> 54 /// <summary>
55 /// Return the x-coordinate of this region. 55 /// Return the x-coordinate of this region in region units.
56 /// </summary> 56 /// </summary>
57 public int coordX { get { return posX / (int)Constants.RegionSize; } } 57 public int coordX { get { return (int)Util.WorldToRegionLoc((uint)posX); } }
58 58
59 /// <summary> 59 /// <summary>
60 /// Return the y-coordinate of this region. 60 /// Return the y-coordinate of this region in region units.
61 /// </summary> 61 /// </summary>
62 public int coordY { get { return posY / (int)Constants.RegionSize; } } 62 public int coordY { get { return (int)Util.WorldToRegionLoc((uint)posY); } }
63 63
64 public Dictionary<string, object> Data; 64 public Dictionary<string, object> Data;
65 } 65 }
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 90188d2..019fffc 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -825,6 +825,7 @@ namespace OpenSim.Framework
825 825
826 if (DataStore != String.Empty) 826 if (DataStore != String.Empty)
827 config.Set("Datastore", DataStore); 827 config.Set("Datastore", DataStore);
828
828 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize) 829 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize)
829 { 830 {
830 config.Set("SizeX", RegionSizeX); 831 config.Set("SizeX", RegionSizeX);
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index 9bac739..f7069a5 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -161,14 +161,18 @@ namespace OpenSim.Framework
161 { 161 {
162 get 162 get
163 { 163 {
164 return Utils.UIntsToLong( 164 return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY));
165 m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); 165 // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize);
166 } 166 }
167 167
168 set 168 set
169 { 169 {
170 m_homeRegionX = (uint) (value >> 40); 170 uint regionWorldLocX, regionWorldLocY;
171 m_homeRegionY = (((uint) (value)) >> 8); 171 Util.RegionHandleToWorldLoc(value, out regionWorldLocX, out regionWorldLocY);
172 m_homeRegionX = Util.WorldToRegionLoc(regionWorldLocX);
173 m_homeRegionY = Util.WorldToRegionLoc(regionWorldLocY);
174 // m_homeRegionX = (uint) (value >> 40);
175 // m_homeRegionY = (((uint) (value)) >> 8);
172 } 176 }
173 } 177 }
174 178
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index ca6c3ca..51535a6 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Region.ClientStack.Linden
59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule 59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
60 { 60 {
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 private static string LogHeader = "[EVENT QUEUE GET MODULE]";
62 63
63 /// <value> 64 /// <value>
64 /// Debug level. 65 /// Debug level.
@@ -479,7 +480,7 @@ namespace OpenSim.Region.ClientStack.Linden
479 public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) 480 public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
480 { 481 {
481 m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>", 482 m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>",
482 "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); 483 LogHeader, handle, avatarID, regionSizeX, regionSizeY);
483 484
484 OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); 485 OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY);
485 Enqueue(item, avatarID); 486 Enqueue(item, avatarID);
@@ -489,7 +490,7 @@ namespace OpenSim.Region.ClientStack.Linden
489 ulong regionHandle, int regionSizeX, int regionSizeY) 490 ulong regionHandle, int regionSizeX, int regionSizeY)
490 { 491 {
491 m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>", 492 m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>",
492 "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); 493 LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY);
493 OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY); 494 OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY);
494 Enqueue(item, avatarID); 495 Enqueue(item, avatarID);
495 } 496 }
@@ -500,7 +501,7 @@ namespace OpenSim.Region.ClientStack.Linden
500 UUID avatarID, int regionSizeX, int regionSizeY) 501 UUID avatarID, int regionSizeX, int regionSizeY)
501 { 502 {
502 m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize={3},{4}>", 503 m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize={3},{4}>",
503 "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); 504 LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY);
504 505
505 OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint, 506 OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint,
506 locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY); 507 locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY);
@@ -512,7 +513,7 @@ namespace OpenSim.Region.ClientStack.Linden
512 string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) 513 string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY)
513 { 514 {
514 m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>", 515 m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>",
515 "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); 516 LogHeader, handle, avatarID, regionSizeX, regionSizeY);
516 517
517 OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint, 518 OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint,
518 capsURL, avatarID, sessionID, regionSizeX, regionSizeY); 519 capsURL, avatarID, sessionID, regionSizeX, regionSizeY);