當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneObjectPart.RemoveScriptEvents方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.RemoveScriptEvents方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneObjectPart.RemoveScriptEvents方法的具體用法?C# SceneObjectPart.RemoveScriptEvents怎麽用?C# SceneObjectPart.RemoveScriptEvents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.RemoveScriptEvents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateAgentInventoryItemFromTask

        private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
        {
            TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);

            if (null == taskItem)
            {
                m_log.ErrorFormat(
                    "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for creating an avatar"
                        + " inventory item from a prim's inventory item "
                        + " but the required item does not exist in the prim's inventory",
                    itemId, part.Name, part.UUID);

                return null;
            }

            if ((destAgent != taskItem.OwnerID) && ((taskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0))
            {
                return null;
            }

            InventoryItemBase agentItem = new InventoryItemBase();

            agentItem.ID = UUID.Random();
            agentItem.CreatorId = taskItem.CreatorID.ToString();
            agentItem.CreatorData = taskItem.CreatorData;
            agentItem.Owner = destAgent;
            agentItem.AssetID = taskItem.AssetID;
            agentItem.Description = taskItem.Description;
            agentItem.Name = taskItem.Name;
            agentItem.AssetType = taskItem.Type;
            agentItem.InvType = taskItem.InvType;
            agentItem.Flags = taskItem.Flags;

            if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
            {
                agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
                if (taskItem.InvType == (int)InventoryType.Object)
                {
                    uint perms = taskItem.CurrentPermissions;
                    PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms);
                    agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
                    agentItem.CurrentPermissions = agentItem.BasePermissions;
                }
                else
                {
                    agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
                }

                agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
                agentItem.NextPermissions = taskItem.NextPermissions;
                agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
                agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
            }
            else
            {
                agentItem.BasePermissions = taskItem.BasePermissions;
                agentItem.CurrentPermissions = taskItem.CurrentPermissions;
                agentItem.NextPermissions = taskItem.NextPermissions;
                agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
                agentItem.GroupPermissions = taskItem.GroupPermissions;
            }

            if (!Permissions.BypassPermissions())
            {
                if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
                {
                    if (taskItem.Type == 10)
                    {
                        part.RemoveScriptEvents(itemId);
                        EventManager.TriggerRemoveScript(part.LocalId, itemId);
                    }

                    part.Inventory.RemoveInventoryItem(itemId);
                }
            }

            return agentItem;
        }
開發者ID:Barosonix,項目名稱:Barosonix-Core,代碼行數:78,代碼來源:Scene.Inventory.cs

示例2: RemoveNonCopyTaskItemFromPrim

        /// <summary>
        /// If the task item is not-copyable then remove it from the prim.
        /// </summary>
        private void RemoveNonCopyTaskItemFromPrim(SceneObjectPart part, UUID itemId)
        {
            TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
            if (taskItem == null)
                return;

            if (!Permissions.BypassPermissions())
            {
                if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
                {
                    if (taskItem.Type == (int)AssetType.LSLText)
                    {
                        part.RemoveScriptEvents(itemId);
                        EventManager.TriggerRemoveScript(part.LocalId, itemId);
                    }

                    part.Inventory.RemoveInventoryItem(itemId);
                }
            }
        }
開發者ID:Gitlab11,項目名稱:opensim,代碼行數:23,代碼來源:Scene.Inventory.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.RemoveScriptEvents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。