diff options
author | UbitUmarov | 2017-01-17 23:22:02 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-17 23:22:02 +0000 |
commit | 6d784f63060940bd82a2be776385abd40901f57c (patch) | |
tree | c4d98d5348737d6282408b8d88fc9c66ea082ca0 /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Permissions module: add GetObjectPermissions() that should replace GenericObj... (diff) | |
download | opensim-SC_OLD-6d784f63060940bd82a2be776385abd40901f57c.zip opensim-SC_OLD-6d784f63060940bd82a2be776385abd40901f57c.tar.gz opensim-SC_OLD-6d784f63060940bd82a2be776385abd40901f57c.tar.bz2 opensim-SC_OLD-6d784f63060940bd82a2be776385abd40901f57c.tar.xz |
Permissions module: GenerateClientFlags() no need to keep looking for the same part several times; fix locked mask in GetObjectPermissions()
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 8ba1ba3..7455dea 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -5731,28 +5731,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5731 | } | 5731 | } |
5732 | 5732 | ||
5733 | // protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SceneObjectPart data, UUID recipientID) | 5733 | // protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SceneObjectPart data, UUID recipientID) |
5734 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SceneObjectPart data, ScenePresence sp) | 5734 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SceneObjectPart part, ScenePresence sp) |
5735 | { | 5735 | { |
5736 | byte[] objectData = new byte[60]; | 5736 | byte[] objectData = new byte[60]; |
5737 | data.RelativePosition.ToBytes(objectData, 0); | 5737 | part.RelativePosition.ToBytes(objectData, 0); |
5738 | data.Velocity.ToBytes(objectData, 12); | 5738 | part.Velocity.ToBytes(objectData, 12); |
5739 | data.Acceleration.ToBytes(objectData, 24); | 5739 | part.Acceleration.ToBytes(objectData, 24); |
5740 | 5740 | ||
5741 | Quaternion rotation = data.RotationOffset; | 5741 | Quaternion rotation = part.RotationOffset; |
5742 | rotation.Normalize(); | 5742 | rotation.Normalize(); |
5743 | rotation.ToBytes(objectData, 36); | 5743 | rotation.ToBytes(objectData, 36); |
5744 | data.AngularVelocity.ToBytes(objectData, 48); | 5744 | part.AngularVelocity.ToBytes(objectData, 48); |
5745 | 5745 | ||
5746 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); | 5746 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); |
5747 | update.ClickAction = (byte)data.ClickAction; | 5747 | update.ClickAction = (byte)part.ClickAction; |
5748 | update.CRC = 0; | 5748 | update.CRC = 0; |
5749 | update.ExtraParams = data.Shape.ExtraParams ?? Utils.EmptyBytes; | 5749 | update.ExtraParams = part.Shape.ExtraParams ?? Utils.EmptyBytes; |
5750 | update.FullID = data.UUID; | 5750 | update.FullID = part.UUID; |
5751 | update.ID = data.LocalId; | 5751 | update.ID = part.LocalId; |
5752 | //update.JointAxisOrAnchor = Vector3.Zero; // These are deprecated | 5752 | //update.JointAxisOrAnchor = Vector3.Zero; // These are deprecated |
5753 | //update.JointPivot = Vector3.Zero; | 5753 | //update.JointPivot = Vector3.Zero; |
5754 | //update.JointType = 0; | 5754 | //update.JointType = 0; |
5755 | update.Material = data.Material; | 5755 | update.Material = part.Material; |
5756 | update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim | 5756 | update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim |
5757 | /* | 5757 | /* |
5758 | if (data.ParentGroup.IsAttachment) | 5758 | if (data.ParentGroup.IsAttachment) |
@@ -5781,68 +5781,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5781 | } | 5781 | } |
5782 | */ | 5782 | */ |
5783 | 5783 | ||
5784 | if (data.ParentGroup.IsAttachment) | 5784 | if (part.ParentGroup.IsAttachment) |
5785 | { | 5785 | { |
5786 | if (data.IsRoot) | 5786 | if (part.IsRoot) |
5787 | { | 5787 | { |
5788 | update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID); | 5788 | update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + part.ParentGroup.FromItemID); |
5789 | } | 5789 | } |
5790 | else | 5790 | else |
5791 | update.NameValue = Utils.EmptyBytes; | 5791 | update.NameValue = Utils.EmptyBytes; |
5792 | 5792 | ||
5793 | int st = (int)data.ParentGroup.AttachmentPoint; | 5793 | int st = (int)part.ParentGroup.AttachmentPoint; |
5794 | update.State = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ; | 5794 | update.State = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ; |
5795 | } | 5795 | } |
5796 | else | 5796 | else |
5797 | { | 5797 | { |
5798 | update.NameValue = Utils.EmptyBytes; | 5798 | update.NameValue = Utils.EmptyBytes; |
5799 | update.State = data.Shape.State; // not sure about this | 5799 | update.State = part.Shape.State; // not sure about this |
5800 | } | 5800 | } |
5801 | 5801 | ||
5802 | 5802 | ||
5803 | update.ObjectData = objectData; | 5803 | update.ObjectData = objectData; |
5804 | update.ParentID = data.ParentID; | 5804 | update.ParentID = part.ParentID; |
5805 | update.PathBegin = data.Shape.PathBegin; | 5805 | update.PathBegin = part.Shape.PathBegin; |
5806 | update.PathCurve = data.Shape.PathCurve; | 5806 | update.PathCurve = part.Shape.PathCurve; |
5807 | update.PathEnd = data.Shape.PathEnd; | 5807 | update.PathEnd = part.Shape.PathEnd; |
5808 | update.PathRadiusOffset = data.Shape.PathRadiusOffset; | 5808 | update.PathRadiusOffset = part.Shape.PathRadiusOffset; |
5809 | update.PathRevolutions = data.Shape.PathRevolutions; | 5809 | update.PathRevolutions = part.Shape.PathRevolutions; |
5810 | update.PathScaleX = data.Shape.PathScaleX; | 5810 | update.PathScaleX = part.Shape.PathScaleX; |
5811 | update.PathScaleY = data.Shape.PathScaleY; | 5811 | update.PathScaleY = part.Shape.PathScaleY; |
5812 | update.PathShearX = data.Shape.PathShearX; | 5812 | update.PathShearX = part.Shape.PathShearX; |
5813 | update.PathShearY = data.Shape.PathShearY; | 5813 | update.PathShearY = part.Shape.PathShearY; |
5814 | update.PathSkew = data.Shape.PathSkew; | 5814 | update.PathSkew = part.Shape.PathSkew; |
5815 | update.PathTaperX = data.Shape.PathTaperX; | 5815 | update.PathTaperX = part.Shape.PathTaperX; |
5816 | update.PathTaperY = data.Shape.PathTaperY; | 5816 | update.PathTaperY = part.Shape.PathTaperY; |
5817 | update.PathTwist = data.Shape.PathTwist; | 5817 | update.PathTwist = part.Shape.PathTwist; |
5818 | update.PathTwistBegin = data.Shape.PathTwistBegin; | 5818 | update.PathTwistBegin = part.Shape.PathTwistBegin; |
5819 | update.PCode = data.Shape.PCode; | 5819 | update.PCode = part.Shape.PCode; |
5820 | update.ProfileBegin = data.Shape.ProfileBegin; | 5820 | update.ProfileBegin = part.Shape.ProfileBegin; |
5821 | update.ProfileCurve = data.Shape.ProfileCurve; | 5821 | update.ProfileCurve = part.Shape.ProfileCurve; |
5822 | update.ProfileEnd = data.Shape.ProfileEnd; | 5822 | update.ProfileEnd = part.Shape.ProfileEnd; |
5823 | update.ProfileHollow = data.Shape.ProfileHollow; | 5823 | update.ProfileHollow = part.Shape.ProfileHollow; |
5824 | update.PSBlock = data.ParticleSystem ?? Utils.EmptyBytes; | 5824 | update.PSBlock = part.ParticleSystem ?? Utils.EmptyBytes; |
5825 | update.TextColor = data.GetTextColor().GetBytes(false); | 5825 | update.TextColor = part.GetTextColor().GetBytes(false); |
5826 | update.TextureAnim = data.TextureAnimation ?? Utils.EmptyBytes; | 5826 | update.TextureAnim = part.TextureAnimation ?? Utils.EmptyBytes; |
5827 | update.TextureEntry = data.Shape.TextureEntry ?? Utils.EmptyBytes; | 5827 | update.TextureEntry = part.Shape.TextureEntry ?? Utils.EmptyBytes; |
5828 | update.Scale = data.Shape.Scale; | 5828 | update.Scale = part.Shape.Scale; |
5829 | update.Text = Util.StringToBytes256(data.Text); | 5829 | update.Text = Util.StringToBytes256(part.Text); |
5830 | update.MediaURL = Util.StringToBytes256(data.MediaUrl); | 5830 | update.MediaURL = Util.StringToBytes256(part.MediaUrl); |
5831 | 5831 | ||
5832 | #region PrimFlags | 5832 | #region PrimFlags |
5833 | 5833 | ||
5834 | PrimFlags flags = (PrimFlags)m_scene.Permissions.GenerateClientFlags(sp, data.UUID); | 5834 | PrimFlags flags = (PrimFlags)m_scene.Permissions.GenerateClientFlags(part, sp); |
5835 | 5835 | ||
5836 | // Don't send the CreateSelected flag to everyone | 5836 | // Don't send the CreateSelected flag to everyone |
5837 | flags &= ~PrimFlags.CreateSelected; | 5837 | flags &= ~PrimFlags.CreateSelected; |
5838 | 5838 | ||
5839 | if (sp.UUID == data.OwnerID) | 5839 | if (sp.UUID == part.OwnerID) |
5840 | { | 5840 | { |
5841 | if (data.CreateSelected) | 5841 | if (part.CreateSelected) |
5842 | { | 5842 | { |
5843 | // Only send this flag once, then unset it | 5843 | // Only send this flag once, then unset it |
5844 | flags |= PrimFlags.CreateSelected; | 5844 | flags |= PrimFlags.CreateSelected; |
5845 | data.CreateSelected = false; | 5845 | part.CreateSelected = false; |
5846 | } | 5846 | } |
5847 | } | 5847 | } |
5848 | 5848 | ||
@@ -5854,21 +5854,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5854 | 5854 | ||
5855 | #endregion PrimFlags | 5855 | #endregion PrimFlags |
5856 | 5856 | ||
5857 | if (data.Sound != UUID.Zero) | 5857 | if (part.Sound != UUID.Zero) |
5858 | { | 5858 | { |
5859 | update.Sound = data.Sound; | 5859 | update.Sound = part.Sound; |
5860 | update.OwnerID = data.OwnerID; | 5860 | update.OwnerID = part.OwnerID; |
5861 | update.Gain = (float)data.SoundGain; | 5861 | update.Gain = (float)part.SoundGain; |
5862 | update.Radius = (float)data.SoundRadius; | 5862 | update.Radius = (float)part.SoundRadius; |
5863 | update.Flags = data.SoundFlags; | 5863 | update.Flags = part.SoundFlags; |
5864 | } | 5864 | } |
5865 | 5865 | ||
5866 | switch ((PCode)data.Shape.PCode) | 5866 | switch ((PCode)part.Shape.PCode) |
5867 | { | 5867 | { |
5868 | case PCode.Grass: | 5868 | case PCode.Grass: |
5869 | case PCode.Tree: | 5869 | case PCode.Tree: |
5870 | case PCode.NewTree: | 5870 | case PCode.NewTree: |
5871 | update.Data = new byte[] { data.Shape.State }; | 5871 | update.Data = new byte[] { part.Shape.State }; |
5872 | break; | 5872 | break; |
5873 | default: | 5873 | default: |
5874 | update.Data = Utils.EmptyBytes; | 5874 | update.Data = Utils.EmptyBytes; |