aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/RegionInfo.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 504b303..7ac1e62 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -594,6 +594,57 @@ namespace OpenSim.Framework
594 ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString())); 594 ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString()));
595 } 595 }
596 596
597 private void WriteNiniConfig(IConfigSource source)
598 {
599 IConfig config = source.Configs[RegionName];
600
601 if (config != null)
602 source.Configs.Remove(RegionName);
603
604 config = source.AddConfig(RegionName);
605
606 config.Set("RegionUUID", RegionID.ToString());
607
608 string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY);
609 config.Set("Location", location);
610
611 if (DataStore != String.Empty)
612 config.Set("Datastore", DataStore);
613
614 config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
615 config.Set("InternalPort", m_internalEndPoint.Port);
616
617 config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
618
619 config.Set("ExternalHostName", m_externalHostName);
620
621 if (MasterAvatarAssignedUUID != UUID.Zero)
622 {
623 config.Set("MasterAvatarUUID", MasterAvatarAssignedUUID.ToString());
624 }
625 else if (MasterAvatarFirstName != String.Empty && MasterAvatarLastName != String.Empty)
626 {
627 config.Set("MasterAvatarFirstName", MasterAvatarFirstName);
628 config.Set("MasterAvatarLastName", MasterAvatarLastName);
629 }
630 if (MasterAvatarSandboxPassword != String.Empty)
631 {
632 config.Set("MasterAvatarSandboxPassword", MasterAvatarSandboxPassword);
633 }
634
635 if (m_nonphysPrimMax != 0)
636 config.Set("NonphysicalPrimMax", m_nonphysPrimMax);
637 if (m_physPrimMax != 0)
638 config.Set("PhysicalPrimMax", m_physPrimMax);
639 config.Set("ClampPrimSize", m_clampPrimSize.ToString());
640
641 if (m_objectCapacity != 0)
642 config.Set("MaxPrims", m_objectCapacity);
643
644 if (ScopeID != UUID.Zero)
645 config.Set("ScopeID", ScopeID.ToString());
646 }
647
597 public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) 648 public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result)
598 { 649 {
599 return true; 650 return true;
@@ -601,6 +652,23 @@ namespace OpenSim.Framework
601 652
602 public void SaveRegionToFile(string description, string filename) 653 public void SaveRegionToFile(string description, string filename)
603 { 654 {
655 if (filename.ToLower().EndsWith(".ini"))
656 {
657 IniConfigSource source = new IniConfigSource();
658 try
659 {
660 source = new IniConfigSource(filename); // Load if it exists
661 }
662 catch (Exception)
663 {
664 }
665
666 WriteNiniConfig(source);
667
668 source.Save(filename);
669
670 return;
671 }
604 configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, 672 configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
605 ignoreIncomingConfiguration, false); 673 ignoreIncomingConfiguration, false);
606 configMember.performConfigurationRetrieve(); 674 configMember.performConfigurationRetrieve();