diff options
author | Justin Clark-Casey (justincc) | 2010-02-03 15:35:41 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-02-03 15:35:41 +0000 |
commit | b6bee4999c9d238a052022f105069ea4eb85f8f4 (patch) | |
tree | 1d8138a97697f4de19a3390d2ee83b9bea744b44 | |
parent | refactor: move world comm message queueing into its own method (diff) | |
download | opensim-SC-b6bee4999c9d238a052022f105069ea4eb85f8f4.zip opensim-SC-b6bee4999c9d238a052022f105069ea4eb85f8f4.tar.gz opensim-SC-b6bee4999c9d238a052022f105069ea4eb85f8f4.tar.bz2 opensim-SC-b6bee4999c9d238a052022f105069ea4eb85f8f4.tar.xz |
change position of OnAttach event firing so that this also happens when a user teleports into a region
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 |
2 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73b0b3e..ff2be05 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2496,20 +2496,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2496 | 2496 | ||
2497 | //RootPrim.SetParentLocalId(parentLocalID); | 2497 | //RootPrim.SetParentLocalId(parentLocalID); |
2498 | 2498 | ||
2499 | m_log.DebugFormat("[ATTACHMENT]: Received " + | 2499 | m_log.DebugFormat( |
2500 | "attachment {0}, inworld asset id {1}", | 2500 | "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", |
2501 | //grp.RootPart.LastOwnerID.ToString(), | 2501 | //grp.RootPart.LastOwnerID.ToString(), |
2502 | grp.GetFromItemID(), | 2502 | grp.GetFromItemID(), |
2503 | grp.UUID.ToString()); | 2503 | grp.UUID.ToString()); |
2504 | 2504 | ||
2505 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2505 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2506 | m_log.DebugFormat("[ATTACHMENT]: Attach " + | 2506 | m_log.DebugFormat( |
2507 | "to avatar {0} at position {1}", | 2507 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); |
2508 | sp.UUID.ToString(), grp.AbsolutePosition); | 2508 | |
2509 | AttachObject(sp.ControllingClient, | 2509 | if ( |
2510 | grp.LocalId, (uint)0, | 2510 | AttachObject( |
2511 | grp.GroupRotation, | 2511 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false)) |
2512 | grp.AbsolutePosition, false); | 2512 | { |
2513 | // Do this last so that event listeners have access to all the effects of the attachment | ||
2514 | EventManager.TriggerOnAttach(grp.LocalId, UUID.Zero, sp.UUID); | ||
2515 | } | ||
2516 | |||
2513 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2517 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2514 | grp.SendGroupFullUpdate(); | 2518 | grp.SendGroupFullUpdate(); |
2515 | } | 2519 | } |
@@ -2518,7 +2522,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2518 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2522 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2519 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2523 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2520 | } | 2524 | } |
2521 | |||
2522 | } | 2525 | } |
2523 | else | 2526 | else |
2524 | { | 2527 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1ac061a..b508af5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -627,11 +627,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
627 | } | 627 | } |
628 | 628 | ||
629 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); | 629 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); |
630 | |||
631 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 630 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
631 | |||
632 | // In case it is later dropped again, don't let | 632 | // In case it is later dropped again, don't let |
633 | // it get cleaned up | 633 | // it get cleaned up |
634 | // | ||
635 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | 634 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); |
636 | group.HasGroupChanged = false; | 635 | group.HasGroupChanged = false; |
637 | } | 636 | } |