diff options
author | Kevin Houlihan | 2011-09-12 23:08:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-16 18:50:25 +0100 |
commit | 1458fab82c4dab9901d81419e6b515f47ea7320f (patch) | |
tree | 674a9ff24d27da1f5d47d77def4c92206983f376 /OpenSim/ApplicationPlugins | |
parent | Pass any region scope through to the CreateUser() method (diff) | |
download | opensim-SC_OLD-1458fab82c4dab9901d81419e6b515f47ea7320f.zip opensim-SC_OLD-1458fab82c4dab9901d81419e6b515f47ea7320f.tar.gz opensim-SC_OLD-1458fab82c4dab9901d81419e6b515f47ea7320f.tar.bz2 opensim-SC_OLD-1458fab82c4dab9901d81419e6b515f47ea7320f.tar.xz |
Reattaching a region was failing if the estate name had not changed (issue 5035).
Using the RemoteAdmin API to close then recreate a region would fail if the estate name had not changed. If the estate name /was/ changed then the existing estate would be renamed rather than a new one being created. The problem really arose from a lack of distinction in the data storage layer between creating new estates and loading existing ones.
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-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 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 |