diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 150 |
1 files changed, 148 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8c3f516..ad70ce3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -4745,6 +4745,152 @@ namespace OpenSim.Region.Framework.Scenes | |||
4745 | } | 4745 | } |
4746 | } | 4746 | } |
4747 | 4747 | ||
4748 | public void SendAttachmentsToAgentNFPK(ScenePresence p) | ||
4749 | { | ||
4750 | lock (m_attachments) | ||
4751 | { | ||
4752 | List<uint> pk = new List<uint>(); | ||
4753 | foreach (SceneObjectGroup sog in m_attachments) | ||
4754 | { | ||
4755 | foreach (SceneObjectPart part in sog.Parts) | ||
4756 | pk.Add(part.LocalId); | ||
4757 | } | ||
4758 | |||
4759 | p.ControllingClient.SendKillObject(pk); | ||
4760 | |||
4761 | foreach (SceneObjectGroup sog in m_attachments) | ||
4762 | { | ||
4763 | if (p == this || !sog.HasPrivateAttachmentPoint) | ||
4764 | sog.SendFullUpdateToClient(p.ControllingClient); | ||
4765 | } | ||
4766 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path | ||
4767 | } | ||
4768 | } | ||
4769 | |||
4770 | |||
4771 | public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) | ||
4772 | { | ||
4773 | if (IsChildAgent) | ||
4774 | return; | ||
4775 | |||
4776 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | ||
4777 | { | ||
4778 | if (p != this && sog.HasPrivateAttachmentPoint) | ||
4779 | return; | ||
4780 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | ||
4781 | return; | ||
4782 | |||
4783 | SceneObjectPart[] parts = sog.Parts; | ||
4784 | |||
4785 | for (int i = 0; i < parts.Length; i++) | ||
4786 | { | ||
4787 | SceneObjectPart part = parts[i]; | ||
4788 | if (part.UpdateFlag == UpdateRequired.TERSE) | ||
4789 | { | ||
4790 | p.ControllingClient.SendEntityUpdate(part, | ||
4791 | PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
4792 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); | ||
4793 | part.UpdateFlag = 0; | ||
4794 | } | ||
4795 | else if (part.UpdateFlag == UpdateRequired.FULL) | ||
4796 | { | ||
4797 | p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); | ||
4798 | part.UpdateFlag = 0; | ||
4799 | } | ||
4800 | } | ||
4801 | }); | ||
4802 | } | ||
4803 | |||
4804 | public void SendAttachmentScheduleUpdate(SceneObjectPart part) | ||
4805 | { | ||
4806 | if (IsChildAgent) | ||
4807 | return; | ||
4808 | |||
4809 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | ||
4810 | { | ||
4811 | if (p != this && part.ParentGroup.HasPrivateAttachmentPoint) | ||
4812 | return; | ||
4813 | |||
4814 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | ||
4815 | return; | ||
4816 | |||
4817 | if (part.UpdateFlag == UpdateRequired.TERSE) | ||
4818 | { | ||
4819 | p.ControllingClient.SendEntityUpdate(part, | ||
4820 | PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
4821 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); | ||
4822 | part.UpdateFlag = 0; | ||
4823 | } | ||
4824 | else if (part.UpdateFlag == UpdateRequired.FULL) | ||
4825 | { | ||
4826 | p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); | ||
4827 | part.UpdateFlag = 0; | ||
4828 | } | ||
4829 | }); | ||
4830 | } | ||
4831 | |||
4832 | public void SendAttachmentUpdate(SceneObjectGroup sog, UpdateRequired UpdateFlag) | ||
4833 | { | ||
4834 | if (IsChildAgent) | ||
4835 | return; | ||
4836 | |||
4837 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | ||
4838 | { | ||
4839 | if (p != this && sog.HasPrivateAttachmentPoint) | ||
4840 | return; | ||
4841 | |||
4842 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | ||
4843 | return; | ||
4844 | |||
4845 | SceneObjectPart[] parts = sog.Parts; | ||
4846 | |||
4847 | for (int i = 0; i < parts.Length; i++) | ||
4848 | { | ||
4849 | SceneObjectPart part = parts[i]; | ||
4850 | if (UpdateFlag == UpdateRequired.TERSE) | ||
4851 | { | ||
4852 | p.ControllingClient.SendEntityUpdate(part, | ||
4853 | PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
4854 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); | ||
4855 | part.UpdateFlag = 0; | ||
4856 | } | ||
4857 | else if (UpdateFlag == UpdateRequired.FULL) | ||
4858 | { | ||
4859 | p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); | ||
4860 | part.UpdateFlag = 0; | ||
4861 | } | ||
4862 | } | ||
4863 | }); | ||
4864 | } | ||
4865 | |||
4866 | public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag) | ||
4867 | { | ||
4868 | if (IsChildAgent) | ||
4869 | return; | ||
4870 | |||
4871 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | ||
4872 | { | ||
4873 | if (p != this && part.ParentGroup.HasPrivateAttachmentPoint) | ||
4874 | return; | ||
4875 | |||
4876 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | ||
4877 | return; | ||
4878 | |||
4879 | if (UpdateFlag == UpdateRequired.TERSE) | ||
4880 | { | ||
4881 | p.ControllingClient.SendEntityUpdate(part, | ||
4882 | PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
4883 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); | ||
4884 | part.UpdateFlag = 0; | ||
4885 | } | ||
4886 | else if (UpdateFlag == UpdateRequired.FULL) | ||
4887 | { | ||
4888 | p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); | ||
4889 | part.UpdateFlag = 0; | ||
4890 | } | ||
4891 | }); | ||
4892 | } | ||
4893 | |||
4748 | /// <summary> | 4894 | /// <summary> |
4749 | /// Send a script event to this scene presence's attachments | 4895 | /// Send a script event to this scene presence's attachments |
4750 | /// </summary> | 4896 | /// </summary> |
@@ -5521,7 +5667,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5521 | p.SendAppearanceToAgent(this); | 5667 | p.SendAppearanceToAgent(this); |
5522 | if (p.Animator != null) | 5668 | if (p.Animator != null) |
5523 | p.Animator.SendAnimPackToClient(ControllingClient); | 5669 | p.Animator.SendAnimPackToClient(ControllingClient); |
5524 | p.SendAttachmentsToAgentNF(this); | 5670 | p.SendAttachmentsToAgentNFPK(this); |
5525 | } | 5671 | } |
5526 | } | 5672 | } |
5527 | } | 5673 | } |
@@ -5852,7 +5998,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5852 | p.SendAppearanceToAgent(this); | 5998 | p.SendAppearanceToAgent(this); |
5853 | if (p.Animator != null) | 5999 | if (p.Animator != null) |
5854 | p.Animator.SendAnimPackToClient(ControllingClient); | 6000 | p.Animator.SendAnimPackToClient(ControllingClient); |
5855 | p.SendAttachmentsToAgentNF(this); | 6001 | p.SendAttachmentsToAgentNFPK(this); |
5856 | } | 6002 | } |
5857 | } | 6003 | } |
5858 | } | 6004 | } |