TriggerParcelPrimCountTainted() public method

public TriggerParcelPrimCountTainted ( ) : void
return void
コード例 #1
0
        /// <summary>
        /// Handle the deselection of a prim from the client.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (part == null)
            {
                return;
            }

            bool oldgprSelect = part.ParentGroup.IsSelected;

            part.IsSelected = false;

            if (oldgprSelect != part.ParentGroup.IsSelected)
            {
                if (!part.ParentGroup.IsAttachment)
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }
            }

            // restore targetOmega
            if (part.AngularVelocity != Vector3.Zero)
            {
                part.ScheduleTerseUpdate();
            }
        }
コード例 #2
0
        /// <summary>
        /// Invoked when the client selects a prim.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectGroup group = m_sceneGraph.GetGroupByPrim(primLocalID);

            if (group == null)
            {
                return;
            }

            if (group.LocalId == primLocalID)
            {
                group.GetProperties(remoteClient);
                group.IsSelected = true;

                // A prim is only tainted if it's allowed to be edited by the person clicking it.
                if (Permissions.CanEditObject(group.UUID, remoteClient.AgentId, 0) ||
                    Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }
            }
            else
            {
                //it's one of the child prims
                SceneObjectPart part = group.GetChildPart(primLocalID);
                part.GetProperties(remoteClient);
            }
        }
コード例 #3
0
        /// <summary>
        /// Handle the update of an object's user group.
        /// </summary>
        /// <param name="remoteClient"></param>
        /// <param name="groupID"></param>
        /// <param name="objectLocalID"></param>
        /// <param name="Garbage"></param>
        private void HandleObjectGroupUpdate(
            IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage)
        {
            if (m_groupsModule == null)
            {
                return;
            }

            // XXX: Might be better to get rid of this special casing and have GetMembershipData return something
            // reasonable for a UUID.Zero group.
            if (groupID != UUID.Zero)
            {
                GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId);

                if (gmd == null)
                {
//                    m_log.WarnFormat(
//                        "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
//                        remoteClient.Name, GroupID, objectLocalID);

                    return;
                }
            }

            SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);

            if (so != null)
            {
                if (so.OwnerID == remoteClient.AgentId)
                {
                    so.SetGroup(groupID, remoteClient);
                    EventManager.TriggerParcelPrimCountTainted();
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// Invoked when the client selects a prim.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (null == part)
            {
                return;
            }

            if (part.IsRoot)
            {
                SceneObjectGroup sog = part.ParentGroup;
                sog.SendPropertiesToClient(remoteClient);
                sog.IsSelected = true;

                // A prim is only tainted if it's allowed to be edited by the person clicking it.
                if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) ||
                    Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }
            }
            else
            {
                part.SendPropertiesToClient(remoteClient);
            }
        }
コード例 #5
0
        /// <summary>
        /// Handle the deselection of a prim from the client.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (part == null)
            {
                return;
            }

            bool oldgprSelect = part.ParentGroup.IsSelected;

            // This is wrong, wrong, wrong. Selection should not be
            // handled by group, but by prim. Legacy cruft.
            // TODO: Make selection flagging per prim!
            //
            if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent))
            {
                part.IsSelected = false;
                if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected)
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }

                // restore targetOmega
                if (part.AngularVelocity != Vector3.Zero)
                {
                    part.ScheduleTerseUpdate();
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// Invoked when the client selects a prim.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void SelectPrim(List <uint> primIDs, IClientAPI remoteClient)
        {
            foreach (uint primLocalID in primIDs)
            {
                SceneObjectPart part = GetSceneObjectPart(primLocalID);

                if (part == null)
                {
                    continue;
                }

                SceneObjectGroup sog = part.ParentGroup;
                if (sog == null)
                {
                    continue;
                }

                // waste of time because properties do not send prim flags as they should
                // if a friend got or lost edit rights after login, a full update is needed
                if (sog.OwnerID != remoteClient.AgentId)
                {
                    part.SendFullUpdate(remoteClient);
                }

                // A prim is only tainted if it's allowed to be edited by the person clicking it.
                if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) ||
                    Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
                {
                    part.IsSelected = true;
                    EventManager.TriggerParcelPrimCountTainted();
                }

                part.SendPropertiesToClient(remoteClient);
            }
        }
コード例 #7
0
        /// <summary>
        /// Invoked when the client selects a prim.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            /*
             *          SceneObjectPart part = GetSceneObjectPart(primLocalID);
             *
             *          if (null == part)
             *              return;
             *
             *          if (part.IsRoot)
             *          {
             *              SceneObjectGroup sog = part.ParentGroup;
             *              sog.SendPropertiesToClient(remoteClient);
             *
             *              // A prim is only tainted if it's allowed to be edited by the person clicking it.
             *              if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
             || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
             ||             {
             ||                 sog.IsSelected = true;
             ||                 EventManager.TriggerParcelPrimCountTainted();
             ||             }
             ||         }
             ||         else
             ||         {
             ||              part.SendPropertiesToClient(remoteClient);
             ||         }
             */
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (null == part)
            {
                return;
            }

            SceneObjectGroup sog = part.ParentGroup;

            if (sog == null)
            {
                return;
            }

            part.SendPropertiesToClient(remoteClient);

            // waste of time because properties do not send prim flags as they should
            // if a friend got or lost edit rights after login, a full update is needed
            if (sog.OwnerID != remoteClient.AgentId)
            {
                part.SendFullUpdate(remoteClient);
            }

            // A prim is only tainted if it's allowed to be edited by the person clicking it.
            if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) ||
                Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
            {
                part.IsSelected = true;
                EventManager.TriggerParcelPrimCountTainted();
            }
        }
コード例 #8
0
        /// <summary>
        /// Handle the deselection of a prim from the client.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (part == null)
            {
                return;
            }

            // The prim is in the process of being deleted.
            if (null == part.ParentGroup.RootPart)
            {
                return;
            }

            // A deselect packet contains all the local prims being deselected.  However, since selection is still
            // group based we only want the root prim to trigger a full update - otherwise on objects with many prims
            // we end up sending many duplicate ObjectUpdates
            if (part.ParentGroup.RootPart.LocalId != part.LocalId)
            {
                return;
            }

            bool isAttachment = false;

            // This is wrong, wrong, wrong. Selection should not be
            // handled by group, but by prim. Legacy cruft.
            // TODO: Make selection flagging per prim!
            //
            part.ParentGroup.IsSelected = false;

            if (part.ParentGroup.IsAttachment)
            {
                isAttachment = true;
            }
            else
            {
                part.ParentGroup.ScheduleGroupForFullUpdate();
            }

            // If it's not an attachment, and we are allowed to move it,
            // then we might have done so. If we moved across a parcel
            // boundary, we will need to recount prims on the parcels.
            // For attachments, that makes no sense.
            //
            if (!isAttachment)
            {
                if (Permissions.CanEditObject(
                        part.UUID, remoteClient.AgentId) ||
                    Permissions.CanMoveObject(
                        part.UUID, remoteClient.AgentId))
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// Invoked when the client selects a prim.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            EntityBase[] entityList = GetEntities();
            foreach (EntityBase ent in entityList)
            {
                if (ent is SceneObjectGroup)
                {
                    if (((SceneObjectGroup)ent).LocalId == primLocalID)
                    {
                        ((SceneObjectGroup)ent).GetProperties(remoteClient);
                        ((SceneObjectGroup)ent).IsSelected = true;
                        // A prim is only tainted if it's allowed to be edited by the person clicking it.
                        if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) ||
                            Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
                        {
                            EventManager.TriggerParcelPrimCountTainted();
                        }
                        break;
                    }
                    else
                    {
                        // We also need to check the children of this prim as they
                        // can be selected as well and send property information
                        bool foundPrim = false;

                        SceneObjectGroup sog = ent as SceneObjectGroup;

                        SceneObjectPart[] partList = sog.Parts;
                        foreach (SceneObjectPart part in partList)
                        {
                            if (part.LocalId == primLocalID)
                            {
                                part.GetProperties(remoteClient);
                                foundPrim = true;
                                break;
                            }
                        }

                        if (foundPrim)
                        {
                            break;
                        }
                    }
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// Handle the deselection of a prim from the client.
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="remoteClient"></param>
        public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
        {
            SceneObjectPart part = GetSceneObjectPart(primLocalID);

            if (part == null)
            {
                return;
            }

            /*
             *         // A deselect packet contains all the local prims being deselected.  However, since selection is still
             *         // group based we only want the root prim to trigger a full update - otherwise on objects with many prims
             *         // we end up sending many duplicate ObjectUpdates
             *         if (part.ParentGroup.RootPart.LocalId != part.LocalId)
             *             return;
             *
             *         // This is wrong, wrong, wrong. Selection should not be
             *         // handled by group, but by prim. Legacy cruft.
             *         // TODO: Make selection flagging per prim!
             *         //
             *         if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)
             || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
             ||            part.ParentGroup.IsSelected = false;
             ||
             ||        part.ParentGroup.ScheduleGroupForFullUpdate();
             ||
             ||        // If it's not an attachment, and we are allowed to move it,
             ||        // then we might have done so. If we moved across a parcel
             ||        // boundary, we will need to recount prims on the parcels.
             ||        // For attachments, that makes no sense.
             ||        //
             ||        if (!part.ParentGroup.IsAttachment)
             ||        {
             ||            if (Permissions.CanEditObject(
             ||                    part.UUID, remoteClient.AgentId)
             || Permissions.CanMoveObject(
             ||                    part.UUID, remoteClient.AgentId))
             ||                EventManager.TriggerParcelPrimCountTainted();
             ||        }
             */

            bool oldgprSelect = part.ParentGroup.IsSelected;

            // This is wrong, wrong, wrong. Selection should not be
            // handled by group, but by prim. Legacy cruft.
            // TODO: Make selection flagging per prim!
            //
            if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) ||
                Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
            {
                part.IsSelected = false;
                if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected)
                {
                    EventManager.TriggerParcelPrimCountTainted();
                }

                // restore targetOmega
                if (part.AngularVelocity != Vector3.Zero)
                {
                    part.ScheduleTerseUpdate();
                }
            }
        }