diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 17 |
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 |