• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# InventoryFolderBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InventoryFolderBase的典型用法代码示例。如果您正苦于以下问题:C# InventoryFolderBase类的具体用法?C# InventoryFolderBase怎么用?C# InventoryFolderBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InventoryFolderBase类属于命名空间,在下文中一共展示了InventoryFolderBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddFolder

        public virtual bool AddFolder(InventoryFolderBase folder)
        {
            object remoteValue = DoRemoteByURL("InventoryServerURI", folder);
            if (remoteValue != null || m_doRemoteOnly)
                return remoteValue == null ? false : (bool) remoteValue;

            InventoryFolderBase check = GetFolder(folder);
            if (check != null)
                return false;

            return m_Database.StoreFolder(folder);
        }
开发者ID:KSLcom,项目名称:Aurora-Sim,代码行数:12,代码来源:InventoryService.cs


示例2: ParseInventoryFolders

        private InventoryFolderBase[] ParseInventoryFolders (Dictionary<string, List<string>> retVal)
        {
            List<InventoryFolderBase> folders = new List<InventoryFolderBase> ();
            if (retVal.Count == 0)
                return folders.ToArray();
            for (int i = 0; i < retVal.ElementAt(0).Value.Count; i++)
            {
                InventoryFolderBase folder = new InventoryFolderBase ();
                folder.Name = retVal["folderName"][i];
                folder.Type = short.Parse (retVal["type"][i]);
                folder.Version = (ushort)int.Parse (retVal["version"][i]);
                folder.ID = UUID.Parse (retVal["folderID"][i]);
                folder.Owner = UUID.Parse (retVal["agentID"][i]);
                folder.ParentID = UUID.Parse (retVal["parentFolderID"][i]);
                folders.Add (folder);
            }

            return folders.ToArray ();
        }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:19,代码来源:LocalInventoryConnector.cs


示例3: PurgeFolder

        public virtual bool PurgeFolder(InventoryFolderBase folder)
        {
            if (!m_AllowDelete && !ParentIsLinkFolder(folder.ID))
                return false;

            if (!ParentIsTrash(folder.ID))
                return false;

            List<InventoryFolderBase> subFolders = m_Database.GetFolders(
                    new string[] { "parentFolderID" },
                    new string[] { folder.ID.ToString() });

            foreach (InventoryFolderBase x in subFolders)
            {
                PurgeFolder(x);
                m_Database.DeleteFolders("folderID", x.ID.ToString(), true);
            }

            m_Database.DeleteItems("parentFolderID", folder.ID.ToString());

            return true;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:22,代码来源:InventoryService.cs


示例4: PurgeFolder

        /// <summary>
        /// This method will delete all the items and folders in the given folder.
        /// </summary>
        /// If the inventory service has not yet delievered the inventory
        /// for this user then the request will be queued.
        ///
        /// <param name="folderID"></param>
        public bool PurgeFolder(UUID folderID)
        {
            //            m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
            //                folderID, remoteClient.Name, remoteClient.AgentId);

            if (m_hasReceivedInventory)
            {
                InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID);

                if (purgedFolder != null)
                {
                    // XXX Nasty - have to create a new object to hold details we already have
                    InventoryFolderBase purgedBaseFolder = new InventoryFolderBase();
                    purgedBaseFolder.Owner = purgedFolder.Owner;
                    purgedBaseFolder.ID = purgedFolder.ID;
                    purgedBaseFolder.Name = purgedFolder.Name;
                    purgedBaseFolder.ParentID = purgedFolder.ParentID;
                    purgedBaseFolder.Type = purgedFolder.Type;
                    purgedBaseFolder.Version = purgedFolder.Version;

                    m_InventoryService.PurgeFolder(purgedBaseFolder);

                    purgedFolder.Purge();

                    return true;
                }
            }
            else
            {
                AddRequest(
                    new InventoryRequest(
                        Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"),
                        new object[] { folderID }));

                return true;
            }

            return false;
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:46,代码来源:CachedUserInfo.cs


示例5: UpdateFolder

        /// <summary>
        /// Handle a client request to update the inventory folder
        /// </summary>
        ///
        /// If the inventory service has not yet delievered the inventory
        /// for this user then the request will be queued.
        ///
        /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
        /// so this will work to rename an existing folder.  Needless to say, to rely on this is very confusing,
        /// and needs to be changed.
        ///
        /// <param name="folderID"></param>
        /// <param name="type"></param>
        /// <param name="name"></param>
        /// <param name="parentID"></param>
        public bool UpdateFolder(string name, UUID folderID, ushort type, UUID parentID)
        {
            //            m_log.DebugFormat(
            //                "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);

            if (m_hasReceivedInventory)
            {
                InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
                
                // Delegate movement if updated parent id isn't the same as the existing parentId
                if (folder.ParentID != parentID)
                    MoveFolder(folderID, parentID);
                
                InventoryFolderBase baseFolder = new InventoryFolderBase();
                baseFolder.Owner = m_userProfile.ID;
                baseFolder.ID = folderID;
                baseFolder.Name = name;
                baseFolder.ParentID = parentID;
                baseFolder.Type = (short)type;
                baseFolder.Version = RootFolder.Version;

                m_InventoryService.UpdateFolder(baseFolder);

                folder.Name = name;
                folder.Type = (short)type;
            }
            else
            {
                AddRequest(
                    new InventoryRequest(
                        Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"),
                        new object[] { name, folderID, type, parentID }));
            }

            return true;
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:51,代码来源:CachedUserInfo.cs


示例6: FinishedStartup

        public void FinishedStartup()
        {
            string IARName = "DefaultInventory.iar";
            IniConfigSource iniSource = null;
            try
            {
                iniSource = new IniConfigSource("DefaultInventory/Inventory.ini", Nini.Ini.IniFileType.AuroraStyle);
            }
            catch
            {
            }
            IConfig libConfig = m_config.Configs["DefaultAssetsIARCreator"];
            if (libConfig == null)
                libConfig = iniSource.Configs["DefaultAssetsIARCreator"];
            if (libConfig != null)
            {
                if (!libConfig.GetBoolean("Enabled", false))
                    return;
                IARName = libConfig.GetString("NameOfIAR", IARName);
            }
            else
                return;
            m_service = m_registry.RequestModuleInterface<ILibraryService>();

            RegionInfo regInfo = new RegionInfo();
            IScene m_MockScene = null;
            //Make the scene for the IAR loader
            if (m_registry is IScene)
                m_MockScene = (IScene)m_registry;
            else
            {
                m_MockScene = new Scene();
                m_MockScene.Initialize(regInfo);
                m_MockScene.AddModuleInterfaces(m_registry.GetInterfaces());
            }

            UserAccount uinfo = m_MockScene.UserAccountService.GetUserAccount(null, m_service.LibraryOwner);
            //Make the user account for the default IAR
            if (uinfo == null)
            {
                uinfo = new UserAccount(m_service.LibraryOwner);
                uinfo.Name = m_service.LibraryOwnerName;
                //m_MockScene.InventoryService.CreateUserInventory(m_service.LibraryOwner, false);
                MainConsole.Instance.InfoFormat("[DefaultInventoryToIARConverter]: 1,1");
                InventoryFolderBase newFolder = new InventoryFolderBase
                                                    {
                                                    Name = "My Inventory",
                                                    Type = 9,
                                                    Version = 1,
                                                    ID = new UUID("00000112-000f-0000-0000-000100bba000"),
                                                    Owner = m_service.LibraryOwner,
                                                    ParentID = UUID.Zero
                                                    };
                MainConsole.Instance.InfoFormat("[DefaultInventoryToIARConverter]: 1,3");
            }

            MainConsole.Instance.InfoFormat("[DefaultInventoryToIARConverter]: 1,4");
            List<AssetBase> assets = new List<AssetBase> ();
            if (m_MockScene.InventoryService != null)
            {
                //Add the folders to the user's inventory
                InventoryCollection i = m_MockScene.InventoryService.GetFolderContent (m_service.LibraryOwner, UUID.Zero);
                if (i != null)
                {
                    foreach (InventoryItemBase item in i.Items)
                    {
                        AssetBase asset = m_MockScene.RequestModuleInterface<IAssetService> ().Get (item.AssetID.ToString ());
                        if (asset != null)
                            assets.Add (asset);
                    }
                }
            }
            InventoryFolderBase rootFolder = null;
            List<InventoryFolderBase> rootFolders = m_MockScene.InventoryService.GetRootFolders (m_service.LibraryOwner);
            foreach (InventoryFolderBase folder in rootFolders)
            {
                if (folder.Name == "My Inventory")
                    continue;

                rootFolder = folder;
                break;
            }
            if (rootFolder != null)
            {
                //Save the IAR of the default assets
                InventoryArchiveWriteRequest write = new InventoryArchiveWriteRequest (Guid.NewGuid (), null, m_MockScene,
                    uinfo, "/", new GZipStream (new FileStream (IARName, FileMode.Create), CompressionMode.Compress), true, rootFolder, assets);
                write.Execute ();
            }
        }
开发者ID:aurora-sim,项目名称:Aurora-Sim-Optional-Modules,代码行数:90,代码来源:DefaultInventoryToIARConverter.cs


示例7: LoadItems

 private void LoadItems(OSDMap items, UUID OwnerID, InventoryFolderBase folderForAppearance, AvatarAppearance appearance, out List<InventoryItemBase> litems)
 {
     litems = new List<InventoryItemBase>();
     foreach (KeyValuePair<string, OSD> kvp in items)
     {
         string serialization = kvp.Value.AsString();
         InventoryItemBase item = OpenSim.Framework.Serialization.External.UserInventoryItemSerializer.Deserialize(serialization);
         m_log.Info("[AvatarArchive]: Loading item " + item.ID.ToString());
         UUID oldID = item.ID;
         item = GiveInventoryItem(item.CreatorIdAsUuid, OwnerID, item, folderForAppearance);
         litems.Add(item);
         FixItemIDs(oldID, item, appearance);
     }
 }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:14,代码来源:LLLoginService.cs


示例8: LoadAvatarArchive

        public void LoadAvatarArchive(string FileName, string Name)
        {
            UserAccount account = UserAccountService.GetUserAccount(UUID.Zero, Name);
            m_log.Info("[AvatarArchive] Loading archive from " + FileName);
            if (account == null)
            {
                m_log.Error("[AvatarArchive] User not found!");
                return;
            }
            string file = "";
            if (FileName.EndsWith(".database"))
            {
                m_log.Info("[AvatarArchive] Loading archive from the database " + FileName);

                FileName = FileName.Substring(0, FileName.Length - 9);

                Aurora.Framework.IAvatarArchiverConnector avarchiver = DataManager.RequestPlugin<IAvatarArchiverConnector>();
                AvatarArchive archive = avarchiver.GetAvatarArchive(FileName);

                file = archive.ArchiveXML;
            }
            else
            {
                m_log.Info("[AvatarArchive] Loading archive from " + FileName);
                StreamReader reader = new StreamReader(FileName);
                file = reader.ReadToEnd();
                reader.Close();
                reader.Dispose();
            }

            string FolderNameToLoadInto = "";

            OSD m = OSDParser.DeserializeLLSDXml(file);
            if (m.Type != OSDType.Map)
            {
                m_log.Warn("[AvatarArchiver]: Failed to load AA from " + FileName + ", text: " + file);
                return;
            }
            OSDMap map = ((OSDMap)m);

            OSDMap assetsMap = ((OSDMap)map["Assets"]);
            OSDMap itemsMap = ((OSDMap)map["Items"]);
            OSDMap bodyMap = ((OSDMap)map["Body"]);

            AvatarAppearance appearance = ConvertXMLToAvatarAppearance(bodyMap, out FolderNameToLoadInto);

            appearance.Owner = account.PrincipalID;

            List<InventoryItemBase> items = new List<InventoryItemBase>();

            InventoryFolderBase AppearanceFolder = InventoryService.GetFolderForType (account.PrincipalID, InventoryType.Unknown, AssetType.Clothing);

            InventoryFolderBase folderForAppearance
                = new InventoryFolderBase(
                    UUID.Random(), FolderNameToLoadInto, account.PrincipalID,
                    -1, AppearanceFolder.ID, 1);

            InventoryService.AddFolder(folderForAppearance);

            folderForAppearance = InventoryService.GetFolder(folderForAppearance);

            try
            {
                LoadAssets(assetsMap, appearance);
                LoadItems(itemsMap, account.PrincipalID, folderForAppearance, appearance, out items);
            }
            catch (Exception ex)
            {
                m_log.Warn("[AvatarArchiver]: Error loading assets and items, " + ex.ToString());
            }

            AvatarData adata = new AvatarData(appearance);
            AvatarService.SetAvatar(account.PrincipalID, adata);

            m_log.Info("[AvatarArchive] Loaded archive from " + FileName);
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:76,代码来源:LLLoginService.cs


示例9: moveInventoryFolder

 public void moveInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.moveInventoryFolder(folder); }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:1,代码来源:OspInventoryWrapperPlugin.cs


示例10: updateInventoryFolder

 public void updateInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.updateInventoryFolder(folder); }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:1,代码来源:OspInventoryWrapperPlugin.cs


示例11: addInventoryFolder

 public void addInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.addInventoryFolder(folder); }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:1,代码来源:OspInventoryWrapperPlugin.cs


示例12: CreateInventorySkel

        private void CreateInventorySkel(UserProfileData userProf)
        {
            IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get<IInventoryProviderSelector>();
            IInventoryStorage storage = inventorySelect.GetProvider(userProf.ID);

            InventoryFolderBase folder = new InventoryFolderBase();

            UUID user = userProf.ID;

            folder.ParentID = UUID.Zero;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "My Inventory";
            folder.Type = (short)AssetType.Folder;
            folder.Version = 1;
            storage.CreateFolder(folder);

            UUID rootFolder = folder.ID;

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Animations";
            folder.Type = (short)AssetType.Animation;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Body Parts";
            folder.Type = (short)AssetType.Bodypart;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Calling Cards";
            folder.Type = (short)AssetType.CallingCard;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Clothing";
            folder.Type = (short)AssetType.Clothing;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Gestures";
            folder.Type = (short)AssetType.Gesture;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Landmarks";
            folder.Type = (short)AssetType.Landmark;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Lost And Found";
            folder.Type = (short)AssetType.LostAndFoundFolder;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Notecards";
            folder.Type = (short)AssetType.Notecard;
            folder.Version = 1;
            storage.CreateFolder(folder);

            folder = new InventoryFolderBase();
            folder.ParentID = rootFolder;
            folder.Owner = user;
            folder.ID = UUID.Random();
            folder.Name = "Objects";
            folder.Type = (short)AssetType.Object;
            folder.Version = 1;
            storage.CreateFolder(folder);

//.........这里部分代码省略.........
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:101,代码来源:UserProfileManager.cs


示例13: GetFolder

        public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
        {
            List<InventoryFolderBase> folders = m_Database.GetFolders(
                    new string[] { "folderID"},
                    new string[] { folder.ID.ToString() });

            if (folders.Count == 0)
                return null;

            return folders[0];
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:11,代码来源:InventoryService.cs


示例14: CreateUserRootFolder

        public virtual bool CreateUserRootFolder (UUID principalID)
        {
            bool result = false;

            InventoryFolderBase rootFolder = GetRootFolder (principalID);

            if (rootFolder == null)
            {
                List<InventoryFolderBase> rootFolders = GetInventorySkeleton (principalID);
                if (rootFolders.Count == 0)
                    rootFolder = CreateFolder (principalID, UUID.Zero, (int)AssetType.RootFolder, "My Inventory");
                else
                {
                    rootFolder = new InventoryFolderBase ();

                    rootFolder.Name = "My Inventory";
                    rootFolder.Type = (short)AssetType.RootFolder;
                    rootFolder.Version = 1;
                    rootFolder.ID = rootFolders[0].ParentID;
                    rootFolder.Owner = principalID;
                    rootFolder.ParentID = UUID.Zero;

                    m_Database.StoreFolder(rootFolder);
                }
                result = true;
            }
            return result;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:28,代码来源:InventoryService.cs


示例15: ForcePurgeFolder

        public virtual bool ForcePurgeFolder (InventoryFolderBase folder)
        {
            List<InventoryFolderBase> subFolders = m_Database.GetFolders(
                    new string[] { "parentFolderID" },
                    new string[] { folder.ID.ToString () });

            foreach (InventoryFolderBase x in subFolders)
            {
                ForcePurgeFolder (x);
                m_Database.DeleteFolders ("folderID", x.ID.ToString (), false);
            }

            m_Database.DeleteItems ("parentFolderID", folder.ID.ToString ());
            m_Database.DeleteFolders("folderID", folder.ID.ToString(), false);

            return true;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:17,代码来源:InventoryService.cs


示例16: GiveInventoryItem

        private InventoryItemBase GiveInventoryItem(UUID senderId, UUID recipient, UUID itemId, InventoryFolderBase parentFolder)
        {
            InventoryItemBase item = new InventoryItemBase(itemId, senderId);
            item = m_scene.InventoryService.GetItem(item);


            InventoryItemBase itemCopy = new InventoryItemBase();
            itemCopy.Owner = recipient;
            itemCopy.CreatorId = item.CreatorId;
            itemCopy.ID = UUID.Random();
            itemCopy.AssetID = item.AssetID;
            itemCopy.Description = item.Description;
            itemCopy.Name = item.Name;
            itemCopy.AssetType = item.AssetType;
            itemCopy.InvType = item.InvType;
            itemCopy.Folder = UUID.Zero;

            //Give full permissions for them
            itemCopy.NextPermissions = (uint)PermissionMask.All;
            itemCopy.GroupPermissions = (uint)PermissionMask.All;
            itemCopy.EveryOnePermissions = (uint)PermissionMask.All;
            itemCopy.CurrentPermissions = (uint)PermissionMask.All;

            if (parentFolder == null)
            {
                InventoryFolderBase folder = m_scene.InventoryService.GetFolderForType(recipient, (AssetType)itemCopy.AssetType);

                if (folder != null)
                    itemCopy.Folder = folder.ID;
                else
                {
                    InventoryFolderBase root = m_scene.InventoryService.GetRootFolder(recipient);

                    if (root != null)
                        itemCopy.Folder = root.ID;
                    else
                        return null; // No destination
                }
            }
            else
                itemCopy.Folder = parentFolder.ID; //We already have a folder to put it in

            itemCopy.GroupID = UUID.Zero;
            itemCopy.GroupOwned = false;
            itemCopy.Flags = item.Flags;
            itemCopy.SalePrice = item.SalePrice;
            itemCopy.SaleType = item.SaleType;

            if (m_scene.InventoryService.AddItem(itemCopy))
            {
                IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
                if (invAccess != null)
                    invAccess.TransferInventoryAssets(itemCopy, senderId, recipient);
            }
            return itemCopy;
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:56,代码来源:AppearanceArchiver.cs


示例17: LoadAvatarArchive

        public void LoadAvatarArchive(string FileName, string First, string Last)
        {
            UserAccount account = m_scene.UserAccountService.GetUserAccount(UUID.Zero, First, Last);
            m_log.Debug("[AvatarArchive] Loading archive from " + FileName);
            if (account == null)
            {
                m_log.Error("[AvatarArchive] User not found!");
                return;
            }
            StreamReader reader = new StreamReader(FileName);

            string line = reader.ReadToEnd();
            string[] lines = line.Split('\n');
            List<string> file = new List<string>(lines);

            reader.Close();
            reader.Dispose();
            ScenePresence SP;
            m_scene.TryGetScenePresence(account.PrincipalID, out SP);
            if (SP == null)
                return; //Bad people!
            SP.ControllingClient.SendAlertMessage("Appearance loading in progress...");

            SP.Appearance.ClearWearables();
            SP.Appearance.ClearAttachments();
            SP.SendWearables();

            string FolderNameToLoadInto = "";
            List<UUID> AttachmentUUIDs = new List<UUID>();
            List<string> AttachmentPoints = new List<string>();
            List<string> AttachmentAssets = new List<string>();

            AvatarAppearance appearance = ConvertXMLToAvatarAppearance(file, out AttachmentUUIDs, out AttachmentPoints, out AttachmentAssets, out FolderNameToLoadInto);

            appearance.Owner = account.PrincipalID;

            List<InventoryItemBase> items = new List<InventoryItemBase>();

            InventoryFolderBase AppearanceFolder = m_scene.InventoryService.GetFolderForType(account.PrincipalID, AssetType.Clothing);

            UUID newFolderId = UUID.Random();

            InventoryFolderBase folderForAppearance
                = new InventoryFolderBase(
                    newFolderId, FolderNameToLoadInto, account.PrincipalID,
                    -1, AppearanceFolder.ID, 1);

            m_scene.InventoryService.AddFolder(folderForAppearance);
            folderForAppearance = m_scene.InventoryService.GetFolder(folderForAppearance);

            #region Appearance setup

            if (appearance.BodyItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.BodyItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.BodyItem, folderForAppearance);
                items.Add(IB);
                appearance.BodyItem = IB.ID;
            }

            if (appearance.EyesItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.EyesItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.EyesItem, folderForAppearance);
                items.Add(IB);
                appearance.EyesItem = IB.ID;
            }

            if (appearance.GlovesItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.GlovesItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.GlovesItem, folderForAppearance);
                items.Add(IB);
                appearance.GlovesItem = IB.ID;
            }

            if (appearance.HairItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.HairItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.HairItem, folderForAppearance);
                items.Add(IB);
                appearance.HairItem = IB.ID;
            }

            if (appearance.JacketItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.JacketItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.JacketItem, folderForAppearance);
                items.Add(IB);
                appearance.JacketItem = IB.ID;
            }

            if (appearance.PantsItem != UUID.Zero)
            {
                InventoryItemBase IB = m_scene.InventoryService.GetItem(new InventoryItemBase(appearance.PantsItem));
                IB = GiveInventoryItem(IB.CreatorIdAsUuid, appearance.Owner, appearance.PantsItem, folderForAppearance);
                items.Add(IB);
                appearance.PantsItem = IB.ID;
            }

//.........这里部分代码省略.........
开发者ID:shangcheng,项目名称:Aurora,代码行数:101,代码来源:AppearanceArchiver.cs


示例18: CreateFolder

        /// <summary>
        /// Create a folder in this agent's inventory.
        /// </summary>
        ///
        /// If the inventory service has not yet delievered the inventory
        /// for this user then the request will be queued.
        /// 
        /// <param name="parentID"></param>
        /// <returns></returns>
        public InventoryFolderBase CreateFolder(string folderName, UUID folderID, short folderType, UUID parentID)
        {
            InventoryFolderBase createdBaseFolder = new InventoryFolderBase();
            createdBaseFolder.Owner = UserProfile.ID;
            createdBaseFolder.ID = folderID;
            createdBaseFolder.Name = folderName;
            createdBaseFolder.ParentID = parentID;
            createdBaseFolder.Type = (short)folderType;
            createdBaseFolder.Version = 1;

            IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get<IInventoryProviderSelector>();
            inventorySelect.GetCheckedProvider(m_userProfile.ID).CreateFolder(UserProfile.ID, createdBaseFolder);

            return createdBaseFolder;
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:24,代码来源:CachedUserInfo.cs


示例19: GiveInventoryItem

        private InventoryItemBase GiveInventoryItem(UUID senderId, UUID recipient, InventoryItemBase item, InventoryFolderBase parentFolder)
        {
            InventoryItemBase itemCopy = new InventoryItemBase();
            itemCopy.Owner = recipient;
            itemCopy.CreatorId = item.CreatorId;
            itemCopy.CreatorData = item.CreatorData;
            itemCopy.ID = UUID.Random();
            itemCopy.AssetID = item.AssetID;
            itemCopy.Description = item.Description;
            itemCopy.Name = item.Name;
            itemCopy.AssetType = item.AssetType;
            itemCopy.InvType = item.InvType;
            itemCopy.Folder = UUID.Zero;

            //Give full permissions for them
            itemCopy.NextPermissions = (uint)PermissionMask.All;
            itemCopy.GroupPermissions = (uint)PermissionMask.All;
            itemCopy.EveryOnePermissions = (uint)PermissionMask.All;
            itemCopy.CurrentPermissions = (uint)PermissionMask.All;

            if (parentFolder == null)
            {
                InventoryFolderBase folder = InventoryService.GetFolderForType (recipient, (InventoryType)itemCopy.InvType, (AssetType)itemCopy.AssetType);

                if (folder != null)
                    itemCopy.Folder = folder.ID;
                else
                {
                    InventoryFolderBase root = InventoryService.GetRootFolder(recipient);

                    if (root != null)
                        itemCopy.Folder = root.ID;
                    else
                        return null; // No destination
                }
            }
            else
                itemCopy.Folder = parentFolder.ID; //We already have a folder to put it in

            itemCopy.GroupID = UUID.Zero;
            itemCopy.GroupOwned = false;
            itemCopy.Flags = item.Flags;
            itemCopy.SalePrice = item.SalePrice;
            itemCopy.SaleType = item.SaleType;

            InventoryService.AddItem(itemCopy);
            return itemCopy;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:48,代码来源:LLLoginService.cs


示例20: UpdateFolder

        /// <summary>
        /// Handle a client request to update the inventory folder
        /// </summary>
        ///
        /// If the inventory service has not yet delievered the inventory
        /// for this user then the request will be queued.
        ///
        /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
        /// so this will work to rename an existing folder.  Needless to say, to rely on this is very confusing,
        /// and needs to be changed.        
        ///
        /// <param name="folderID"></param>
        /// <param name="type"></param>
        /// <param name="name"></param>
        /// <param name="parentID"></param>
        public bool UpdateFolder(InventoryFolderBase baseFolder)
        {
            IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get<IInventoryProviderSelector>();
            inventorySelect.GetProvider(m_userProfile.ID).SaveFolder(baseFolder);

            return true;
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:22,代码来源:CachedUserInfo.cs



注:本文中的InventoryFolderBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InventoryItem类代码示例发布时间:2022-05-24
下一篇:
C# Inventory类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap