aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
diff options
context:
space:
mode:
authorMelanie2011-10-11 21:30:42 +0100
committerMelanie2011-10-11 21:30:42 +0100
commit673886d2311ad9873f386ca794f5e1adf41755be (patch)
treea55c40204c3a351db5d2d86e6c3369ac71c40385 /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
parentMerge commit '90466515839eb34d7fd9984c92f1970ab5d6f3ad' into bigmerge (diff)
parentReattaching a region was failing if the estate name had not changed (issue 50... (diff)
downloadopensim-SC-673886d2311ad9873f386ca794f5e1adf41755be.zip
opensim-SC-673886d2311ad9873f386ca794f5e1adf41755be.tar.gz
opensim-SC-673886d2311ad9873f386ca794f5e1adf41755be.tar.bz2
opensim-SC-673886d2311ad9873f386ca794f5e1adf41755be.tar.xz
Merge commit '1458fab82c4dab9901d81419e6b515f47ea7320f' into bigmerge
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 86c0ac8..b190a3d 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -844,21 +844,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
844 } 844 }
845 845
846 // Create a new estate with the name provided 846 // Create a new estate with the name provided
847 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true); 847 region.EstateSettings = m_application.EstateDataService.CreateNewEstate();
848 848
849 region.EstateSettings.EstateName = (string) requestData["estate_name"]; 849 region.EstateSettings.EstateName = (string) requestData["estate_name"];
850 region.EstateSettings.EstateOwner = userID; 850 region.EstateSettings.EstateOwner = userID;
851 // Persistence does not seem to effect the need to save a new estate 851 // Persistence does not seem to effect the need to save a new estate
852 region.EstateSettings.Save(); 852 region.EstateSettings.Save();
853
854 if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID))
855 throw new Exception("Failed to join estate.");
853 } 856 }
854 else 857 else
855 { 858 {
856 int estateID = estateIDs[0]; 859 int estateID = estateIDs[0];
857 860
858 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); 861 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, false);
859 862
860 if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) 863 if (region.EstateSettings.EstateID != estateID)
861 throw new Exception("Failed to join estate."); 864 {
865 // The region is already part of an estate, but not the one we want.
866 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID);
867
868 if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID))
869 throw new Exception("Failed to join estate.");
870 }
862 } 871 }
863 872
864 // Create the region and perform any initial initialization 873 // Create the region and perform any initial initialization