aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorOren Hurvitz2015-07-22 20:13:53 +0300
committerOren Hurvitz2015-07-22 20:13:53 +0300
commit3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea (patch)
treefd52b3f754d0e079ff8d7698cb6812eea734613d /OpenSim/Services
parentAdded the thread name to the logs (diff)
downloadopensim-SC_OLD-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.zip
opensim-SC_OLD-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.tar.gz
opensim-SC_OLD-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.tar.bz2
opensim-SC_OLD-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.tar.xz
Added logging in places where regions are searched for by their location
This commit also fixes the log message "Region already exists in coordinates <{0},{1}>": it was actually showing the *requested* coordinates, instead of the coordinates of the previously-existing link.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/GridService/GridService.cs19
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs11
2 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index af7a511..8807397 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -539,13 +539,24 @@ namespace OpenSim.Services.GridService
539 // multiples of the legacy region size (256). 539 // multiples of the legacy region size (256).
540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
541 { 541 {
542 int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; 542 uint regionX = Util.WorldToRegionLoc((uint)x);
543 int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize; 543 uint regionY = Util.WorldToRegionLoc((uint)y);
544 int snapX = (int)Util.RegionToWorldLoc(regionX);
545 int snapY = (int)Util.RegionToWorldLoc(regionY);
546
544 RegionData rdata = m_Database.Get(snapX, snapY, scopeID); 547 RegionData rdata = m_Database.Get(snapX, snapY, scopeID);
545 if (rdata != null) 548 if (rdata != null)
549 {
550 m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in database. Pos=<{2},{3}>",
551 LogHeader, rdata.RegionName, regionX, regionY);
546 return RegionData2RegionInfo(rdata); 552 return RegionData2RegionInfo(rdata);
547 553 }
548 return null; 554 else
555 {
556 m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>",
557 LogHeader, regionX, regionY);
558 return null;
559 }
549 } 560 }
550 561
551 public GridRegion GetRegionByName(UUID scopeID, string name) 562 public GridRegion GetRegionByName(UUID scopeID, string name)
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 09c7938..0fd059f 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Services.GridService
282 282
283 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) 283 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
284 { 284 {
285 m_log.InfoFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}", 285 m_log.InfoFormat("[HYPERGRID LINKER]: Link to {0} {1}, in <{2},{3}>",
286 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), 286 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
287 remoteRegionName, Util.WorldToRegionLoc((uint)xloc), Util.WorldToRegionLoc((uint)yloc)); 287 remoteRegionName, Util.WorldToRegionLoc((uint)xloc), Util.WorldToRegionLoc((uint)yloc));
288 288
@@ -335,7 +335,7 @@ namespace OpenSim.Services.GridService
335 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); 335 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
336 if (region != null) 336 if (region != null)
337 { 337 {
338 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", 338 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates <{0},{1}> are already occupied by region {2} with uuid {3}",
339 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY), 339 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY),
340 region.RegionName, region.RegionID); 340 region.RegionName, region.RegionID);
341 reason = "Coordinates are already in use"; 341 reason = "Coordinates are already in use";
@@ -371,8 +371,8 @@ namespace OpenSim.Services.GridService
371 region = m_GridService.GetRegionByUUID(scopeID, regionID); 371 region = m_GridService.GetRegionByUUID(scopeID, regionID);
372 if (region != null) 372 if (region != null)
373 { 373 {
374 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", 374 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates <{0},{1}>",
375 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY)); 375 Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY));
376 regInfo = region; 376 regInfo = region;
377 return true; 377 return true;
378 } 378 }
@@ -406,7 +406,8 @@ namespace OpenSim.Services.GridService
406 regInfo.RegionSecret = handle.ToString(); 406 regInfo.RegionSecret = handle.ToString();
407 407
408 AddHyperlinkRegion(regInfo, handle); 408 AddHyperlinkRegion(regInfo, handle);
409 m_log.InfoFormat("[HYPERGRID LINKER]: Successfully linked to region {0} with image {1}", regInfo.RegionName, regInfo.TerrainImage); 409 m_log.InfoFormat("[HYPERGRID LINKER]: Successfully linked to region {0} at <{1},{2}> with image {3}",
410 regInfo.RegionName, Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY), regInfo.TerrainImage);
410 return true; 411 return true;
411 } 412 }
412 413