aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IGridService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Interfaces/IGridService.cs')
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs26
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 59d6167..502630d 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -29,9 +29,13 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Net.Sockets; 31using System.Net.Sockets;
32using System.Reflection;
33
32using OpenSim.Framework; 34using OpenSim.Framework;
33using OpenMetaverse; 35using OpenMetaverse;
34 36
37using log4net;
38
35namespace OpenSim.Services.Interfaces 39namespace OpenSim.Services.Interfaces
36{ 40{
37 public interface IGridService 41 public interface IGridService
@@ -119,6 +123,9 @@ namespace OpenSim.Services.Interfaces
119 123
120 public class GridRegion 124 public class GridRegion
121 { 125 {
126 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
127 private static readonly string LogHeader = "[GRID REGION]";
128
122 /// <summary> 129 /// <summary>
123 /// The port by which http communication occurs with the region 130 /// The port by which http communication occurs with the region
124 /// </summary> 131 /// </summary>
@@ -168,12 +175,12 @@ namespace OpenSim.Services.Interfaces
168 /// <summary> 175 /// <summary>
169 /// The co-ordinate of this region. 176 /// The co-ordinate of this region.
170 /// </summary> 177 /// </summary>
171 public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } 178 public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } }
172 179
173 /// <summary> 180 /// <summary>
174 /// The co-ordinate of this region 181 /// The co-ordinate of this region
175 /// </summary> 182 /// </summary>
176 public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } 183 public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } }
177 184
178 /// <summary> 185 /// <summary>
179 /// The location of this region in meters. 186 /// The location of this region in meters.
@@ -252,8 +259,8 @@ namespace OpenSim.Services.Interfaces
252 259
253 public GridRegion(uint xcell, uint ycell) 260 public GridRegion(uint xcell, uint ycell)
254 { 261 {
255 m_regionLocX = (int)(xcell * Constants.RegionSize); 262 m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
256 m_regionLocY = (int)(ycell * Constants.RegionSize); 263 m_regionLocY = (int)Util.RegionToWorldLoc(ycell);
257 RegionSizeX = (int)Constants.RegionSize; 264 RegionSizeX = (int)Constants.RegionSize;
258 RegionSizeY = (int)Constants.RegionSize; 265 RegionSizeY = (int)Constants.RegionSize;
259 } 266 }
@@ -261,8 +268,8 @@ namespace OpenSim.Services.Interfaces
261 public GridRegion(RegionInfo ConvertFrom) 268 public GridRegion(RegionInfo ConvertFrom)
262 { 269 {
263 m_regionName = ConvertFrom.RegionName; 270 m_regionName = ConvertFrom.RegionName;
264 m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); 271 m_regionLocX = (int)(ConvertFrom.WorldLocX);
265 m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); 272 m_regionLocY = (int)(ConvertFrom.WorldLocY);
266 RegionSizeX = (int)ConvertFrom.RegionSizeX; 273 RegionSizeX = (int)ConvertFrom.RegionSizeX;
267 RegionSizeY = (int)ConvertFrom.RegionSizeY; 274 RegionSizeY = (int)ConvertFrom.RegionSizeY;
268 m_internalEndPoint = ConvertFrom.InternalEndPoint; 275 m_internalEndPoint = ConvertFrom.InternalEndPoint;
@@ -422,9 +429,13 @@ namespace OpenSim.Services.Interfaces
422 429
423 if (kvp.ContainsKey("sizeX")) 430 if (kvp.ContainsKey("sizeX"))
424 RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]); 431 RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
432 else
433 RegionSizeX = (int)Constants.RegionSize;
425 434
426 if (kvp.ContainsKey("sizeY")) 435 if (kvp.ContainsKey("sizeY"))
427 RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); 436 RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
437 else
438 RegionSizeX = (int)Constants.RegionSize;
428 439
429 if (kvp.ContainsKey("regionName")) 440 if (kvp.ContainsKey("regionName"))
430 RegionName = (string)kvp["regionName"]; 441 RegionName = (string)kvp["regionName"];
@@ -473,6 +484,9 @@ namespace OpenSim.Services.Interfaces
473 484
474 if (kvp.ContainsKey("Token")) 485 if (kvp.ContainsKey("Token"))
475 Token = kvp["Token"].ToString(); 486 Token = kvp["Token"].ToString();
487
488 m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
489 LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
476 } 490 }
477 } 491 }
478} 492}