From e5f7c8b6e83170cbc7e0d49d9efd3fc3600396d3 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 24 Dec 2013 12:31:26 -0800 Subject: varregion: add lots of DEBUG level log messages. Especially for teleport. --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 3 ++- .../Framework/EntityTransfer/EntityTransferStateMachine.cs | 5 +++++ OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | 3 +-- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneBase.cs | 3 ++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++---- OpenSim/Services/Interfaces/IGridService.cs | 2 +- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 893b3c6..2aa43bc 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1998,8 +1998,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // Given a world position (fractional meter coordinate), get the GridRegion info for // the region containing that point. + // Someday this should be a method on GridService. // Return 'null' if no such region exists. - private GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) + public GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) { m_log.DebugFormat("{0} GetRegionContainingWorldLocation: call, XY=<{1},{2}>", LogHeader, px, py); GridRegion ret = null; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs index fc02916..6a04acf 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs @@ -77,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer public class EntityTransferStateMachine { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly string LogHeader = "[ENTITY TRANSFER STATE MACHINE]"; /// /// If true then on a teleport, the source region waits for a callback from the destination region. If @@ -100,6 +101,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer /// true if the agent was not already in transit, false if it was internal bool SetInTransit(UUID id) { + m_log.DebugFormat("{0} SetInTransit. agent={1}, newState=Preparing", LogHeader, id); lock (m_agentsInTransit) { if (!m_agentsInTransit.ContainsKey(id)) @@ -121,6 +123,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer /// Illegal transitions will throw an Exception internal bool UpdateInTransit(UUID id, AgentTransferState newState) { + m_log.DebugFormat("{0} UpdateInTransit. agent={1}, newState={2}", LogHeader, id, newState); + bool transitionOkay = false; // We don't want to throw an exception on cancel since this can come it at any time. @@ -193,6 +197,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } else if (failIfNotOkay) { + m_log.DebugFormat("{0} UpdateInTransit. Throwing transition failure = {1}", LogHeader, failureMessage); throw new Exception(failureMessage); } // else diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs index 3fa3706..966916a 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs @@ -76,8 +76,7 @@ namespace OpenSim.Region.Framework.Interfaces void Cross(SceneObjectGroup sog, Vector3 position, bool silent); - ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); - + ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); } public interface IUserAgentVerificationModule diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 65536db..9ae8612 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -46,8 +46,8 @@ namespace OpenSim.Region.Framework.Scenes { public partial class Scene { - private static readonly ILog m_log - = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly string LogHeader = "[SCENE INVENTORY]"; /// /// Allows asynchronous derezzing of objects from the scene into a client's inventory. diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 4f04706..f95220d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -42,7 +42,8 @@ namespace OpenSim.Region.Framework.Scenes { public abstract class SceneBase : IScene { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly string LogHeader = "[SCENE]"; #region Events diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0cd8b21..4efd9d5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -76,6 +76,7 @@ namespace OpenSim.Region.Framework.Scenes public class ScenePresence : EntityBase, IScenePresence { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly String LogHeader = "[SCENE PRESENCE]"; // ~ScenePresence() // { @@ -3438,12 +3439,11 @@ namespace OpenSim.Region.Framework.Scenes if (!IsInTransit) { - m_log.DebugFormat( - "[SCENE PRESENCE]: Testing border check for projected position {0} of {1} in {2}", - pos2, Name, Scene.Name); - if (!m_scene.PositionIsInCurrentRegion(pos2)) { + m_log.DebugFormat("{0} CheckForBorderCrossing: position outside region. {1} in {2} at pos {3}", + LogHeader, Name, Scene.Name, pos2); + // Disconnect from the current region bool isFlying = Flying; RemoveFromPhysicalScene(); diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index d4708b7..4a9a2fe 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -190,7 +190,7 @@ namespace OpenSim.Services.Interfaces public int RegionSizeY { get; set; } /// - /// The location of this region in meters. + /// The location of this region in meters. /// DANGER DANGER! Note that this name means something different in RegionInfo. /// public int RegionLocY -- cgit v1.1