当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectPart.GetProperties方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.GetProperties方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.GetProperties方法的具体用法?C# SceneObjectPart.GetProperties怎么用?C# SceneObjectPart.GetProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.GetProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestUpdateTaskInventoryItem

        public bool RequestUpdateTaskInventoryItem(
           IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
        {
            AssetXferUploader uploader = GetTransactionUploader(transactionID);
            if (uploader == null)
            {
                m_log.WarnFormat("[ASSET TRANSACTIONS]: Transaction {0} NOT FOUND (duplicate removed?) for inventory item update {1}", transactionID, item.Name);
                return false;
            }

            // This may complete now if upload complete, or later when the upload completes.
            uploader.TriggerWhenUploadComplete(delegate(AssetBase asset)
            {
                // This upload transaction is complete.
                XferUploaders.Remove(transactionID);

                if (asset == null)
                    return;         // UpdateItem() not called

                m_log.DebugFormat(
                    "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
                    item.Name, part.Name, transactionID);

                asset.Name = item.Name;
                asset.Description = item.Description;
                asset.Type = (sbyte)item.Type;

                try
                {
                    Manager.MyScene.CommsManager.AssetCache.AddAsset(asset, AssetRequestInfo.GenericNetRequest());
                    if (part.Inventory.UpdateTaskInventoryItemAsset(part.UUID, item.ItemID, asset.FullID))
                    {
                        part.GetProperties(remoteClient);
                    }
                }
                catch (AssetServerException e)
                {
                    remoteClient.SendAgentAlertMessage("Unable to upload asset. Please try again later.", false);

                    m_log.ErrorFormat("[ASSET TRANSACTIONS] Unable to update task item due to asset server error {0}", e);
                }
            });

            // We at least found an uploader with that transaction ID.
            return true;
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:46,代码来源:AgentAssetsTransactions.cs

示例2: RequestUpdateTaskInventoryItem

        //private void CreateItemFromUpload(AssetBase asset, IClientAPI ourClient, UUID inventoryFolderID, uint nextPerms, uint wearableType)
        //{
        //    Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
        //    CachedUserInfo userInfo = Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(
        //            ourClient.AgentId);

        //    if (userInfo != null)
        //    {
        //        InventoryItemBase item = new InventoryItemBase();
        //        item.Owner = ourClient.AgentId;
        //        item.Creator = ourClient.AgentId;
        //        item.ID = UUID.Random();
        //        item.AssetID = asset.FullID;
        //        item.Description = asset.Description;
        //        item.Name = asset.Name;
        //        item.AssetType = asset.Type;
        //        item.InvType = asset.Type;
        //        item.Folder = inventoryFolderID;
        //        item.BasePermissions = 0x7fffffff;
        //        item.CurrentPermissions = 0x7fffffff;
        //        item.EveryOnePermissions = 0;
        //        item.NextPermissions = nextPerms;
        //        item.Flags = wearableType;
        //        item.CreationDate = Util.UnixTimeSinceEpoch();

        //        userInfo.AddItem(item);
        //        ourClient.SendInventoryItemCreateUpdate(item);
        //    }
        //    else
        //    {
        //        m_log.ErrorFormat(
        //            "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation",
        //            ourClient.AgentId);
        //    }
        //}

        public void RequestUpdateTaskInventoryItem(
           IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
        {
            if (XferUploaders.ContainsKey(transactionID))
            {
                AssetBase asset = XferUploaders[transactionID].GetAssetData();
                if (asset != null)
                {
                    m_log.DebugFormat(
                        "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
                        item.Name, part.Name, transactionID);

                    asset.Name = item.Name;
                    asset.Description = item.Description;
                    asset.Type = (sbyte)item.Type;
                    item.AssetID = asset.FullID;

                    Manager.MyScene.AssetService.Store(asset);

                    if (part.Inventory.UpdateInventoryItem(item))
                        part.GetProperties(remoteClient);
                }
            }
        }
开发者ID:dreamerc,项目名称:diva-distribution,代码行数:60,代码来源:AgentAssetsTransactions.cs

示例3: RequestUpdateTaskInventoryItem

        //private void CreateItemFromUpload(AssetBase asset, IClientAPI ourClient, UUID inventoryFolderID, uint nextPerms, uint wearableType)
        //{
        //    Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
        //    CachedUserInfo userInfo = Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(
        //            ourClient.AgentId);

        //    if (userInfo != null)
        //    {
        //        InventoryItemBase item = new InventoryItemBase();
        //        item.Owner = ourClient.AgentId;
        //        item.Creator = ourClient.AgentId;
        //        item.ID = UUID.Random();
        //        item.AssetID = asset.FullID;
        //        item.Description = asset.Description;
        //        item.Name = asset.Name;
        //        item.AssetType = asset.Type;
        //        item.InvType = asset.Type;
        //        item.Folder = inventoryFolderID;
        //        item.BasePermissions = 0x7fffffff;
        //        item.CurrentPermissions = 0x7fffffff;
        //        item.EveryOnePermissions = 0;
        //        item.NextPermissions = nextPerms;
        //        item.Flags = wearableType;
        //        item.CreationDate = Util.UnixTimeSinceEpoch();

        //        userInfo.AddItem(item);
        //        ourClient.SendInventoryItemCreateUpdate(item);
        //    }
        //    else
        //    {
        //        m_log.ErrorFormat(
        //            "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation",
        //            ourClient.AgentId);
        //    }
        //}

        public void RequestUpdateTaskInventoryItem(
           IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
        {
            if (XferUploaders.ContainsKey(transactionID))
            {
                AssetBase asset = XferUploaders[transactionID].GetAssetData();
                if (asset != null)
                {
                    m_log.DebugFormat(
                        "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
                        item.Name, part.Name, transactionID);

                    asset.Name = item.Name;
                    asset.Description = item.Description;
                    asset.Type = (sbyte)item.Type;
                    item.AssetID = asset.FullID;

                    IMonitorModule monitorModule = Manager.MyScene.RequestModuleInterface<IMonitorModule>();
                    if (monitorModule != null)
                    {
                        INetworkMonitor networkMonitor = (INetworkMonitor)monitorModule.GetMonitor(Manager.MyScene.RegionInfo.RegionID.ToString(), "Network Monitor");
                        networkMonitor.AddPendingUploads(-1);
                    }

                    Manager.MyScene.AssetService.Store(asset);

                    if (part.Inventory.UpdateInventoryItem(item))
                    {
                        if ((InventoryType)item.InvType == InventoryType.Notecard)
                            remoteClient.SendAgentAlertMessage("Notecard saved", false);
                        else if ((InventoryType)item.InvType == InventoryType.LSL)
                            remoteClient.SendAgentAlertMessage("Script saved", false);
                        else
                            remoteClient.SendAgentAlertMessage("Item saved", false);

                        part.GetProperties(remoteClient);
                    }
                }
            }
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:76,代码来源:AgentAssetsTransactions.cs


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