Exemplo n.º 1
0
        private static PrimInventory FromPrimObjectInventory(LLPrimitive host, PrimObject.InventoryBlock objInv)
        {
            PrimInventory inv = new PrimInventory(host);

            if (objInv == null)
            {
                return(inv);
            }

            for (int i = 0; i < objInv.Items.Length; i++)
            {
                PrimObject.InventoryBlock.ItemBlock objItem = objInv.Items[i];

                LLInventoryTaskItem item = new LLInventoryTaskItem();
                item.AssetID           = objItem.AssetID;
                item.ContentType       = LLUtil.LLAssetTypeToContentType((int)objItem.Type);
                item.CreationDate      = objItem.CreationDate;
                item.CreatorID         = objItem.CreatorID;
                item.Description       = objItem.Description;
                item.Flags             = (uint)objItem.Flags;
                item.GroupID           = objItem.GroupID;
                item.ID                = objItem.ID;
                item.Name              = objItem.Name;
                item.OwnerID           = objItem.OwnerID;
                item.Permissions       = new Permissions(objItem.PermsBase, objItem.PermsEveryone, objItem.PermsGroup, objItem.PermsNextOwner, objItem.PermsOwner);
                item.PermissionGranter = objItem.PermsGranterID;

                inv.AddOrUpdateItem(item, true);
            }

            inv.InventorySerial = (short)objInv.Serial;
            return(inv);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LLPrimitive(Primitive prim, IScene scene, IPrimMesher mesher)
        {
            Prim = prim;
            m_scene = scene;
            m_mesher = mesher;
            Inventory = new PrimInventory(this);

            if (prim.ID == UUID.Zero)
                prim.ID = UUID.Random();

            if (prim.LocalID == 0)
                prim.LocalID = m_scene.CreateLocalID();

            if (prim.ParentID != 0)
            {
                ISceneEntity parent;
                if (scene.TryGetEntity(prim.ParentID, out parent) && parent is ILinkable)
                    SetParent((ILinkable)parent, false, false);
            }

            m_lastUpdated = DateTime.UtcNow;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LLPrimitive(Primitive prim, IScene scene, IPrimMesher mesher)
        {
            Prim = prim;
            m_scene = scene;
            m_mesher = mesher;
            Inventory = new PrimInventory(this);

            if (prim.ID == UUID.Zero)
                prim.ID = UUID.Random();

            if (prim.LocalID == 0)
                prim.LocalID = m_scene.CreateLocalID();

            if (prim.ParentID != 0)
            {
                ISceneEntity parent;
                if (scene.TryGetEntity(prim.ParentID, out parent) && parent is ILinkable)
                    SetParent((ILinkable)parent, false, false);
            }

            m_lastUpdated = DateTime.UtcNow;
        }