change position of OnAttach event firing so that this also happens when a user teleports into a region

mysql-performance
Justin Clark-Casey (justincc) 2010-02-03 15:35:41 +00:00
parent bbd41de6d5
commit b6bee4999c
2 changed files with 17 additions and 15 deletions

View File

@ -2496,20 +2496,24 @@ namespace OpenSim.Region.Framework.Scenes
//RootPrim.SetParentLocalId(parentLocalID);
m_log.DebugFormat("[ATTACHMENT]: Received " +
"attachment {0}, inworld asset id {1}",
m_log.DebugFormat(
"[ATTACHMENT]: Received attachment {0}, inworld asset id {1}",
//grp.RootPart.LastOwnerID.ToString(),
grp.GetFromItemID(),
grp.UUID.ToString());
//grp.SetFromAssetID(grp.RootPart.LastOwnerID);
m_log.DebugFormat("[ATTACHMENT]: Attach " +
"to avatar {0} at position {1}",
sp.UUID.ToString(), grp.AbsolutePosition);
AttachObject(sp.ControllingClient,
grp.LocalId, (uint)0,
grp.GroupRotation,
grp.AbsolutePosition, false);
m_log.DebugFormat(
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition);
if (
AttachObject(
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false))
{
// Do this last so that event listeners have access to all the effects of the attachment
EventManager.TriggerOnAttach(grp.LocalId, UUID.Zero, sp.UUID);
}
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate();
}
@ -2518,7 +2522,6 @@ namespace OpenSim.Region.Framework.Scenes
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
}
else
{

View File

@ -627,11 +627,10 @@ namespace OpenSim.Region.Framework.Scenes
}
m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group);
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent);
// In case it is later dropped again, don't let
// it get cleaned up
//
group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
group.HasGroupChanged = false;
}