aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs243
1 files changed, 48 insertions, 195 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9e9a83f..333eb9b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1920,7 +1920,6 @@ namespace OpenSim.Region.Framework.Scenes
1920 SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path 1920 SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
1921 }); 1921 });
1922 } 1922 }
1923
1924 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 1923 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
1925 sog.ResumeScripts(); 1924 sog.ResumeScripts();
1926 } 1925 }
@@ -3542,14 +3541,12 @@ namespace OpenSim.Region.Framework.Scenes
3542 } 3541 }
3543 3542
3544 SendOtherAgentsAvatarFullToMe(); 3543 SendOtherAgentsAvatarFullToMe();
3545
3546 EntityBase[] entities = Scene.Entities.GetEntities(); 3544 EntityBase[] entities = Scene.Entities.GetEntities();
3547 foreach (EntityBase e in entities) 3545 foreach (EntityBase e in entities)
3548 { 3546 {
3549 if (e != null && e is SceneObjectGroup) 3547 if (e != null && e is SceneObjectGroup)
3550 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); 3548 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
3551 } 3549 }
3552
3553 }); 3550 });
3554 } 3551 }
3555 3552
@@ -4754,32 +4751,6 @@ namespace OpenSim.Region.Framework.Scenes
4754 } 4751 }
4755 } 4752 }
4756 4753
4757 // send attachments to a client without filters except for huds
4758 // for now they are checked in several places down the line...
4759 // kills all parts before sending
4760 public void SendAttachmentsToAgentNFPK(ScenePresence p)
4761 {
4762 lock (m_attachments)
4763 {
4764 List<uint> pk = new List<uint>();
4765 foreach (SceneObjectGroup sog in m_attachments)
4766 {
4767 foreach (SceneObjectPart part in sog.Parts)
4768 pk.Add(part.LocalId);
4769 }
4770
4771 p.ControllingClient.SendKillObject(pk);
4772
4773 foreach (SceneObjectGroup sog in m_attachments)
4774 {
4775 if (p == this || !sog.HasPrivateAttachmentPoint)
4776 sog.SendFullUpdateToClient(p.ControllingClient);
4777 }
4778 SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
4779 }
4780 }
4781
4782
4783 public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) 4754 public void SendAttachmentScheduleUpdate(SceneObjectGroup sog)
4784 { 4755 {
4785 if (IsChildAgent) 4756 if (IsChildAgent)
@@ -4796,9 +4767,27 @@ namespace OpenSim.Region.Framework.Scenes
4796 4767
4797 SceneObjectPart[] parts = sog.Parts; 4768 SceneObjectPart[] parts = sog.Parts;
4798 4769
4770 SendFullUpdateToClient(p.ControllingClient);
4771
4772 SceneObjectPart rootpart = sog.RootPart;
4773 if (rootpart.UpdateFlag == UpdateRequired.TERSE)
4774 {
4775 p.ControllingClient.SendEntityUpdate(rootpart,
4776 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
4777 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
4778 rootpart.UpdateFlag = 0;
4779 }
4780 else if (rootpart.UpdateFlag == UpdateRequired.FULL)
4781 {
4782 p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate);
4783 rootpart.UpdateFlag = 0;
4784 }
4785
4799 for (int i = 0; i < parts.Length; i++) 4786 for (int i = 0; i < parts.Length; i++)
4800 { 4787 {
4801 SceneObjectPart part = parts[i]; 4788 SceneObjectPart part = parts[i];
4789 if (part == rootpart)
4790 continue;
4802 if (part.UpdateFlag == UpdateRequired.TERSE) 4791 if (part.UpdateFlag == UpdateRequired.TERSE)
4803 { 4792 {
4804 p.ControllingClient.SendEntityUpdate(part, 4793 p.ControllingClient.SendEntityUpdate(part,
@@ -5655,183 +5644,56 @@ namespace OpenSim.Region.Framework.Scenes
5655 5644
5656 private void parcelGodCheck(UUID currentParcelID, bool isGod) 5645 private void parcelGodCheck(UUID currentParcelID, bool isGod)
5657 { 5646 {
5658 List<ScenePresence> allpresences = null; 5647 List<ScenePresence> allpresences = m_scene.GetScenePresences();
5659
5660 5648
5661 allpresences = m_scene.GetScenePresences(); 5649 foreach (ScenePresence p in allpresences)
5662
5663 if (isGod)
5664 {
5665 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5666
5667 foreach (ScenePresence p in allpresences)
5668 {
5669 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5670 continue;
5671
5672 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
5673 {
5674 viewsToSendme.Add(p); // i see them
5675 }
5676 }
5677
5678 if (viewsToSendme.Count > 0)
5679 {
5680 foreach (ScenePresence p in viewsToSendme)
5681 {
5682 if (p.IsChildAgent)
5683 continue;
5684
5685 p.SendAvatarDataToAgentNF(this);
5686 p.SendAppearanceToAgent(this);
5687 if (p.Animator != null)
5688 p.Animator.SendAnimPackToClient(ControllingClient);
5689 p.SendAttachmentsToAgentNF(this);
5690 }
5691 }
5692 }
5693 else
5694 { 5650 {
5695 List<ScenePresence> killsToSendme = new List<ScenePresence>(); 5651 if (p.IsDeleted || p.IsChildAgent || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5696 5652 continue;
5697 foreach (ScenePresence p in allpresences)
5698 {
5699 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5700 continue;
5701
5702 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
5703 {
5704 killsToSendme.Add(p);
5705 }
5706 }
5707 5653
5708 if (killsToSendme.Count > 0) 5654 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
5709 { 5655 {
5710 foreach (ScenePresence p in killsToSendme) 5656 if (isGod)
5711 { 5657 p.SendViewTo(this);
5712 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); 5658 else
5713 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } 5659 p.SendKillTo(this);
5714 catch (NullReferenceException) { }
5715 }
5716 } 5660 }
5717 } 5661 }
5718
5719 } 5662 }
5720 5663
5721 private void ParcelLoginCheck(UUID currentParcelID) 5664 private void ParcelLoginCheck(UUID currentParcelID)
5722 { 5665 {
5723 List<ScenePresence> killsToSendto = new List<ScenePresence>(); 5666 List<ScenePresence> allpresences = m_scene.GetScenePresences();
5724 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5725 List<ScenePresence> viewsToSendto = new List<ScenePresence>();
5726 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5727 List<ScenePresence> allpresences = null;
5728
5729 allpresences = m_scene.GetScenePresences();
5730 5667
5731 foreach (ScenePresence p in allpresences) 5668 foreach (ScenePresence p in allpresences)
5732 { 5669 {
5733 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) 5670 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5734 continue; 5671 continue;
5735 5672
5736 if (currentParcelID != p.currentParcelUUID) 5673 if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
5737 {
5738 if (p.GodLevel < 200)
5739 killsToSendto.Add(p);
5740// if (GodLevel < 200 && p.ParcelHideThisAvatar)
5741// killsToSendme.Add(p.LocalId);
5742 }
5743 else
5744 { 5674 {
5745 viewsToSendto.Add(p);
5746 viewsToSendme.Add(p);
5747 }
5748 }
5749 allpresences.Clear();
5750
5751 // send the things
5752 // kill main avatar object
5753 if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5754 {
5755 foreach (ScenePresence p in killsToSendto)
5756 {
5757 m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
5758 SendKillTo(p); 5675 SendKillTo(p);
5759// try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
5760// catch (NullReferenceException) { }
5761 }
5762 }
5763
5764 if (killsToSendme.Count > 0)
5765 {
5766 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + killsToSendme.Count.ToString());
5767 foreach (ScenePresence p in killsToSendme)
5768 {
5769 SendKillTo(this);
5770 }
5771
5772 }
5773/*
5774 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5775 {
5776 foreach (ScenePresence p in viewsToSendto)
5777 {
5778 m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
5779 p.ControllingClient.SendAvatarDataImmediate(this);
5780 SendAppearanceToAgent(p);
5781 SendAttachmentsToClient(p.ControllingClient);
5782 if (Animator != null)
5783 Animator.SendAnimPackToClient(p.ControllingClient);
5784 }
5785 }
5786
5787 if (viewsToSendme.Count > 0)
5788 {
5789 foreach (ScenePresence p in viewsToSendme)
5790 {
5791 m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
5792 if (p.IsChildAgent)
5793 continue;
5794 ControllingClient.SendAvatarDataImmediate(p);
5795 p.SendAppearanceToAgent(this);
5796 p.SendAttachmentsToClient(ControllingClient);
5797 if (p.Animator != null)
5798 p.Animator.SendAnimPackToClient(ControllingClient);
5799 } 5676 }
5800 } 5677 }
5801*/
5802 } 5678 }
5803
5804 5679
5805 public void parcelRegionCross() 5680 public void parcelRegionCross()
5806 { 5681 {
5807 if (!ParcelHideThisAvatar || GodLevel >= 200) 5682 if (!ParcelHideThisAvatar || IsChildAgent || GodLevel >= 200)
5808 return; 5683 return;
5809 5684
5810 List<ScenePresence> allpresences = null; 5685 List<ScenePresence> allpresences = null;
5811 allpresences = m_scene.GetScenePresences(); 5686 allpresences = m_scene.GetScenePresences();
5812 5687
5813 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5814
5815 foreach (ScenePresence p in allpresences) 5688 foreach (ScenePresence p in allpresences)
5816 { 5689 {
5817 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) 5690 if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive)
5818 continue; 5691 continue;
5819 5692
5820 if (p.currentParcelUUID == m_currentParcelUUID) 5693 if (p.currentParcelUUID == m_currentParcelUUID)
5821 { 5694 {
5822 killsToSendme.Add(p);
5823 }
5824 }
5825
5826 if (killsToSendme.Count > 0)
5827 {
5828 foreach (ScenePresence p in killsToSendme)
5829 p.SendKillTo(this); 5695 p.SendKillTo(this);
5830// try 5696 }
5831// {
5832// ControllingClient.SendKillObject(killsToSendme);
5833// }
5834// catch (NullReferenceException) { }
5835 } 5697 }
5836 } 5698 }
5837 5699
@@ -5844,10 +5706,7 @@ namespace OpenSim.Region.Framework.Scenes
5844 List<ScenePresence> viewsToSendme = new List<ScenePresence>(); 5706 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5845 List<ScenePresence> allpresences = null; 5707 List<ScenePresence> allpresences = null;
5846 5708
5847 if (IsInTransit) 5709 if (IsInTransit || IsChildAgent)
5848 return;
5849
5850 if (IsChildAgent)
5851 return; 5710 return;
5852 5711
5853 if (check) 5712 if (check)
@@ -5973,17 +5832,13 @@ namespace OpenSim.Region.Framework.Scenes
5973 } 5832 }
5974 5833
5975 // send the things 5834 // send the things
5976 // kill main avatar object 5835
5977 if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc) 5836 if (killsToSendto.Count > 0)
5978 { 5837 {
5979 foreach (ScenePresence p in killsToSendto) 5838 foreach (ScenePresence p in killsToSendto)
5980 { 5839 {
5981
5982 m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); 5840 m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
5983
5984 SendKillTo(p); 5841 SendKillTo(p);
5985// try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
5986// catch (NullReferenceException) { }
5987 } 5842 }
5988 } 5843 }
5989 5844
@@ -5992,23 +5847,17 @@ namespace OpenSim.Region.Framework.Scenes
5992 m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); 5847 m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString());
5993 5848
5994 foreach (ScenePresence p in killsToSendme) 5849 foreach (ScenePresence p in killsToSendme)
5995 try
5996 { 5850 {
5851 m_log.Debug("[AVATAR]: killToMe: " + Lastname + " " + p.Lastname);
5997 p.SendKillTo(this); 5852 p.SendKillTo(this);
5998 } 5853 }
5999 catch (NullReferenceException) { }
6000
6001 } 5854 }
6002 5855
6003 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) 5856 if (viewsToSendto.Count > 0)
6004 { 5857 {
6005 foreach (ScenePresence p in viewsToSendto) 5858 foreach (ScenePresence p in viewsToSendto)
6006 { 5859 {
6007 SendAvatarDataToAgentNF(p); 5860 SendViewTo(p);
6008 SendAppearanceToAgent(p);
6009 if (Animator != null)
6010 Animator.SendAnimPackToClient(p.ControllingClient);
6011 SendAttachmentsToAgentNF(p);
6012 } 5861 }
6013 } 5862 }
6014 5863
@@ -6019,12 +5868,7 @@ namespace OpenSim.Region.Framework.Scenes
6019 if (p.IsChildAgent) 5868 if (p.IsChildAgent)
6020 continue; 5869 continue;
6021// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); 5870// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
6022 5871 p.SendViewTo(this);
6023 p.SendAvatarDataToAgentNF(this);
6024 p.SendAppearanceToAgent(this);
6025 if (p.Animator != null)
6026 p.Animator.SendAnimPackToClient(ControllingClient);
6027 p.SendAttachmentsToAgentNF(this);
6028 } 5872 }
6029 } 5873 }
6030 } 5874 }
@@ -6035,5 +5879,14 @@ namespace OpenSim.Region.Framework.Scenes
6035 p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); 5879 p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1);
6036 p.ControllingClient.SendKillObject(new List<uint> { LocalId }); 5880 p.ControllingClient.SendKillObject(new List<uint> { LocalId });
6037 } 5881 }
5882
5883 public void SendViewTo(ScenePresence p)
5884 {
5885 SendAvatarDataToAgentNF(p);
5886 SendAppearanceToAgent(p);
5887 if (Animator != null)
5888 Animator.SendAnimPackToClient(p.ControllingClient);
5889 SendAttachmentsToAgentNF(p);
5890 }
6038 } 5891 }
6039} 5892}