Ejemplo n.º 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;

            // 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();
                }
            }
        }
Ejemplo n.º 2
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.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent))
                {
                    bool oldsel = part.IsSelected;
                    part.IsSelected = true;
                    if (!oldsel)
                    {
                        EventManager.TriggerParcelPrimCountTainted();
                    }
                }

                part.SendPropertiesToClient(remoteClient);
            }
        }