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


C# LLSDMap.Add方法代码示例

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


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

示例1: RequestCreateItemFromAsset

        public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
            InventoryType invType, LLUUID folderID, ItemCreatedFromAssetCallback callback)
        {
            if (_Client.Network.CurrentSim == null || _Client.Network.CurrentSim.Caps == null)
                throw new Exception("NewFileAgentInventory capability is not currently available");

            Uri url = _Client.Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");

            if (url != null)
            {
                LLSDMap query = new LLSDMap();
                query.Add("folder_id", LLSD.FromUUID(folderID));
                query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
                query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
                query.Add("name", LLSD.FromString(name));
                query.Add("description", LLSD.FromString(description));

                byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);

                // Make the request
                CapsClient request = new CapsClient(url);
                request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
                request.UserData = new KeyValuePair<ItemCreatedFromAssetCallback, byte[]>(callback, data);
                request.StartRequest(postData);
            }
            else
            {
                throw new Exception("NewFileAgentInventory capability is not currently available");
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:30,代码来源:InventoryManager.cs

示例2: ModerateChatSessions

        /// <summary>
        /// Moderate a chat session
        /// </summary>
        /// <param name="sessionID">the <see cref="UUID"/> of the session to moderate, for group chats this will be the groups UUID</param>
        /// <param name="memberID">the <see cref="UUID"/> of the avatar to moderate</param>
        /// <param name="moderateText">true to moderate (silence user), false to allow avatar to speak</param>
        public void ModerateChatSessions(UUID sessionID, UUID memberID, bool moderateText)
        {
            if (Client.Network.CurrentSim == null || Client.Network.CurrentSim.Caps == null)
                throw new Exception("ChatSessionRequest capability is not currently available");

            Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("ChatSessionRequest");

            if (url != null)
            {
                LLSDMap req = new LLSDMap();
                req.Add("method", LLSD.FromString("mute update"));

                LLSDMap mute_info = new LLSDMap();
                mute_info.Add("text", LLSD.FromBoolean(moderateText));

                LLSDMap parameters = new LLSDMap();
                parameters["agent_id"] = LLSD.FromUUID(memberID);
                parameters["mute_info"] = mute_info;

                req["params"] = parameters;

                req.Add("session-id", LLSD.FromUUID(sessionID));

                byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(req);

                CapsClient request = new CapsClient(url);
                request.StartRequest(postData);
            }
            else
            {
                throw new Exception("ChatSessionRequest capability is not currently available");
            }
        }
开发者ID:jhs,项目名称:libopenmetaverse,代码行数:39,代码来源:AgentManager.cs

示例3: RequestUploadNotecardAsset

        /// <summary>
        /// 
        /// </summary>
        /// <param name="data"></param>
        /// <param name="notecardID"></param>
        /// <param name="callback"></param>
        public void RequestUploadNotecardAsset(byte[] data, UUID notecardID, NotecardUploadedAssetCallback callback)
        {
            if (_Network.CurrentSim == null || _Network.CurrentSim.Caps == null)
                throw new Exception("UpdateNotecardAgentInventory capability is not currently available");

            Uri url = _Network.CurrentSim.Caps.CapabilityURI("UpdateNotecardAgentInventory");

            if (url != null)
            {
                LLSDMap query = new LLSDMap();
                query.Add("item_id", LLSD.FromUUID(notecardID));

                byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);

                // Make the request
                CapsClient request = new CapsClient(url);
                request.OnComplete += new CapsClient.CompleteCallback(UploadNotecardAssetResponse);
                request.UserData = new object[2] { new KeyValuePair<NotecardUploadedAssetCallback, byte[]>(callback, data), notecardID };
                request.StartRequest(postData);
            }
            else
            {
                throw new Exception("UpdateNotecardAgentInventory capability is not currently available");
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:31,代码来源:InventoryManager.cs

示例4: RequestCreateItemFromAsset

        public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
            InventoryType invType, UUID folderID, CapsClient.ProgressCallback progCallback, ItemCreatedFromAssetCallback callback)
        {
            if (_Network.CurrentSim == null || _Network.CurrentSim.Caps == null)
                throw new Exception("NewFileAgentInventory capability is not currently available");

            Uri url = _Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");

            if (url != null)
            {
                LLSDMap query = new LLSDMap();
                query.Add("folder_id", LLSD.FromUUID(folderID));
                query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
                query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
                query.Add("name", LLSD.FromString(name));
                query.Add("description", LLSD.FromString(description));

                // Make the request
                CapsClient request = new CapsClient(url);
                request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
                request.UserData = new object[] { progCallback, callback, data };

                request.StartRequest(query);
            }
            else
            {
                throw new Exception("NewFileAgentInventory capability is not currently available");
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:29,代码来源:InventoryManager.cs

示例5: CreateUser

        /// <summary>
        /// Returns the new user ID or throws an exception containing the error code
        /// The error codes can be found here: https://wiki.secondlife.com/wiki/RegAPIError
        /// </summary>
        /// <param name="user">New user account to create</param>
        /// <returns>The UUID of the new user account</returns>
        public LLUUID CreateUser(CreateUserParam user)
        {
            if (Initializing)
                throw new InvalidOperationException("still initializing");

            if (_caps.CreateUser == null)
                throw new InvalidOperationException("access denied; only approved developers have access to the registration api");

            // Create the POST data
            LLSDMap query = new LLSDMap();
            query.Add("username", LLSD.FromString(user.FirstName));
            query.Add("last_name_id", LLSD.FromInteger(user.LastName.ID));
            query.Add("email", LLSD.FromString(user.Email));
            query.Add("password", LLSD.FromString(user.Password));
            query.Add("dob", LLSD.FromString(user.Birthdate.ToString("yyyy-MM-dd")));

            if (user.LimitedToEstate != null)
                query.Add("limited_to_estate", LLSD.FromInteger(user.LimitedToEstate.Value));

            if (!string.IsNullOrEmpty(user.StartRegionName))
                query.Add("start_region_name", LLSD.FromInteger(user.LimitedToEstate.Value));

            if (user.StartLocation != null)
            {
                query.Add("start_local_x", LLSD.FromReal(user.StartLocation.Value.X));
                query.Add("start_local_y", LLSD.FromReal(user.StartLocation.Value.Y));
                query.Add("start_local_z", LLSD.FromReal(user.StartLocation.Value.Z));
            }

            if (user.StartLookAt != null)
            {
                query.Add("start_look_at_x", LLSD.FromReal(user.StartLookAt.Value.X));
                query.Add("start_look_at_y", LLSD.FromReal(user.StartLookAt.Value.Y));
                query.Add("start_look_at_z", LLSD.FromReal(user.StartLookAt.Value.Z));
            }

            byte[] postData = LLSDParser.SerializeXmlBytes(query);

            // Make the request
            CapsClient request = new CapsClient(_caps.CreateUser);
            request.OnComplete += new CapsClient.CompleteCallback(CreateUserResponse);
            request.StartRequest();

            // FIXME: Block
            return LLUUID.Zero;
        }
开发者ID:chrbayer84,项目名称:SLAgentCSServer,代码行数:52,代码来源:RegistrationApi.cs

示例6: CheckName

        public bool CheckName(string firstName, LastName lastName)
        {
            if (Initializing)
                throw new InvalidOperationException("still initializing");

            if (_caps.CheckName == null)
                throw new InvalidOperationException("access denied; only approved developers have access to the registration api");

            // Create the POST data
            LLSDMap query = new LLSDMap();
            query.Add("username", LLSD.FromString(firstName));
            query.Add("last_name_id", LLSD.FromInteger(lastName.ID));
            byte[] postData = LLSDParser.SerializeXmlBytes(query);

            CapsClient request = new CapsClient(_caps.CheckName);
            request.OnComplete += new CapsClient.CompleteCallback(CheckNameResponse);
            request.StartRequest();

            // FIXME:
            return false;
        }
开发者ID:chrbayer84,项目名称:SLAgentCSServer,代码行数:21,代码来源:RegistrationApi.cs


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