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


C# EstateSettings.ToKeyValuePairs方法代码示例

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


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

示例1: CreateEstate

        public byte[] CreateEstate(Dictionary<string, object> request)
        {
            EstateSettings ES = new EstateSettings(request);

            UUID RegionID = new UUID(request["REGIONID"].ToString());

            ES = EstateConnector.CreateEstate(ES, RegionID);

            //This is not a local transfer, MUST be false!
            Dictionary<string, object> result = ES.ToKeyValuePairs(false);
            string xmlString = WebUtils.BuildXmlResponse(result);
            //MainConsole.Instance.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", xmlString);
            UTF8Encoding encoding = new UTF8Encoding();
            return encoding.GetBytes(xmlString);
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:15,代码来源:AuroraDataServerPostHandler.cs

示例2: CreateEstate

        public EstateSettings CreateEstate(EstateSettings es, UUID RegionID)
		{
            int EstateID = 0;
            List<string> QueryResults = GD.Query("`Key`", "EstateID", "estates", "`Value`", " ORDER BY `Value` DESC");
            if (QueryResults.Count == 0)
                EstateID = 99;
            else
                EstateID = int.Parse(QueryResults[0]);

            if (EstateID == 0)
                EstateID = 99;

            //Check for other estates with the same name
            List<int> Estates = GetEstates(es.EstateName);
            if (Estates != null)
            {
                foreach (int otherEstateID in Estates)
                {
                    EstateSettings otherEstate = this.LoadEstateSettings(otherEstateID);
                    if (otherEstate.EstateName == es.EstateName)
                    { //Cant have two estates with the same name.
                        //We set the estate name so that the region can get the error and so we don't have to spit out more junk to find it.
                        return new EstateSettings()
                        {
                            EstateID = 0,
                            EstateName = "Duplicate Estate Name. Please Change."
                        };
                    }
                }
            }

            EstateID++;
            es.EstateID = (uint)EstateID;

            List<object> Values = new List<object>();
            Values.Add(es.EstateID);
            Values.Add("EstateSettings");
            OSDMap map = Util.DictionaryToOSD(es.ToKeyValuePairs(true));
            Values.Add(OSDParser.SerializeLLSDXmlString(map));
            GD.Insert("estates", Values.ToArray());

            GD.Insert("estates", new object[] {
					RegionID,
                    "EstateID",
					EstateID
				});

            es.OnSave += SaveEstateSettings;
            return es;
		}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:50,代码来源:LocalEstateConnector.cs

示例3: CreateEstate

        public EstateSettings CreateEstate(EstateSettings es, UUID RegionID)
        {
            Dictionary<string, object> sendData = es.ToKeyValuePairs(true);

            sendData["REGIONID"] = RegionID.ToString();
            sendData["METHOD"] = "createestate";

            string reqString = ServerUtils.BuildXmlResponse(sendData);

            try
            {
                string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/auroradata",
                        reqString);
                if (reply != string.Empty)
                {
                    Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);

                    if (replyData != null)
                    {
                        es = new EstateSettings(replyData);
                        es.OnSave += SaveEstateSettings;
                        return es;
                    }

                    else
                        m_log.DebugFormat("[AuroraRemoteEstateConnector]: CreateEstate {0} received null response",
                            RegionID);

                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteEstateConnector]: Exception when contacting server: {0}", e.Message);
            }
            return null;
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:37,代码来源:RemoteEstateConnector.cs

示例4: SaveEstateSettings

        public void SaveEstateSettings(EstateSettings es)
        {
            Dictionary<string, object> sendData = es.ToKeyValuePairs(true);

            sendData["METHOD"] = "saveestatesettings";

            string reqString = ServerUtils.BuildXmlResponse(sendData);

            try
            {
                SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/auroradata",
                        reqString);
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteEstateConnector]: Exception when contacting server: {0}", e.Message);
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:19,代码来源:RemoteEstateConnector.cs

示例5: CreateEstate

        public EstateSettings CreateEstate(EstateSettings es, UUID RegionID)
        {
            Dictionary<string, object> sendData = es.ToKeyValuePairs(true);

            sendData["REGIONID"] = RegionID.ToString();
            sendData["METHOD"] = "createestate";

            string reqString = WebUtils.BuildXmlResponse(sendData);

            try
            {
                List<string> m_ServerURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                           m_ServerURI,
                           reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        if (replyData != null)
                        {
                            es = new EstateSettings(replyData);
                            es.OnSave += SaveEstateSettings;
                            return es;
                        }

                        else
                            m_log.DebugFormat("[AuroraRemoteEstateConnector]: CreateEstate {0} received null response",
                                RegionID);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteEstateConnector]: Exception when contacting server: {0}", e.ToString());
            }
            return null;
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:40,代码来源:RemoteEstateConnector.cs

示例6: SaveEstateSettings

        public void SaveEstateSettings(EstateSettings es)
        {
            Dictionary<string, object> sendData = es.ToKeyValuePairs(true);

            sendData["METHOD"] = "saveestatesettings";

            string reqString = WebUtils.BuildXmlResponse(sendData);

            try
            {
                List<string> m_ServerURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    AsynchronousRestObjectRequester.MakeRequest("POST",
                           m_ServerURI,
                           reqString);
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteEstateConnector]: Exception when contacting server: {0}", e.ToString());
            }
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:23,代码来源:RemoteEstateConnector.cs


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