aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
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/GridService/GridService.cs
parentAdded the thread name to the logs (diff)
downloadopensim-SC-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.zip
opensim-SC-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.tar.gz
opensim-SC-3a2d4c8b055d906b4a790bf1bf9fb1f09f9781ea.tar.bz2
opensim-SC-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/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs19
1 files changed, 15 insertions, 4 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)