public void RequestCreateItem(LLUUID parentFolder, string name, string description, AssetType type, InventoryType invType, WearableType wearableType, PermissionMask nextOwnerMask, ItemCreatedCallback callback) { CreateInventoryItemPacket create = new CreateInventoryItemPacket(); create.AgentData.AgentID = _Client.Self.AgentID; create.AgentData.SessionID = _Client.Self.SessionID; create.InventoryBlock.CallbackID = RegisterItemCreatedCallback(callback); create.InventoryBlock.FolderID = parentFolder; create.InventoryBlock.TransactionID = LLUUID.Random(); create.InventoryBlock.NextOwnerMask = (uint)nextOwnerMask; create.InventoryBlock.Type = (sbyte)type; create.InventoryBlock.InvType = (sbyte)invType; create.InventoryBlock.WearableType = (byte)wearableType; create.InventoryBlock.Name = Helpers.StringToField(name); create.InventoryBlock.Description = Helpers.StringToField(description); _Client.Network.SendPacket(create); }
private uint RegisterItemCreatedCallback(ItemCreatedCallback callback) { lock (_CallbacksLock) { if (_CallbackPos == UInt32.MaxValue) _CallbackPos = 0; _CallbackPos++; if (_ItemCreatedCallbacks.ContainsKey(_CallbackPos)) _Client.Log("Overwriting an existing ItemCreatedCallback", Helpers.LogLevel.Warning); _ItemCreatedCallbacks[_CallbackPos] = callback; return _CallbackPos; } }
/// <summary> /// Creates inventory link to another inventory item or folder /// </summary> /// <param name="folderID">Put newly created link in folder with this UUID</param> /// <param name="itemID">Original item's UUID</param> /// <param name="name">Name</param> /// <param name="description">Description</param> /// <param name="assetType">Asset Type</param> /// <param name="invType">Inventory Type</param> /// <param name="transactionID">Transaction UUID</param> /// <param name="callback">Method to call upon creation of the link</param> public void CreateLink(UUID folderID, UUID itemID, string name, string description, AssetType assetType, InventoryType invType, UUID transactionID, ItemCreatedCallback callback) { LinkInventoryItemPacket create = new LinkInventoryItemPacket(); create.AgentData.AgentID = Client.Self.AgentID; create.AgentData.SessionID = Client.Self.SessionID; create.InventoryBlock.CallbackID = RegisterItemCreatedCallback(callback); create.InventoryBlock.FolderID = folderID; create.InventoryBlock.TransactionID = transactionID; create.InventoryBlock.OldItemID = itemID; create.InventoryBlock.Type = (sbyte)assetType; create.InventoryBlock.InvType = (sbyte)invType; create.InventoryBlock.Name = Utils.StringToBytes(name); create.InventoryBlock.Description = Utils.StringToBytes(description); Client.Network.SendPacket(create); }
public void RequestCreateItem(LLUUID parentFolder, string name, string description, AssetType type, InventoryType invType, PermissionMask nextOwnerMask, ItemCreatedCallback callback) { // Even though WearableType 0 is Shape, in this context it is treated as NOT_WEARABLE RequestCreateItem(parentFolder, name, description, type, invType, (WearableType)0, nextOwnerMask, callback); }
/// <summary> /// Creates inventory link to another inventory folder /// </summary> /// <param name="folderID">Put newly created link in folder with this UUID</param> /// <param name="folder">Original inventory folder</param> /// <param name="callback">Method to call upon creation of the link</param> public void CreateLink(UUID folderID, InventoryFolder folder, ItemCreatedCallback callback) { CreateLink(folderID, folder.UUID, folder.Name, "", AssetType.LinkFolder, InventoryType.Folder, UUID.Random(), callback); }
/// <summary> /// Creates inventory link to another inventory item /// </summary> /// <param name="folderID">Put newly created link in folder with this UUID</param> /// <param name="item">Original inventory item</param> /// <param name="callback">Method to call upon creation of the link</param> public void CreateLink(UUID folderID, InventoryItem item, ItemCreatedCallback callback) { CreateLink(folderID, item.UUID, item.Name, item.Description, AssetType.Link, item.InventoryType, UUID.Random(), callback); }
/// <summary> /// Creates inventory link to another inventory item or folder /// </summary> /// <param name="folderID">Put newly created link in folder with this UUID</param> /// <param name="bse">Inventory item or folder</param> /// <param name="callback">Method to call upon creation of the link</param> public void CreateLink(UUID folderID, InventoryBase bse, ItemCreatedCallback callback) { if (bse is InventoryFolder) { InventoryFolder folder = (InventoryFolder)bse; CreateLink(folderID, folder, callback); } else if (bse is InventoryItem) { InventoryItem item = (InventoryItem)bse; CreateLink(folderID, item.UUID, item.Name, item.Description, AssetType.Link, item.InventoryType, UUID.Random(), callback); } }
/// <summary> /// Creates a wearable inventory item referencing an asset upload. /// Second Life v1.9 uses this method to create wearable inventory items. /// </summary> /// <param name="parentFolder"></param> /// <param name="name"></param> /// <param name="description"></param> /// <param name="type"></param> /// <param name="wearableType"></param> /// <param name="invType"></param> /// <param name="nextOwnerMask"></param> /// <param name="callback"></param> /// <param name="assetTransactionID">Proper use is to upload the inventory's asset first, then provide the Asset's TransactionID here.</param> public void RequestCreateItem(UUID parentFolder, string name, string description, AssetType type, UUID assetTransactionID, InventoryType invType, WearableType wearableType, PermissionMask nextOwnerMask, ItemCreatedCallback callback) { CreateInventoryItemPacket create = new CreateInventoryItemPacket(); create.AgentData.AgentID = _Agents.AgentID; create.AgentData.SessionID = _Agents.SessionID; create.InventoryBlock.CallbackID = RegisterItemCreatedCallback(callback); create.InventoryBlock.FolderID = parentFolder; create.InventoryBlock.TransactionID = assetTransactionID; create.InventoryBlock.NextOwnerMask = (uint)nextOwnerMask; create.InventoryBlock.Type = (sbyte)type; create.InventoryBlock.InvType = (sbyte)invType; create.InventoryBlock.WearableType = (byte)wearableType; create.InventoryBlock.Name = Utils.StringToBytes(name); create.InventoryBlock.Description = Utils.StringToBytes(description); _Network.SendPacket(create); }
public void RequestCreateItem(UUID parentFolder, string name, string description, AssetType type, InventoryType invType, WearableType wearableType, PermissionMask nextOwnerMask, ItemCreatedCallback callback) { RequestCreateItem(parentFolder, name, description, type, UUID.Zero, invType, wearableType, nextOwnerMask, callback); }