diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index e3c70d3..4466222 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 |
@@ -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> |
@@ -177,6 +184,7 @@ namespace OpenSim.Services.Interfaces | |||
177 | 184 | ||
178 | /// <summary> | 185 | /// <summary> |
179 | /// 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. | ||
180 | /// </summary> | 188 | /// </summary> |
181 | public int RegionLocX | 189 | public int RegionLocX |
182 | { | 190 | { |
@@ -185,8 +193,12 @@ namespace OpenSim.Services.Interfaces | |||
185 | } | 193 | } |
186 | protected int m_regionLocX; | 194 | protected int m_regionLocX; |
187 | 195 | ||
196 | public int RegionSizeX { get; set; } | ||
197 | public int RegionSizeY { get; set; } | ||
198 | |||
188 | /// <summary> | 199 | /// <summary> |
189 | /// 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. | ||
190 | /// </summary> | 202 | /// </summary> |
191 | public int RegionLocY | 203 | public int RegionLocY |
192 | { | 204 | { |
@@ -215,13 +227,18 @@ namespace OpenSim.Services.Interfaces | |||
215 | 227 | ||
216 | public GridRegion() | 228 | public GridRegion() |
217 | { | 229 | { |
230 | RegionSizeX = (int)Constants.RegionSize; | ||
231 | RegionSizeY = (int)Constants.RegionSize; | ||
218 | m_serverURI = string.Empty; | 232 | m_serverURI = string.Empty; |
219 | } | 233 | } |
220 | 234 | ||
235 | /* | ||
221 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) | 236 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) |
222 | { | 237 | { |
223 | m_regionLocX = regionLocX; | 238 | m_regionLocX = regionLocX; |
224 | m_regionLocY = regionLocY; | 239 | m_regionLocY = regionLocY; |
240 | RegionSizeX = (int)Constants.RegionSize; | ||
241 | RegionSizeY = (int)Constants.RegionSize; | ||
225 | 242 | ||
226 | m_internalEndPoint = internalEndPoint; | 243 | m_internalEndPoint = internalEndPoint; |
227 | m_externalHostName = externalUri; | 244 | m_externalHostName = externalUri; |
@@ -231,16 +248,21 @@ namespace OpenSim.Services.Interfaces | |||
231 | { | 248 | { |
232 | m_regionLocX = regionLocX; | 249 | m_regionLocX = regionLocX; |
233 | m_regionLocY = regionLocY; | 250 | m_regionLocY = regionLocY; |
251 | RegionSizeX = (int)Constants.RegionSize; | ||
252 | RegionSizeY = (int)Constants.RegionSize; | ||
234 | 253 | ||
235 | m_externalHostName = externalUri; | 254 | m_externalHostName = externalUri; |
236 | 255 | ||
237 | 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); |
238 | } | 257 | } |
258 | */ | ||
239 | 259 | ||
240 | public GridRegion(uint xcell, uint ycell) | 260 | public GridRegion(uint xcell, uint ycell) |
241 | { | 261 | { |
242 | m_regionLocX = (int)(xcell * Constants.RegionSize); | 262 | m_regionLocX = (int)(xcell * Constants.RegionSize); |
243 | m_regionLocY = (int)(ycell * Constants.RegionSize); | 263 | m_regionLocY = (int)(ycell * Constants.RegionSize); |
264 | RegionSizeX = (int)Constants.RegionSize; | ||
265 | RegionSizeY = (int)Constants.RegionSize; | ||
244 | } | 266 | } |
245 | 267 | ||
246 | public GridRegion(RegionInfo ConvertFrom) | 268 | public GridRegion(RegionInfo ConvertFrom) |
@@ -248,6 +270,8 @@ namespace OpenSim.Services.Interfaces | |||
248 | m_regionName = ConvertFrom.RegionName; | 270 | m_regionName = ConvertFrom.RegionName; |
249 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); | 271 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); |
250 | 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; | ||
251 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 275 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
252 | m_externalHostName = ConvertFrom.ExternalHostName; | 276 | m_externalHostName = ConvertFrom.ExternalHostName; |
253 | m_httpPort = ConvertFrom.HttpPort; | 277 | m_httpPort = ConvertFrom.HttpPort; |
@@ -266,6 +290,8 @@ namespace OpenSim.Services.Interfaces | |||
266 | m_regionName = ConvertFrom.RegionName; | 290 | m_regionName = ConvertFrom.RegionName; |
267 | m_regionLocX = ConvertFrom.RegionLocX; | 291 | m_regionLocX = ConvertFrom.RegionLocX; |
268 | m_regionLocY = ConvertFrom.RegionLocY; | 292 | m_regionLocY = ConvertFrom.RegionLocY; |
293 | RegionSizeX = ConvertFrom.RegionSizeX; | ||
294 | RegionSizeY = ConvertFrom.RegionSizeY; | ||
269 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 295 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
270 | m_externalHostName = ConvertFrom.ExternalHostName; | 296 | m_externalHostName = ConvertFrom.ExternalHostName; |
271 | m_httpPort = ConvertFrom.HttpPort; | 297 | m_httpPort = ConvertFrom.HttpPort; |
@@ -377,6 +403,8 @@ namespace OpenSim.Services.Interfaces | |||
377 | kvp["uuid"] = RegionID.ToString(); | 403 | kvp["uuid"] = RegionID.ToString(); |
378 | kvp["locX"] = RegionLocX.ToString(); | 404 | kvp["locX"] = RegionLocX.ToString(); |
379 | kvp["locY"] = RegionLocY.ToString(); | 405 | kvp["locY"] = RegionLocY.ToString(); |
406 | kvp["sizeX"] = RegionSizeX.ToString(); | ||
407 | kvp["sizeY"] = RegionSizeY.ToString(); | ||
380 | kvp["regionName"] = RegionName; | 408 | kvp["regionName"] = RegionName; |
381 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); | 409 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); |
382 | kvp["serverHttpPort"] = HttpPort.ToString(); | 410 | kvp["serverHttpPort"] = HttpPort.ToString(); |
@@ -403,6 +431,16 @@ namespace OpenSim.Services.Interfaces | |||
403 | if (kvp.ContainsKey("locY")) | 431 | if (kvp.ContainsKey("locY")) |
404 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | 432 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); |
405 | 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 | |||
406 | if (kvp.ContainsKey("regionName")) | 444 | if (kvp.ContainsKey("regionName")) |
407 | RegionName = (string)kvp["regionName"]; | 445 | RegionName = (string)kvp["regionName"]; |
408 | 446 | ||
@@ -456,6 +494,9 @@ namespace OpenSim.Services.Interfaces | |||
456 | 494 | ||
457 | if (kvp.ContainsKey("Token")) | 495 | if (kvp.ContainsKey("Token")) |
458 | 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); | ||
459 | } | 500 | } |
460 | } | 501 | } |
461 | } | 502 | } |