本文整理汇总了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;
}
示例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);
}
}
}