aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs54
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index e148cde..eb18e83 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -790,6 +790,60 @@ namespace OpenSim
790 { 790 {
791 regionnum = m_sceneManager.Scenes.Count; 791 regionnum = m_sceneManager.Scenes.Count;
792 } 792 }
793
794 /// <summary>
795 /// Load the estate information for the provided RegionInfo object.
796 /// </summary>
797 /// <param name="regInfo">
798 /// A <see cref="RegionInfo"/>
799 /// </param>
800 public void PopulateRegionEstateInfo(RegionInfo regInfo)
801 {
802 if (m_storageManager.EstateDataStore != null)
803 {
804 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false);
805 }
806
807 if (regInfo.EstateSettings.EstateID == 0) // No record at all
808 {
809 MainConsole.Instance.Output("Your region is not part of an estate.");
810 while (true)
811 {
812 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
813 if (response == "no")
814 {
815 // Create a new estate
816 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true);
817
818 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
819 //regInfo.EstateSettings.Save();
820 break;
821 }
822 else
823 {
824 response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
825 if (response == "None")
826 continue;
827
828 List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
829 if (estateIDs.Count < 1)
830 {
831 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
832 continue;
833 }
834
835 int estateID = estateIDs[0];
836
837 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
838
839 if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID))
840 break;
841
842 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
843 }
844 }
845 }
846 }
793 } 847 }
794 848
795 849