From 0300ec45ebc7b8696c64bf4575bf674a6b1a8fa7 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 31 May 2014 12:10:50 -0700 Subject: [PATCH] Modifications to debugging printouts. No functional changes. --- .../Grid/LocalGridServiceConnector.cs | 10 ++++++++-- .../CoreModules/World/Terrain/TerrainModule.cs | 13 ++++++++----- .../Framework/Scenes/SceneCommunicationService.cs | 14 +++++--------- OpenSim/Services/GridService/GridService.cs | 9 +++++++-- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 3b38c71dfd..d5fca71dff 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -199,6 +199,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { GridRegion region = null; + uint regionX = Util.WorldToRegionLoc((uint)x); + uint regionY = Util.WorldToRegionLoc((uint)y); // First see if it's a neighbour, even if it isn't on this sim. // Neighbour data is cached in memory, so this is fast @@ -222,11 +224,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid { region = m_GridService.GetRegionByPosition(scopeID, x, y); if (region == null) + { m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>", - LogHeader, x, y); + LogHeader, regionX, regionY); + } else + { m_log.DebugFormat("{0} GetRegionByPosition. Requested region {1} from grid service. Pos=<{2},{3}>", - LogHeader, region.RegionName, x, y); + LogHeader, region.RegionName, regionX, regionY); + } } return region; } diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index ad17d6d4ba..c22c5b6d7b 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -174,6 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain } } } + // The flags of which terrain patches to send for each of the ScenePresence's private Dictionary m_perClientPatchUpdates = new Dictionary(); @@ -1030,8 +1031,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain List toSend = GetModifiedPatchesInViewDistance(pups); if (toSend.Count > 0) { - m_log.DebugFormat("{0} CheckSendingPatchesToClient: sending {1} patches to {2}", - LogHeader, toSend.Count, pups.Presence.Name); + // m_log.DebugFormat("{0} CheckSendingPatchesToClient: sending {1} patches to {2} in region {3}", + // LogHeader, toSend.Count, pups.Presence.Name, m_scene.RegionInfo.RegionName); // Sort the patches to send by the distance from the presence toSend.Sort(); foreach (PatchesToSend pts in toSend) @@ -1067,8 +1068,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain int endY = (((int) (presence.AbsolutePosition.Y + presence.DrawDistance))/Constants.TerrainPatchSize) + 2; endY = Math.Max(endY, 0); endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize); - m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. ddist={1}, start=<{2},{3}>, end=<{4},{5}>", - LogHeader, presence.DrawDistance, startX, startY, endX, endY); + // m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. rName={1}, ddist={2}, apos={3}, start=<{4},{5}>, end=<{6},{7}>", + // LogHeader, m_scene.RegionInfo.RegionName, + // presence.DrawDistance, presence.AbsolutePosition, + // startX, startY, endX, endY); for (int x = startX; x < endX; x++) { for (int y = startY; y < endY; y++) @@ -1079,7 +1082,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain if (pups.GetByPatch(x, y)) { //Check which has less distance, camera or avatar position, both have to be done. - //Its not a radius, its a diameter and we add 50 so that it doesn't look like it cuts off + //Its not a radius, its a diameter and we add 50 so that it doesn't look like it cuts off if (Util.DistanceLessThan(presencePos, patchPos, presence.DrawDistance + 50) || Util.DistanceLessThan(presence.CameraPosition, patchPos, presence.DrawDistance + 50)) { diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index c873e40c01..45c33484d7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes public class SceneCommunicationService //one instance per region { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static string LogHeader = "[SCENE COMMUNIATION SERVICE]"; protected RegionInfo m_regionInfo; protected Scene m_scene; @@ -84,15 +85,12 @@ namespace OpenSim.Region.Framework.Scenes if (neighbourService != null) neighbour = neighbourService.HelloNeighbour(regionhandle, region); else - m_log.DebugFormat( - "[SCENE COMMUNICATION SERVICE]: No neighbour service provided for region {0} to inform neigbhours of status", - m_scene.Name); + m_log.DebugFormat( "{0} neighbour service provided for region {0} to inform neigbhours of status", LogHeader, m_scene.Name); if (neighbour != null) { - m_log.DebugFormat( - "[SCENE COMMUNICATION SERVICE]: Region {0} successfully informed neighbour {1} at {2}-{3} that it is up", - m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); + m_log.DebugFormat( "{0} Region {1} successfully informed neighbour {2} at {3}-{4} that it is up", + LogHeader, m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); m_scene.EventManager.TriggerOnRegionUp(neighbour); } @@ -111,9 +109,7 @@ namespace OpenSim.Region.Framework.Scenes List neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); - m_log.DebugFormat( - "[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that region {1} is up", - neighbours.Count, m_scene.Name); + m_log.DebugFormat("{0} Informing {1} neighbours that region {2} is up", LogHeader, neighbours.Count, m_scene.Name); foreach (GridRegion n in neighbours) { diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 81985929e4..36957a74c0 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -46,6 +46,7 @@ namespace OpenSim.Services.GridService private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + private string LogHeader = "[GRID SERVICE]"; private bool m_DeleteOnUnregister = true; private static GridService m_RootInstance = null; @@ -328,7 +329,11 @@ namespace OpenSim.Services.GridService } } -// m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count); + // string rNames = ""; + // foreach (GridRegion gr in rinfos) + // rNames += gr.RegionName + ","; + // m_log.DebugFormat("{0} region {1} has {2} neighbours ({3})", + // LogHeader, region.RegionName, rinfos.Count, rNames); } else { @@ -657,7 +662,7 @@ namespace OpenSim.Services.GridService return; } - RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); + RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); if (region == null) { MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);