本文整理汇总了C#中OpenSim.Framework.RegionInfo.WriteNiniConfig方法的典型用法代码示例。如果您正苦于以下问题:C# RegionInfo.WriteNiniConfig方法的具体用法?C# RegionInfo.WriteNiniConfig怎么用?C# RegionInfo.WriteNiniConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Framework.RegionInfo
的用法示例。
在下文中一共展示了RegionInfo.WriteNiniConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadNiniConfig
//.........这里部分代码省略.........
else
{
NeedsUpdate = true;
address = IPAddress.Parse(MainConsole.Instance.CmdPrompt("Internal IP address for region " + name, "0.0.0.0"));
config.Set("InternalAddress", address.ToString());
}
int port;
if (config.Contains("InternalPort"))
{
port = config.GetInt("InternalPort", 9000);
}
else
{
NeedsUpdate = true;
port = Convert.ToInt32(MainConsole.Instance.CmdPrompt("Internal port for region " + name, "9000"));
config.Set("InternalPort", port);
}
region.InternalEndPoint = new IPEndPoint(address, port);
if (config.Contains("AllowAlternatePorts"))
{
region.m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true);
}
else
{
NeedsUpdate = true;
region.m_allow_alternate_ports = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Allow alternate ports", "False"));
config.Set("AllowAlternatePorts", region.m_allow_alternate_ports.ToString());
}
// External IP
//
string externalName;
//Let's know our external IP (by Enrico Nirvana)
WebClient client = new WebClient();
string myIP = client.DownloadString("http://www.whatismyip.com/automation/n09230945.asp");
MainConsole.Instance.Output("Your External ip is:" + myIP);
//ended here (by Enrico Nirvana)
if (config.Contains("ExternalHostName"))
{
externalName = config.GetString("ExternalHostName", "SYSTEMIP");
}
else
{
NeedsUpdate = true;
externalName = MainConsole.Instance.CmdPrompt("External host name for region " + name, "SYSTEMIP");
config.Set("ExternalHostName", externalName);
}
if (externalName == "SYSTEMIP")
{
region.ExternalHostName = Util.GetLocalHost().ToString();
m_log.InfoFormat(
"[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}",
region.ExternalHostName, name);
}
else
{
region.ExternalHostName = Util.ResolveEndPoint(externalName, port).Address.ToString();
}
region.RegionType = config.GetString("RegionType", region.RegionType);
if (region.RegionType == String.Empty)
{
NeedsUpdate = true;
region.RegionType = MainConsole.Instance.CmdPrompt("Region Type for region " + name, "Mainland");
config.Set("RegionType", region.RegionType);
}
region.AllowPhysicalPrims = config.GetBoolean("AllowPhysicalPrims", region.AllowPhysicalPrims);
region.AllowScriptCrossing = config.GetBoolean("AllowScriptCrossing", region.AllowScriptCrossing);
region.TrustBinariesFromForeignSims = config.GetBoolean("TrustBinariesFromForeignSims", region.TrustBinariesFromForeignSims);
region.SeeIntoThisSimFromNeighbor = config.GetBoolean("SeeIntoThisSimFromNeighbor", region.SeeIntoThisSimFromNeighbor);
region.ObjectCapacity = config.GetInt("MaxPrims", region.ObjectCapacity);
// Multi-tenancy
//
region.ScopeID = new UUID(config.GetString("ScopeID", region.ScopeID.ToString()));
//Do this last so that we can save the password immediately if it doesn't exist
UUID password = region.Password; //Save the pass as this TryParse will wipe it out
if (!UUID.TryParse(config.GetString("NeighborPassword", ""), out region.Password))
{
region.Password = password;
config.Set("NeighborPassword", password);
region.WriteNiniConfig(source);
}
return NeedsUpdate;
}