diff options
author | randomhuman | 2010-08-13 16:08:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-08-13 23:29:01 +0100 |
commit | 8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b (patch) | |
tree | 90e2127451904c4e40d3c5382bbc96188ad7e004 /OpenSim/Region | |
parent | minor: remove mono compiler warnings (diff) | |
download | opensim-SC_OLD-8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b.zip opensim-SC_OLD-8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b.tar.gz opensim-SC_OLD-8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b.tar.bz2 opensim-SC_OLD-8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b.tar.xz |
Updated the create_region command in the RemoteAdmin plugin to properly support estates without seeking further input on the console.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 54 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/RegionApplicationBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 39 |
4 files changed, 67 insertions, 41 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 | ||
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index e683821..46b68ec 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -58,6 +58,11 @@ namespace OpenSim.Region.ClientStack | |||
58 | 58 | ||
59 | protected StorageManager m_storageManager; | 59 | protected StorageManager m_storageManager; |
60 | 60 | ||
61 | public StorageManager StorageManager | ||
62 | { | ||
63 | get { return m_storageManager; } | ||
64 | } | ||
65 | |||
61 | protected ClientStackManager m_clientStackManager; | 66 | protected ClientStackManager m_clientStackManager; |
62 | 67 | ||
63 | public SceneManager SceneManager | 68 | public SceneManager SceneManager |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f62851a..18705a8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -544,45 +544,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
544 | if (m_storageManager.EstateDataStore != null) | 544 | if (m_storageManager.EstateDataStore != null) |
545 | { | 545 | { |
546 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | 546 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); |
547 | if (m_regInfo.EstateSettings.EstateID == 0) // No record at all | ||
548 | { | ||
549 | MainConsole.Instance.Output("Your region is not part of an estate."); | ||
550 | while (true) | ||
551 | { | ||
552 | string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"}); | ||
553 | if (response == "no") | ||
554 | { | ||
555 | // Create a new estate | ||
556 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true); | ||
557 | |||
558 | m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName); | ||
559 | m_regInfo.EstateSettings.Save(); | ||
560 | break; | ||
561 | } | ||
562 | else | ||
563 | { | ||
564 | response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); | ||
565 | if (response == "None") | ||
566 | continue; | ||
567 | |||
568 | List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response); | ||
569 | if (estateIDs.Count < 1) | ||
570 | { | ||
571 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); | ||
572 | continue; | ||
573 | } | ||
574 | |||
575 | int estateID = estateIDs[0]; | ||
576 | |||
577 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); | ||
578 | |||
579 | if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID)) | ||
580 | break; | ||
581 | |||
582 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | ||
583 | } | ||
584 | } | ||
585 | } | ||
586 | } | 547 | } |
587 | 548 | ||
588 | #endregion Region Settings | 549 | #endregion Region Settings |