Modifications to debugging printouts. No functional changes.

bullet-2.82
Robert Adams 2014-05-31 12:10:50 -07:00
parent 22dade6463
commit 0300ec45eb
4 changed files with 28 additions and 18 deletions

View File

@ -199,6 +199,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
{ {
GridRegion region = null; 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. // 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 // 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); region = m_GridService.GetRegionByPosition(scopeID, x, y);
if (region == null) if (region == null)
{
m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>", m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>",
LogHeader, x, y); LogHeader, regionX, regionY);
}
else else
{
m_log.DebugFormat("{0} GetRegionByPosition. Requested region {1} from grid service. Pos=<{2},{3}>", 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; return region;
} }

View File

@ -174,6 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
} }
} }
} }
// The flags of which terrain patches to send for each of the ScenePresence's // The flags of which terrain patches to send for each of the ScenePresence's
private Dictionary<UUID, PatchUpdates> m_perClientPatchUpdates = new Dictionary<UUID, PatchUpdates>(); private Dictionary<UUID, PatchUpdates> m_perClientPatchUpdates = new Dictionary<UUID, PatchUpdates>();
@ -1030,8 +1031,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
List<PatchesToSend> toSend = GetModifiedPatchesInViewDistance(pups); List<PatchesToSend> toSend = GetModifiedPatchesInViewDistance(pups);
if (toSend.Count > 0) if (toSend.Count > 0)
{ {
m_log.DebugFormat("{0} CheckSendingPatchesToClient: sending {1} patches to {2}", // m_log.DebugFormat("{0} CheckSendingPatchesToClient: sending {1} patches to {2} in region {3}",
LogHeader, toSend.Count, pups.Presence.Name); // LogHeader, toSend.Count, pups.Presence.Name, m_scene.RegionInfo.RegionName);
// Sort the patches to send by the distance from the presence // Sort the patches to send by the distance from the presence
toSend.Sort(); toSend.Sort();
foreach (PatchesToSend pts in toSend) 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; int endY = (((int) (presence.AbsolutePosition.Y + presence.DrawDistance))/Constants.TerrainPatchSize) + 2;
endY = Math.Max(endY, 0); endY = Math.Max(endY, 0);
endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize); endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize);
m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. ddist={1}, start=<{2},{3}>, end=<{4},{5}>", // m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. rName={1}, ddist={2}, apos={3}, start=<{4},{5}>, end=<{6},{7}>",
LogHeader, presence.DrawDistance, startX, startY, endX, endY); // LogHeader, m_scene.RegionInfo.RegionName,
// presence.DrawDistance, presence.AbsolutePosition,
// startX, startY, endX, endY);
for (int x = startX; x < endX; x++) for (int x = startX; x < endX; x++)
{ {
for (int y = startY; y < endY; y++) for (int y = startY; y < endY; y++)
@ -1079,7 +1082,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (pups.GetByPatch(x, y)) if (pups.GetByPatch(x, y))
{ {
//Check which has less distance, camera or avatar position, both have to be done. //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) if (Util.DistanceLessThan(presencePos, patchPos, presence.DrawDistance + 50)
|| Util.DistanceLessThan(presence.CameraPosition, patchPos, presence.DrawDistance + 50)) || Util.DistanceLessThan(presence.CameraPosition, patchPos, presence.DrawDistance + 50))
{ {

View File

@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes
public class SceneCommunicationService //one instance per region public class SceneCommunicationService //one instance per region
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string LogHeader = "[SCENE COMMUNIATION SERVICE]";
protected RegionInfo m_regionInfo; protected RegionInfo m_regionInfo;
protected Scene m_scene; protected Scene m_scene;
@ -84,15 +85,12 @@ namespace OpenSim.Region.Framework.Scenes
if (neighbourService != null) if (neighbourService != null)
neighbour = neighbourService.HelloNeighbour(regionhandle, region); neighbour = neighbourService.HelloNeighbour(regionhandle, region);
else else
m_log.DebugFormat( m_log.DebugFormat( "{0} neighbour service provided for region {0} to inform neigbhours of status", LogHeader, m_scene.Name);
"[SCENE COMMUNICATION SERVICE]: No neighbour service provided for region {0} to inform neigbhours of status",
m_scene.Name);
if (neighbour != null) if (neighbour != null)
{ {
m_log.DebugFormat( m_log.DebugFormat( "{0} Region {1} successfully informed neighbour {2} at {3}-{4} that it is up",
"[SCENE COMMUNICATION SERVICE]: Region {0} successfully informed neighbour {1} at {2}-{3} that it is up", LogHeader, m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y));
m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y));
m_scene.EventManager.TriggerOnRegionUp(neighbour); m_scene.EventManager.TriggerOnRegionUp(neighbour);
} }
@ -111,9 +109,7 @@ namespace OpenSim.Region.Framework.Scenes
List<GridRegion> neighbours List<GridRegion> neighbours
= m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
m_log.DebugFormat( m_log.DebugFormat("{0} Informing {1} neighbours that region {2} is up", LogHeader, neighbours.Count, m_scene.Name);
"[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that region {1} is up",
neighbours.Count, m_scene.Name);
foreach (GridRegion n in neighbours) foreach (GridRegion n in neighbours)
{ {

View File

@ -46,6 +46,7 @@ namespace OpenSim.Services.GridService
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private string LogHeader = "[GRID SERVICE]";
private bool m_DeleteOnUnregister = true; private bool m_DeleteOnUnregister = true;
private static GridService m_RootInstance = null; 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 else
{ {