aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-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 25ae3f1..e20b487 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -741,21 +741,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
741 } 741 }
742 742
743 // Create a new estate with the name provided 743 // Create a new estate with the name provided
744 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true); 744 region.EstateSettings = m_application.EstateDataService.CreateNewEstate();
745 745
746 region.EstateSettings.EstateName = (string) requestData["estate_name"]; 746 region.EstateSettings.EstateName = (string) requestData["estate_name"];
747 region.EstateSettings.EstateOwner = userID; 747 region.EstateSettings.EstateOwner = userID;
748 // Persistence does not seem to effect the need to save a new estate 748 // Persistence does not seem to effect the need to save a new estate
749 region.EstateSettings.Save(); 749 region.EstateSettings.Save();
750
751 if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID))
752 throw new Exception("Failed to join estate.");
750 } 753 }
751 else 754 else
752 { 755 {
753 int estateID = estateIDs[0]; 756 int estateID = estateIDs[0];
754 757
755 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); 758 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, false);
756 759
757 if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) 760 if (region.EstateSettings.EstateID != estateID)
758 throw new Exception("Failed to join estate."); 761 {
762 // The region is already part of an estate, but not the one we want.
763 region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID);
764
765 if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID))
766 throw new Exception("Failed to join estate.");
767 }
759 } 768 }
760 769
761 // Create the region and perform any initial initialization 770 // Create the region and perform any initial initialization