aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IGridService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs47
1 files changed, 46 insertions, 1 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 3f4c958..4466222 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
@@ -97,6 +101,7 @@ namespace OpenSim.Services.Interfaces
97 List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax); 101 List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax);
98 102
99 List<GridRegion> GetDefaultRegions(UUID scopeID); 103 List<GridRegion> GetDefaultRegions(UUID scopeID);
104 List<GridRegion> GetDefaultHypergridRegions(UUID scopeID);
100 List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y); 105 List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y);
101 List<GridRegion> GetHyperlinks(UUID scopeID); 106 List<GridRegion> GetHyperlinks(UUID scopeID);
102 107
@@ -118,6 +123,9 @@ namespace OpenSim.Services.Interfaces
118 123
119 public class GridRegion 124 public class GridRegion
120 { 125 {
126 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
127 private static readonly string LogHeader = "[GRID REGION]";
128
121 /// <summary> 129 /// <summary>
122 /// The port by which http communication occurs with the region 130 /// The port by which http communication occurs with the region
123 /// </summary> 131 /// </summary>
@@ -137,7 +145,10 @@ namespace OpenSim.Services.Interfaces
137 if ( m_serverURI != string.Empty ) { 145 if ( m_serverURI != string.Empty ) {
138 return m_serverURI; 146 return m_serverURI;
139 } else { 147 } else {
140 return "http://" + m_externalHostName + ":" + m_httpPort + "/"; 148 if (m_httpPort == 0)
149 return "http://" + m_externalHostName + "/";
150 else
151 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
141 } 152 }
142 } 153 }
143 set { 154 set {
@@ -173,6 +184,7 @@ namespace OpenSim.Services.Interfaces
173 184
174 /// <summary> 185 /// <summary>
175 /// The location of this region in meters. 186 /// The location of this region in meters.
187 /// DANGER DANGER! Note that this name means something different in RegionInfo.
176 /// </summary> 188 /// </summary>
177 public int RegionLocX 189 public int RegionLocX
178 { 190 {
@@ -181,8 +193,12 @@ namespace OpenSim.Services.Interfaces
181 } 193 }
182 protected int m_regionLocX; 194 protected int m_regionLocX;
183 195
196 public int RegionSizeX { get; set; }
197 public int RegionSizeY { get; set; }
198
184 /// <summary> 199 /// <summary>
185 /// The location of this region in meters. 200 /// The location of this region in meters.
201 /// DANGER DANGER! Note that this name means something different in RegionInfo.
186 /// </summary> 202 /// </summary>
187 public int RegionLocY 203 public int RegionLocY
188 { 204 {
@@ -211,13 +227,18 @@ namespace OpenSim.Services.Interfaces
211 227
212 public GridRegion() 228 public GridRegion()
213 { 229 {
230 RegionSizeX = (int)Constants.RegionSize;
231 RegionSizeY = (int)Constants.RegionSize;
214 m_serverURI = string.Empty; 232 m_serverURI = string.Empty;
215 } 233 }
216 234
235 /*
217 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) 236 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
218 { 237 {
219 m_regionLocX = regionLocX; 238 m_regionLocX = regionLocX;
220 m_regionLocY = regionLocY; 239 m_regionLocY = regionLocY;
240 RegionSizeX = (int)Constants.RegionSize;
241 RegionSizeY = (int)Constants.RegionSize;
221 242
222 m_internalEndPoint = internalEndPoint; 243 m_internalEndPoint = internalEndPoint;
223 m_externalHostName = externalUri; 244 m_externalHostName = externalUri;
@@ -227,16 +248,21 @@ namespace OpenSim.Services.Interfaces
227 { 248 {
228 m_regionLocX = regionLocX; 249 m_regionLocX = regionLocX;
229 m_regionLocY = regionLocY; 250 m_regionLocY = regionLocY;
251 RegionSizeX = (int)Constants.RegionSize;
252 RegionSizeY = (int)Constants.RegionSize;
230 253
231 m_externalHostName = externalUri; 254 m_externalHostName = externalUri;
232 255
233 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); 256 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
234 } 257 }
258 */
235 259
236 public GridRegion(uint xcell, uint ycell) 260 public GridRegion(uint xcell, uint ycell)
237 { 261 {
238 m_regionLocX = (int)(xcell * Constants.RegionSize); 262 m_regionLocX = (int)(xcell * Constants.RegionSize);
239 m_regionLocY = (int)(ycell * Constants.RegionSize); 263 m_regionLocY = (int)(ycell * Constants.RegionSize);
264 RegionSizeX = (int)Constants.RegionSize;
265 RegionSizeY = (int)Constants.RegionSize;
240 } 266 }
241 267
242 public GridRegion(RegionInfo ConvertFrom) 268 public GridRegion(RegionInfo ConvertFrom)
@@ -244,6 +270,8 @@ namespace OpenSim.Services.Interfaces
244 m_regionName = ConvertFrom.RegionName; 270 m_regionName = ConvertFrom.RegionName;
245 m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); 271 m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize);
246 m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); 272 m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize);
273 RegionSizeX = (int)ConvertFrom.RegionSizeX;
274 RegionSizeY = (int)ConvertFrom.RegionSizeY;
247 m_internalEndPoint = ConvertFrom.InternalEndPoint; 275 m_internalEndPoint = ConvertFrom.InternalEndPoint;
248 m_externalHostName = ConvertFrom.ExternalHostName; 276 m_externalHostName = ConvertFrom.ExternalHostName;
249 m_httpPort = ConvertFrom.HttpPort; 277 m_httpPort = ConvertFrom.HttpPort;
@@ -262,6 +290,8 @@ namespace OpenSim.Services.Interfaces
262 m_regionName = ConvertFrom.RegionName; 290 m_regionName = ConvertFrom.RegionName;
263 m_regionLocX = ConvertFrom.RegionLocX; 291 m_regionLocX = ConvertFrom.RegionLocX;
264 m_regionLocY = ConvertFrom.RegionLocY; 292 m_regionLocY = ConvertFrom.RegionLocY;
293 RegionSizeX = ConvertFrom.RegionSizeX;
294 RegionSizeY = ConvertFrom.RegionSizeY;
265 m_internalEndPoint = ConvertFrom.InternalEndPoint; 295 m_internalEndPoint = ConvertFrom.InternalEndPoint;
266 m_externalHostName = ConvertFrom.ExternalHostName; 296 m_externalHostName = ConvertFrom.ExternalHostName;
267 m_httpPort = ConvertFrom.HttpPort; 297 m_httpPort = ConvertFrom.HttpPort;
@@ -373,6 +403,8 @@ namespace OpenSim.Services.Interfaces
373 kvp["uuid"] = RegionID.ToString(); 403 kvp["uuid"] = RegionID.ToString();
374 kvp["locX"] = RegionLocX.ToString(); 404 kvp["locX"] = RegionLocX.ToString();
375 kvp["locY"] = RegionLocY.ToString(); 405 kvp["locY"] = RegionLocY.ToString();
406 kvp["sizeX"] = RegionSizeX.ToString();
407 kvp["sizeY"] = RegionSizeY.ToString();
376 kvp["regionName"] = RegionName; 408 kvp["regionName"] = RegionName;
377 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); 409 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
378 kvp["serverHttpPort"] = HttpPort.ToString(); 410 kvp["serverHttpPort"] = HttpPort.ToString();
@@ -399,6 +431,16 @@ namespace OpenSim.Services.Interfaces
399 if (kvp.ContainsKey("locY")) 431 if (kvp.ContainsKey("locY"))
400 RegionLocY = Convert.ToInt32((string)kvp["locY"]); 432 RegionLocY = Convert.ToInt32((string)kvp["locY"]);
401 433
434 if (kvp.ContainsKey("sizeX"))
435 RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
436 else
437 RegionSizeX = (int)Constants.RegionSize;
438
439 if (kvp.ContainsKey("sizeY"))
440 RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
441 else
442 RegionSizeX = (int)Constants.RegionSize;
443
402 if (kvp.ContainsKey("regionName")) 444 if (kvp.ContainsKey("regionName"))
403 RegionName = (string)kvp["regionName"]; 445 RegionName = (string)kvp["regionName"];
404 446
@@ -452,6 +494,9 @@ namespace OpenSim.Services.Interfaces
452 494
453 if (kvp.ContainsKey("Token")) 495 if (kvp.ContainsKey("Token"))
454 Token = kvp["Token"].ToString(); 496 Token = kvp["Token"].ToString();
497
498 // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
499 // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
455 } 500 }
456 } 501 }
457} 502}