aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-21 22:47:02 +0000
committerJustin Clark-Casey (justincc)2011-03-21 22:47:02 +0000
commitee7cfc2854aba3572d5342b8c1bfd5bf4ea93841 (patch)
treed00968ded9167c160f32d95839415be4a1841ce0 /OpenSim/Region/Application/OpenSimBase.cs
parentminor: slightly adjust previous method doc. (diff)
downloadopensim-SC-ee7cfc2854aba3572d5342b8c1bfd5bf4ea93841.zip
opensim-SC-ee7cfc2854aba3572d5342b8c1bfd5bf4ea93841.tar.gz
opensim-SC-ee7cfc2854aba3572d5342b8c1bfd5bf4ea93841.tar.bz2
opensim-SC-ee7cfc2854aba3572d5342b8c1bfd5bf4ea93841.tar.xz
refactor: use EstateDataService property directly instead of loading it into a local variable
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs19
1 files changed, 7 insertions, 12 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f804cb7..eae3686 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -798,12 +798,8 @@ namespace OpenSim
798 /// <param name="regInfo"></param> 798 /// <param name="regInfo"></param>
799 public void PopulateRegionEstateInfo(RegionInfo regInfo) 799 public void PopulateRegionEstateInfo(RegionInfo regInfo)
800 { 800 {
801 IEstateDataService estateDataService = EstateDataService; 801 if (EstateDataService != null)
802 802 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
803 if (estateDataService != null)
804 {
805 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false);
806 }
807 803
808 if (regInfo.EstateSettings.EstateID == 0) // No record at all 804 if (regInfo.EstateSettings.EstateID == 0) // No record at all
809 { 805 {
@@ -814,7 +810,7 @@ namespace OpenSim
814 if (response == "no") 810 if (response == "no")
815 { 811 {
816 // Create a new estate 812 // Create a new estate
817 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true); 813 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
818 814
819 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); 815 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
820 816
@@ -828,7 +824,7 @@ namespace OpenSim
828 } 824 }
829 else 825 else
830 { 826 {
831 List<EstateSettings> estates = estateDataService.LoadEstateSettingsAll(); 827 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
832 828
833 List<string> estateNames = new List<string>(); 829 List<string> estateNames = new List<string>();
834 foreach (EstateSettings estate in estates) 830 foreach (EstateSettings estate in estates)
@@ -843,7 +839,7 @@ namespace OpenSim
843 if (response == "None") 839 if (response == "None")
844 continue; 840 continue;
845 841
846 List<int> estateIDs = estateDataService.GetEstates(response); 842 List<int> estateIDs = EstateDataService.GetEstates(response);
847 if (estateIDs.Count < 1) 843 if (estateIDs.Count < 1)
848 { 844 {
849 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); 845 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
@@ -852,9 +848,9 @@ namespace OpenSim
852 848
853 int estateID = estateIDs[0]; 849 int estateID = estateIDs[0];
854 850
855 regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID); 851 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
856 852
857 if (estateDataService.LinkRegion(regInfo.RegionID, estateID)) 853 if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
858 break; 854 break;
859 855
860 MainConsole.Instance.Output("Joining the estate failed. Please try again."); 856 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
@@ -863,7 +859,6 @@ namespace OpenSim
863 } 859 }
864 } 860 }
865 } 861 }
866
867 862
868 public class OpenSimConfigSource 863 public class OpenSimConfigSource
869 { 864 {