diff options
Diffstat (limited to 'OpenSim/Services/Interfaces/IGridService.cs')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index a3d237f..19ea0fe 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -29,9 +29,13 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Net.Sockets; | 31 | using System.Net.Sockets; |
32 | using System.Reflection; | ||
33 | |||
32 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 35 | using OpenMetaverse; |
34 | 36 | ||
37 | using log4net; | ||
38 | |||
35 | namespace OpenSim.Services.Interfaces | 39 | namespace 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 { |
@@ -179,6 +190,7 @@ namespace OpenSim.Services.Interfaces | |||
179 | 190 | ||
180 | /// <summary> | 191 | /// <summary> |
181 | /// The location of this region in meters. | 192 | /// The location of this region in meters. |
193 | /// DANGER DANGER! Note that this name means something different in RegionInfo. | ||
182 | /// </summary> | 194 | /// </summary> |
183 | public int RegionLocX | 195 | public int RegionLocX |
184 | { | 196 | { |
@@ -187,8 +199,12 @@ namespace OpenSim.Services.Interfaces | |||
187 | } | 199 | } |
188 | protected int m_regionLocX; | 200 | protected int m_regionLocX; |
189 | 201 | ||
202 | public int RegionSizeX { get; set; } | ||
203 | public int RegionSizeY { get; set; } | ||
204 | |||
190 | /// <summary> | 205 | /// <summary> |
191 | /// The location of this region in meters. | 206 | /// The location of this region in meters. |
207 | /// DANGER DANGER! Note that this name means something different in RegionInfo. | ||
192 | /// </summary> | 208 | /// </summary> |
193 | public int RegionLocY | 209 | public int RegionLocY |
194 | { | 210 | { |
@@ -217,13 +233,18 @@ namespace OpenSim.Services.Interfaces | |||
217 | 233 | ||
218 | public GridRegion() | 234 | public GridRegion() |
219 | { | 235 | { |
236 | RegionSizeX = (int)Constants.RegionSize; | ||
237 | RegionSizeY = (int)Constants.RegionSize; | ||
220 | m_serverURI = string.Empty; | 238 | m_serverURI = string.Empty; |
221 | } | 239 | } |
222 | 240 | ||
241 | /* | ||
223 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) | 242 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) |
224 | { | 243 | { |
225 | m_regionLocX = regionLocX; | 244 | m_regionLocX = regionLocX; |
226 | m_regionLocY = regionLocY; | 245 | m_regionLocY = regionLocY; |
246 | RegionSizeX = (int)Constants.RegionSize; | ||
247 | RegionSizeY = (int)Constants.RegionSize; | ||
227 | 248 | ||
228 | m_internalEndPoint = internalEndPoint; | 249 | m_internalEndPoint = internalEndPoint; |
229 | m_externalHostName = externalUri; | 250 | m_externalHostName = externalUri; |
@@ -233,16 +254,21 @@ namespace OpenSim.Services.Interfaces | |||
233 | { | 254 | { |
234 | m_regionLocX = regionLocX; | 255 | m_regionLocX = regionLocX; |
235 | m_regionLocY = regionLocY; | 256 | m_regionLocY = regionLocY; |
257 | RegionSizeX = (int)Constants.RegionSize; | ||
258 | RegionSizeY = (int)Constants.RegionSize; | ||
236 | 259 | ||
237 | m_externalHostName = externalUri; | 260 | m_externalHostName = externalUri; |
238 | 261 | ||
239 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); | 262 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); |
240 | } | 263 | } |
264 | */ | ||
241 | 265 | ||
242 | public GridRegion(uint xcell, uint ycell) | 266 | public GridRegion(uint xcell, uint ycell) |
243 | { | 267 | { |
244 | m_regionLocX = (int)(xcell * Constants.RegionSize); | 268 | m_regionLocX = (int)(xcell * Constants.RegionSize); |
245 | m_regionLocY = (int)(ycell * Constants.RegionSize); | 269 | m_regionLocY = (int)(ycell * Constants.RegionSize); |
270 | RegionSizeX = (int)Constants.RegionSize; | ||
271 | RegionSizeY = (int)Constants.RegionSize; | ||
246 | } | 272 | } |
247 | 273 | ||
248 | public GridRegion(RegionInfo ConvertFrom) | 274 | public GridRegion(RegionInfo ConvertFrom) |
@@ -250,6 +276,8 @@ namespace OpenSim.Services.Interfaces | |||
250 | m_regionName = ConvertFrom.RegionName; | 276 | m_regionName = ConvertFrom.RegionName; |
251 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); | 277 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); |
252 | m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); | 278 | m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); |
279 | RegionSizeX = (int)ConvertFrom.RegionSizeX; | ||
280 | RegionSizeY = (int)ConvertFrom.RegionSizeY; | ||
253 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 281 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
254 | m_externalHostName = ConvertFrom.ExternalHostName; | 282 | m_externalHostName = ConvertFrom.ExternalHostName; |
255 | m_httpPort = ConvertFrom.HttpPort; | 283 | m_httpPort = ConvertFrom.HttpPort; |
@@ -268,6 +296,8 @@ namespace OpenSim.Services.Interfaces | |||
268 | m_regionName = ConvertFrom.RegionName; | 296 | m_regionName = ConvertFrom.RegionName; |
269 | m_regionLocX = ConvertFrom.RegionLocX; | 297 | m_regionLocX = ConvertFrom.RegionLocX; |
270 | m_regionLocY = ConvertFrom.RegionLocY; | 298 | m_regionLocY = ConvertFrom.RegionLocY; |
299 | RegionSizeX = ConvertFrom.RegionSizeX; | ||
300 | RegionSizeY = ConvertFrom.RegionSizeY; | ||
271 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 301 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
272 | m_externalHostName = ConvertFrom.ExternalHostName; | 302 | m_externalHostName = ConvertFrom.ExternalHostName; |
273 | m_httpPort = ConvertFrom.HttpPort; | 303 | m_httpPort = ConvertFrom.HttpPort; |
@@ -379,6 +409,8 @@ namespace OpenSim.Services.Interfaces | |||
379 | kvp["uuid"] = RegionID.ToString(); | 409 | kvp["uuid"] = RegionID.ToString(); |
380 | kvp["locX"] = RegionLocX.ToString(); | 410 | kvp["locX"] = RegionLocX.ToString(); |
381 | kvp["locY"] = RegionLocY.ToString(); | 411 | kvp["locY"] = RegionLocY.ToString(); |
412 | kvp["sizeX"] = RegionSizeX.ToString(); | ||
413 | kvp["sizeY"] = RegionSizeY.ToString(); | ||
382 | kvp["regionName"] = RegionName; | 414 | kvp["regionName"] = RegionName; |
383 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); | 415 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); |
384 | kvp["serverHttpPort"] = HttpPort.ToString(); | 416 | kvp["serverHttpPort"] = HttpPort.ToString(); |
@@ -405,6 +437,16 @@ namespace OpenSim.Services.Interfaces | |||
405 | if (kvp.ContainsKey("locY")) | 437 | if (kvp.ContainsKey("locY")) |
406 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | 438 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); |
407 | 439 | ||
440 | if (kvp.ContainsKey("sizeX")) | ||
441 | RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]); | ||
442 | else | ||
443 | RegionSizeX = (int)Constants.RegionSize; | ||
444 | |||
445 | if (kvp.ContainsKey("sizeY")) | ||
446 | RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); | ||
447 | else | ||
448 | RegionSizeY = (int)Constants.RegionSize; | ||
449 | |||
408 | if (kvp.ContainsKey("regionName")) | 450 | if (kvp.ContainsKey("regionName")) |
409 | RegionName = (string)kvp["regionName"]; | 451 | RegionName = (string)kvp["regionName"]; |
410 | 452 | ||
@@ -458,6 +500,9 @@ namespace OpenSim.Services.Interfaces | |||
458 | 500 | ||
459 | if (kvp.ContainsKey("Token")) | 501 | if (kvp.ContainsKey("Token")) |
460 | Token = kvp["Token"].ToString(); | 502 | Token = kvp["Token"].ToString(); |
503 | |||
504 | // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>", | ||
505 | // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY); | ||
461 | } | 506 | } |
462 | } | 507 | } |
463 | } | 508 | } |