本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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());
}
}