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.cs37
1 files changed, 30 insertions, 7 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 88ac5b3..d4708b7 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -168,15 +168,16 @@ namespace OpenSim.Services.Interfaces
168 /// <summary> 168 /// <summary>
169 /// The co-ordinate of this region. 169 /// The co-ordinate of this region.
170 /// </summary> 170 /// </summary>
171 public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } 171 public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } }
172 172
173 /// <summary> 173 /// <summary>
174 /// The co-ordinate of this region 174 /// The co-ordinate of this region
175 /// </summary> 175 /// </summary>
176 public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } 176 public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } }
177 177
178 /// <summary> 178 /// <summary>
179 /// The location of this region in meters. 179 /// The location of this region in meters.
180 /// DANGER DANGER! Note that this name means something different in RegionInfo.
180 /// </summary> 181 /// </summary>
181 public int RegionLocX 182 public int RegionLocX
182 { 183 {
@@ -185,8 +186,12 @@ namespace OpenSim.Services.Interfaces
185 } 186 }
186 protected int m_regionLocX; 187 protected int m_regionLocX;
187 188
189 public int RegionSizeX { get; set; }
190 public int RegionSizeY { get; set; }
191
188 /// <summary> 192 /// <summary>
189 /// The location of this region in meters. 193 /// The location of this region in meters.
194 /// DANGER DANGER! Note that this name means something different in RegionInfo.
190 /// </summary> 195 /// </summary>
191 public int RegionLocY 196 public int RegionLocY
192 { 197 {
@@ -222,6 +227,8 @@ namespace OpenSim.Services.Interfaces
222 { 227 {
223 m_regionLocX = regionLocX; 228 m_regionLocX = regionLocX;
224 m_regionLocY = regionLocY; 229 m_regionLocY = regionLocY;
230 RegionSizeX = (int)Constants.RegionSize;
231 RegionSizeY = (int)Constants.RegionSize;
225 232
226 m_internalEndPoint = internalEndPoint; 233 m_internalEndPoint = internalEndPoint;
227 m_externalHostName = externalUri; 234 m_externalHostName = externalUri;
@@ -231,6 +238,8 @@ namespace OpenSim.Services.Interfaces
231 { 238 {
232 m_regionLocX = regionLocX; 239 m_regionLocX = regionLocX;
233 m_regionLocY = regionLocY; 240 m_regionLocY = regionLocY;
241 RegionSizeX = (int)Constants.RegionSize;
242 RegionSizeY = (int)Constants.RegionSize;
234 243
235 m_externalHostName = externalUri; 244 m_externalHostName = externalUri;
236 245
@@ -239,15 +248,19 @@ namespace OpenSim.Services.Interfaces
239 248
240 public GridRegion(uint xcell, uint ycell) 249 public GridRegion(uint xcell, uint ycell)
241 { 250 {
242 m_regionLocX = (int)(xcell * Constants.RegionSize); 251 m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
243 m_regionLocY = (int)(ycell * Constants.RegionSize); 252 m_regionLocY = (int)Util.RegionToWorldLoc(ycell);
253 RegionSizeX = (int)Constants.RegionSize;
254 RegionSizeY = (int)Constants.RegionSize;
244 } 255 }
245 256
246 public GridRegion(RegionInfo ConvertFrom) 257 public GridRegion(RegionInfo ConvertFrom)
247 { 258 {
248 m_regionName = ConvertFrom.RegionName; 259 m_regionName = ConvertFrom.RegionName;
249 m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); 260 m_regionLocX = (int)(ConvertFrom.WorldLocX);
250 m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); 261 m_regionLocY = (int)(ConvertFrom.WorldLocY);
262 RegionSizeX = (int)ConvertFrom.RegionSizeX;
263 RegionSizeY = (int)ConvertFrom.RegionSizeY;
251 m_internalEndPoint = ConvertFrom.InternalEndPoint; 264 m_internalEndPoint = ConvertFrom.InternalEndPoint;
252 m_externalHostName = ConvertFrom.ExternalHostName; 265 m_externalHostName = ConvertFrom.ExternalHostName;
253 m_httpPort = ConvertFrom.HttpPort; 266 m_httpPort = ConvertFrom.HttpPort;
@@ -266,6 +279,8 @@ namespace OpenSim.Services.Interfaces
266 m_regionName = ConvertFrom.RegionName; 279 m_regionName = ConvertFrom.RegionName;
267 m_regionLocX = ConvertFrom.RegionLocX; 280 m_regionLocX = ConvertFrom.RegionLocX;
268 m_regionLocY = ConvertFrom.RegionLocY; 281 m_regionLocY = ConvertFrom.RegionLocY;
282 RegionSizeX = ConvertFrom.RegionSizeX;
283 RegionSizeY = ConvertFrom.RegionSizeY;
269 m_internalEndPoint = ConvertFrom.InternalEndPoint; 284 m_internalEndPoint = ConvertFrom.InternalEndPoint;
270 m_externalHostName = ConvertFrom.ExternalHostName; 285 m_externalHostName = ConvertFrom.ExternalHostName;
271 m_httpPort = ConvertFrom.HttpPort; 286 m_httpPort = ConvertFrom.HttpPort;
@@ -373,6 +388,8 @@ namespace OpenSim.Services.Interfaces
373 kvp["uuid"] = RegionID.ToString(); 388 kvp["uuid"] = RegionID.ToString();
374 kvp["locX"] = RegionLocX.ToString(); 389 kvp["locX"] = RegionLocX.ToString();
375 kvp["locY"] = RegionLocY.ToString(); 390 kvp["locY"] = RegionLocY.ToString();
391 kvp["sizeX"] = RegionSizeX.ToString();
392 kvp["sizeY"] = RegionSizeY.ToString();
376 kvp["regionName"] = RegionName; 393 kvp["regionName"] = RegionName;
377 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); 394 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
378 kvp["serverHttpPort"] = HttpPort.ToString(); 395 kvp["serverHttpPort"] = HttpPort.ToString();
@@ -399,6 +416,12 @@ namespace OpenSim.Services.Interfaces
399 if (kvp.ContainsKey("locY")) 416 if (kvp.ContainsKey("locY"))
400 RegionLocY = Convert.ToInt32((string)kvp["locY"]); 417 RegionLocY = Convert.ToInt32((string)kvp["locY"]);
401 418
419 if (kvp.ContainsKey("sizeX"))
420 RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
421
422 if (kvp.ContainsKey("sizeY"))
423 RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
424
402 if (kvp.ContainsKey("regionName")) 425 if (kvp.ContainsKey("regionName"))
403 RegionName = (string)kvp["regionName"]; 426 RegionName = (string)kvp["regionName"];
404 427