Add extra log information when attachments fail validation

remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-10 00:57:52 +01:00
parent 7531851bec
commit 9c32b131fd
2 changed files with 20 additions and 6 deletions

View File

@ -59,7 +59,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
get { return m_MaxTransferDistance; } get { return m_MaxTransferDistance; }
set { m_MaxTransferDistance = value; } set { m_MaxTransferDistance = value; }
} }
protected bool m_Enabled = false; protected bool m_Enabled = false;
protected Scene m_aScene; protected Scene m_aScene;
@ -68,7 +67,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions =
new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>();
#region ISharedRegionModule #region ISharedRegionModule
public Type ReplaceableInterface public Type ReplaceableInterface
@ -329,7 +327,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (sp.ParentID != (uint)0) if (sp.ParentID != (uint)0)
sp.StandUp(); sp.StandUp();
sp.ValidateAttachments(); if (!sp.ValidateAttachments())
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.",
sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName);
// if (!sp.ValidateAttachments()) // if (!sp.ValidateAttachments())
// { // {
@ -941,7 +942,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// This Closes child agents on neighbouring regions /// This Closes child agents on neighbouring regions
/// Calls an asynchronous method to do so.. so it doesn't lag the sim. /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
/// </summary> /// </summary>
protected ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version) protected ScenePresence CrossAgentToNewRegionAsync(
ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion,
bool isFlying, string version)
{ {
ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
@ -951,7 +954,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (neighbourRegion != null) if (neighbourRegion != null)
{ {
agent.ValidateAttachments(); if (!agent.ValidateAttachments())
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
pos = pos + (agent.Velocity); pos = pos + (agent.Velocity);

View File

@ -3501,8 +3501,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// This is currently just being done for information. /// This is currently just being done for information.
/// </summary> /// </summary>
public void ValidateAttachments() public bool ValidateAttachments()
{ {
bool validated = true;
lock (m_attachments) lock (m_attachments)
{ {
// Validate // Validate
@ -3512,15 +3514,21 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[SCENE PRESENCE]: Failed to validate an attachment for {0} since it was null. Continuing", Name); "[SCENE PRESENCE]: Failed to validate an attachment for {0} since it was null. Continuing", Name);
validated = false;
} }
else if (gobj.IsDeleted) else if (gobj.IsDeleted)
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[SCENE PRESENCE]: Failed to validate attachment {0} {1} for {2} since it had been deleted. Continuing", "[SCENE PRESENCE]: Failed to validate attachment {0} {1} for {2} since it had been deleted. Continuing",
gobj.Name, gobj.UUID, Name); gobj.Name, gobj.UUID, Name);
validated = false;
} }
} }
} }
return validated;
} }
/// <summary> /// <summary>