aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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/Region
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/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs27
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs21
3 files changed, 39 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 089bd4f..8a1bf20 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -2196,7 +2196,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2196 public GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, 2196 public GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID,
2197 double px, double py, uint pSizeHint) 2197 double px, double py, uint pSizeHint)
2198 { 2198 {
2199 m_log.DebugFormat("{0} GetRegionContainingWorldLocation: call, XY=<{1},{2}>", LogHeader, px, py); 2199 m_log.DebugFormat("{0} GetRegionContainingWorldLocation: query, loc=<{1},{2}>", LogHeader, px, py);
2200 GridRegion ret = null; 2200 GridRegion ret = null;
2201 const double fudge = 2.0; 2201 const double fudge = 2.0;
2202 2202
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 4661c21..664aba9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -198,8 +198,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
198 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 198 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
199 { 199 {
200 GridRegion region = null; 200 GridRegion region = null;
201// uint regionX = Util.WorldToRegionLoc((uint)x); 201 uint regionX = Util.WorldToRegionLoc((uint)x);
202// uint regionY = Util.WorldToRegionLoc((uint)y); 202 uint regionY = Util.WorldToRegionLoc((uint)y);
203
204 // Sanity check
205 if ((Util.RegionToWorldLoc(regionX) != (uint)x) || (Util.RegionToWorldLoc(regionY) != (uint)y))
206 {
207 m_log.WarnFormat("{0} GetRegionByPosition. Bad position requested: not the base of the region. Requested Pos=<{1},{2}>, Should Be=<{3},{4}>",
208 LogHeader, x, y, Util.RegionToWorldLoc(regionX), Util.RegionToWorldLoc(regionY));
209 }
203 210
204 // First see if it's a neighbour, even if it isn't on this sim. 211 // First see if it's a neighbour, even if it isn't on this sim.
205 // Neighbour data is cached in memory, so this is fast 212 // Neighbour data is cached in memory, so this is fast
@@ -211,8 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
211 region = rcache.GetRegionByPosition(x, y); 218 region = rcache.GetRegionByPosition(x, y);
212 if (region != null) 219 if (region != null)
213 { 220 {
214 // m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in cache. Pos=<{2},{3}>", 221 m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in cache (of region {2}). Pos=<{3},{4}>",
215 // LogHeader, region.RegionName, x, y); 222 LogHeader, region.RegionName,
223 Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY));
216 break; 224 break;
217 } 225 }
218 } 226 }
@@ -222,19 +230,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
222 if (region == null) 230 if (region == null)
223 { 231 {
224 region = m_GridService.GetRegionByPosition(scopeID, x, y); 232 region = m_GridService.GetRegionByPosition(scopeID, x, y);
225 /* 233
226 if (region == null) 234 if (region == null)
227 { 235 {
228 m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>", 236 m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>",
229 LogHeader, regionX, regionY); 237 LogHeader, regionX, regionY);
230 } 238 }
231 else 239 else
232 { 240 {
233 m_log.DebugFormat("{0} GetRegionByPosition. Requested region {1} from grid service. Pos=<{2},{3}>", 241 m_log.DebugFormat("{0} GetRegionByPosition. Got region {1} from grid service. Pos=<{2},{3}>",
234 LogHeader, region.RegionName, regionX, regionY); 242 LogHeader, region.RegionName,
243 Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY));
235 } 244 }
236 */
237 } 245 }
246
238 return region; 247 return region;
239 } 248 }
240 249
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index f0c4926..68ae4fa 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -193,16 +193,35 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
193 // The coordinates are world coords (meters), NOT region units. 193 // The coordinates are world coords (meters), NOT region units.
194 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 194 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
195 { 195 {
196 ulong regionHandle = Util.RegionWorldLocToHandle((uint)x, (uint)y);
197 uint regionX = Util.WorldToRegionLoc((uint)x);
198 uint regionY = Util.WorldToRegionLoc((uint)y);
199
200 // Sanity check
201 if ((Util.RegionToWorldLoc(regionX) != (uint)x) || (Util.RegionToWorldLoc(regionY) != (uint)y))
202 {
203 m_log.WarnFormat("[REMOTE GRID CONNECTOR]: GetRegionByPosition. Bad position requested: not the base of the region. Requested Pos=<{0},{1}>, Should Be=<{2},{3}>",
204 x, y, Util.RegionToWorldLoc(regionX), Util.RegionToWorldLoc(regionY));
205 }
206
196 bool inCache = false; 207 bool inCache = false;
197 GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.RegionWorldLocToHandle((uint)x, (uint)y), out inCache); 208 GridRegion rinfo = m_RegionInfoCache.Get(scopeID, regionHandle, out inCache);
198 if (inCache) 209 if (inCache)
210 {
211 m_log.DebugFormat("[REMOTE GRID CONNECTOR]: GetRegionByPosition. Found region {0} in cache. Pos=<{1},{2}>, RegionHandle={3}",
212 (rinfo == null) ? "<missing>" : rinfo.RegionName, regionX, regionY, (rinfo == null) ? regionHandle : rinfo.RegionHandle);
199 return rinfo; 213 return rinfo;
214 }
200 215
201 rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); 216 rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
202 if (rinfo == null) 217 if (rinfo == null)
203 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); 218 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
204 219
205 m_RegionInfoCache.Cache(rinfo); 220 m_RegionInfoCache.Cache(rinfo);
221
222 m_log.DebugFormat("[REMOTE GRID CONNECTOR]: GetRegionByPosition. Added region {0} to the cache. Pos=<{1},{2}>, RegionHandle={3}",
223 (rinfo == null) ? "<missing>" : rinfo.RegionName, regionX, regionY, (rinfo == null) ? regionHandle : rinfo.RegionHandle);
224
206 return rinfo; 225 return rinfo;
207 } 226 }
208 227