Making attachments work again. Tons of debug more. This needs more testing and a lot of cleaning.

This commit is contained in:
Diva Canto
2009-08-16 16:17:19 -07:00
parent 6808b9109e
commit e02062051d
8 changed files with 183 additions and 66 deletions

View File

@@ -557,6 +557,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = GetGroupByPrim(objectLocalID);
if (group != null)
{
m_log.DebugFormat("[SCENE GRAPH]: AttachObject got {0}", group.UUID);
if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId))
{
// If the attachment point isn't the same as the one previously used
@@ -564,6 +565,7 @@ namespace OpenSim.Region.Framework.Scenes
// and not in a weird location somewhere unknown.
if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
{
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 1 got {0}", group.UUID);
attachPos = Vector3.Zero;
}
@@ -572,7 +574,8 @@ namespace OpenSim.Region.Framework.Scenes
{
// Check object for stored attachment point
AttachmentPt = (uint)group.GetAttachmentPoint();
}
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 2 got {0}", group.UUID);
}
// if we still didn't find a suitable attachment point.......
if (AttachmentPt == 0)
@@ -580,8 +583,12 @@ namespace OpenSim.Region.Framework.Scenes
// Stick it on left hand with Zero Offset from the attachment point.
AttachmentPt = (uint)AttachmentPoint.LeftHand;
attachPos = Vector3.Zero;
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 3 got {0}", group.UUID);
}
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 4 got {0}", group.UUID);
group.SetAttachmentPoint(Convert.ToByte(AttachmentPt));
group.AbsolutePosition = attachPos;
@@ -590,10 +597,12 @@ namespace OpenSim.Region.Framework.Scenes
if (group.GetFromItemID() == UUID.Zero)
{
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 5 got {0}", group.UUID);
m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId);
}
else
{
m_log.DebugFormat("[SCENE GRAPH]: AttachObject 6 got {0}", group.GetFromItemID());
itemId = group.GetFromItemID();
}
@@ -611,6 +620,8 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false);
}
}
else
m_log.DebugFormat("[SCENE GRAPH]: AttachObject found no such scene object {0}", objectLocalID);
}
protected internal ScenePresence CreateAndAddChildScenePresence(IClientAPI client, AvatarAppearance appearance)