/// <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); } }
/// <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); } }
/// <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.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(); } } }
/// <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); } }
/// <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(); } }
/// <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(); } } }
/// <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; } } } } }
/// <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(); } } }