aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs10
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs54
2 files changed, 62 insertions, 2 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index c541249..d9ec287 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -530,7 +530,10 @@ namespace OpenSim
530 regionFile = cmd[3]; 530 regionFile = cmd[3];
531 531
532 IScene scene; 532 IScene scene;
533 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); 533 RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source);
534 PopulateRegionEstateInfo(regInfo);
535 CreateRegion(regInfo, true, out scene);
536 regInfo.EstateSettings.Save();
534 } 537 }
535 else if (cmd[3].EndsWith(".ini")) 538 else if (cmd[3].EndsWith(".ini"))
536 { 539 {
@@ -541,7 +544,10 @@ namespace OpenSim
541 regionFile = cmd[3]; 544 regionFile = cmd[3];
542 545
543 IScene scene; 546 IScene scene;
544 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene); 547 RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]);
548 PopulateRegionEstateInfo(regInfo);
549 CreateRegion(regInfo, true, out scene);
550 regInfo.EstateSettings.Save();
545 } 551 }
546 else 552 else
547 { 553 {
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