/// <summary> /// Rez an object from inventory /// </summary> /// <param name="simulator">Simulator to place object in</param> /// <param name="rotation">Rotation of the object when rezzed</param> /// <param name="position">Vector of where to place object</param> /// <param name="item">InventoryObject object containing item details</param> /// <param name="groupOwner">Guid of group to own the object</param> /// <param name="queryID">User defined queryID to correlate replies</param> /// <param name="requestObjectDetails">if set to true the simulator /// will automatically send object detail packet(s) back to the client</param> public Guid RequestRezFromInventory(Simulator simulator, Quaternionf rotation, Vector3f position, InventoryObject item, Guid groupOwner, Guid queryID, bool requestObjectDetails) { RezObjectPacket add = new RezObjectPacket(); add.AgentData.AgentID = _Client.Self.AgentID; add.AgentData.SessionID = _Client.Self.SessionID; add.AgentData.GroupID = groupOwner; add.RezData.FromTaskID = Guid.Empty; add.RezData.BypassRaycast = 1; add.RezData.RayStart = position; add.RezData.RayEnd = position; add.RezData.RayTargetID = Guid.Empty; add.RezData.RayEndIsIntersection = false; add.RezData.RezSelected = requestObjectDetails; add.RezData.RemoveItem = false; add.RezData.ItemFlags = (uint)item.Flags; add.RezData.GroupMask = (uint)item.Permissions.GroupMask; add.RezData.EveryoneMask = (uint)item.Permissions.EveryoneMask; add.RezData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask; add.InventoryData.ItemID = item.Guid; add.InventoryData.FolderID = item.ParentGuid; add.InventoryData.CreatorID = item.CreatorID; add.InventoryData.OwnerID = item.OwnerID; add.InventoryData.GroupID = item.GroupID; add.InventoryData.BaseMask = (uint)item.Permissions.BaseMask; add.InventoryData.OwnerMask = (uint)item.Permissions.OwnerMask; add.InventoryData.GroupMask = (uint)item.Permissions.GroupMask; add.InventoryData.EveryoneMask = (uint)item.Permissions.EveryoneMask; add.InventoryData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask; add.InventoryData.GroupOwned = item.GroupOwned; add.InventoryData.TransactionID = queryID; add.InventoryData.Type = (sbyte)item.InventoryType; add.InventoryData.InvType = (sbyte)item.InventoryType; add.InventoryData.Flags = (uint)item.Flags; add.InventoryData.SaleType = (byte)item.SaleType; add.InventoryData.SalePrice = item.SalePrice; add.InventoryData.Name = Utils.StringToBytes(item.Name); add.InventoryData.Description = Utils.StringToBytes(item.Description); add.InventoryData.CreationDate = (int)Utils.DateTimeToUnixTime(item.CreationDate); _Client.Network.SendPacket(add, simulator); return queryID; }
/// <summary> /// Rez an object from inventory /// </summary> /// <param name="simulator">Simulator to place object in</param> /// <param name="rotation">Rotation of the object when rezzed</param> /// <param name="position">Vector of where to place object</param> /// <param name="item">InventoryObject object containing item details</param> /// <param name="groupOwner">Guid of group to own the object</param> public Guid RequestRezFromInventory(Simulator simulator, Quaternionf rotation, Vector3f position, InventoryObject item, Guid groupOwner) { return RequestRezFromInventory(simulator, rotation, position, item, groupOwner, Guid.NewGuid(), false); }
/// <summary> /// Rez an object from inventory /// </summary> /// <param name="simulator">Simulator to place object in</param> /// <param name="rotation">Rotation of the object when rezzed</param> /// <param name="position">Vector of where to place object</param> /// <param name="item">InventoryObject object containing item details</param> public Guid RequestRezFromInventory(Simulator simulator, Quaternionf rotation, Vector3f position, InventoryObject item) { return RequestRezFromInventory(simulator, rotation, position, item, _Client.Self.ActiveGroup, Guid.NewGuid(), false); }
internal void UnpackTaskObject(ImportSettings arglist, InventoryObject invObject, OutputDelegate Failure, bool dotaskobj, out UUID newAssetID) { var Incremental = Exporting.Incremental; var showsMissingOnly = Exporting.showsMissingOnly; var itemID = invObject.UUID; string exportFile = ExportCommand.dumpDir + OldAssetID + ".object"; string taskObjFile = ExportCommand.dumpDir + itemID + ".taskobj"; string repackFile = ExportCommand.dumpDir + itemID + ".repack"; foreach (string file in new[] {exportFile, taskObjFile, repackFile}) { if (Incremental || showsMissingOnly) { if (File.Exists(file)) { missing = false; string[] conts = File.ReadAllText(taskObjFile).Split(','); newAssetID = UUID.Parse(conts[2]); return; } } } newAssetID = OldAssetID; if (showsMissingOnly || !dotaskobj) { Exporting.needFiles++; Failure("NEED TASKOBJ: " + this); missing = true; return; } UUID newItemID = UUID.Zero; if (File.Exists(repackFile)) { string[] conts = File.ReadAllText(repackFile).Split(','); OldAssetID = newAssetID = UUID.Parse(conts[2]); PostRezzed(); return; } if (TaskRezzedO == null) { //UUID objectID = UUID.Zero; if (NoCopyItem) { var exportPrim = HolderPrim.Rezed; PermissionWho pwo = Importing.TheSimAvatar.EffectivePermissionWho(exportPrim); PermissionMask pmo = CogbotHelpers.PermMaskForWho(pwo, exportPrim.Properties.Permissions); bool canModifyObject = Permissions.HasPermissions(pmo, PermissionMask.Modify); if (!canModifyObject && !Exporting.settings.Contains("nctaskobjs")) { missing = true; Failure("Cant modify object to borrow out the nocopy object " + this); return; } } if (CogbotHelpers.IsNullOrZero(OldAssetID)) { EnsureAgentItem(); if (AgentItem == null) { EnsureAgentItem(); if (AgentItem == null) { Failure("Cant get agent Item"); return; } } if (!Exporting.settings.Contains("reztaskobjs") /*|| CreatedPrim.OldID.ToString() != "8a11c67d-edd3-d0b9-b4ec-c4e8f13f6875"*/) { RFailure("Use reztaskobjs for " + this); return; } Client.Objects.ObjectProperties += rezedInWorld; Error = "Awaiting Attach"; lock (Importing.ExportHolder) Importing.ExportHolder.Add(HolderPrim.OldID); Client.Appearance.Attach(AgentItem, invObject.AttachPoint, true); bool success = rezedEvent.WaitOne(TimeSpan.FromMinutes(1)); Client.Objects.ObjectProperties -= rezedInWorld; newAssetID = OldAssetID; if (!success) { missing = true; Failure("CANT ATTACH taskinv object " + this); if (NoCopyItem) { //Move back from Personal Inventory to TaskInv if (AgentItem != null) { var exportPrim = HolderPrim.Rezed; Client.Inventory.UpdateTaskInventory(exportPrim.LocalID, AgentItem); return; } else { Failure("Couldnt find it " + this); } } return; } else { missing = false; } } newAssetID = OldAssetID; TaskRezzedO = ExportCommand.GetSimObjectFromUUID(OldAssetID); } if (TaskRezzedO == null) { missing = true; Failure("Cant FIND taskinv object " + this); return; } PostRezzed(); }
/// <summary> /// Rez an object from inventory /// </summary> /// <param name="simulator">Simulator to place object in</param> /// <param name="rotation">Rotation of the object when rezzed</param> /// <param name="position">Vector of where to place object</param> /// <param name="item">InventoryObject object containing item details</param> /// <param name="groupOwner">UUID of group to own the object</param> public UUID RequestRezFromInventory(Simulator simulator, Quaternion rotation, Vector3 position, InventoryObject item, UUID groupOwner) { return RequestRezFromInventory(simulator, rotation, position, item, groupOwner, UUID.Random(), false); }
/// <summary> /// Rez an object from inventory /// </summary> /// <param name="simulator">Simulator to place object in</param> /// <param name="rotation">Rotation of the object when rezzed</param> /// <param name="position">Vector of where to place object</param> /// <param name="item">InventoryObject object containing item details</param> public UUID RequestRezFromInventory(Simulator simulator, Quaternion rotation, Vector3 position, InventoryObject item) { return RequestRezFromInventory(simulator, rotation, position, item, _Client.Self.ActiveGroup, UUID.Random(), false); }