private void ReleaseControls() { if (m_Part != null) { bool found; int permsMask; UUID permsGranter; try { permsGranter = m_Part.TaskInventory[m_ItemID].PermsGranter; permsMask = m_Part.TaskInventory[m_ItemID].PermsMask; found = true; } catch { permsGranter = UUID.Zero; permsMask = 0; found = false; } if (found && ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)) { ScenePresence presence = m_Engine.World.GetScenePresence(permsGranter); if (presence != null) { presence.UnRegisterControlEventsToScript(m_LocalID, m_ItemID); } } } }
private void ReleaseControls() { int permsMask; UUID permsGranter; TaskInventoryItem item; if (!Part.TaskInventory.TryGetValue(ItemID, out item)) { return; } lock (item) { permsGranter = item.PermsGranter; permsMask = item.PermsMask; } if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0) { ScenePresence presence = Engine.World.GetScenePresence(permsGranter); if (presence != null) { presence.UnRegisterControlEventsToScript(LocalID, ItemID); } } }
private void ReleaseControls() { SceneObjectPart part = Engine.World.GetSceneObjectPart(LocalID); if (part != null) { int permsMask; UUID permsGranter; lock (part.TaskInventory) { if (!part.TaskInventory.ContainsKey(ItemID)) { return; } permsGranter = part.TaskInventory[ItemID].PermsGranter; permsMask = part.TaskInventory[ItemID].PermsMask; } if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0) { ScenePresence presence = Engine.World.GetScenePresence(permsGranter); if (presence != null) { presence.UnRegisterControlEventsToScript(LocalID, ItemID); } } } }
private void ReleaseControlsOrPermissions(bool fullPermissions) { if (m_Part != null && m_Part.TaskInventory != null) { int permsMask; UUID permsGranter; m_Part.TaskInventory.LockItemsForWrite(true); if (!m_Part.TaskInventory.TryGetValue(m_ItemID, out TaskInventoryItem item)) { m_Part.TaskInventory.LockItemsForWrite(false); return; } permsGranter = item.PermsGranter; permsMask = item.PermsMask; if (fullPermissions) { item.PermsGranter = UUID.Zero; item.PermsMask = 0; } else { item.PermsMask = permsMask & ~(ScriptBaseClass.PERMISSION_TAKE_CONTROLS | ScriptBaseClass.PERMISSION_CONTROL_CAMERA); } m_Part.TaskInventory.LockItemsForWrite(false); if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0) { ScenePresence presence = m_Engine.World.GetScenePresence(permsGranter); if (presence != null) { presence.UnRegisterControlEventsToScript(m_LocalID, m_ItemID); } } } }