aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authormeta72010-08-18 02:53:27 -0700
committermeta72010-08-18 02:53:27 -0700
commitca8b1e488c167e5644567cb001c9c2a6504f15f7 (patch)
tree2a99b396dd4ccbd6c801efc0890fad1bd94b45e2 /OpenSim/ApplicationPlugins
parentFix a nullref exception in the prioritizer (diff)
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC-ca8b1e488c167e5644567cb001c9c2a6504f15f7.zip
opensim-SC-ca8b1e488c167e5644567cb001c9c2a6504f15f7.tar.gz
opensim-SC-ca8b1e488c167e5644567cb001c9c2a6504f15f7.tar.bz2
opensim-SC-ca8b1e488c167e5644567cb001c9c2a6504f15f7.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs2
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs92
2 files changed, 67 insertions, 27 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index 1e85a22..b16f46c 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -122,7 +122,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
122 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + 122 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
123 Thread.CurrentThread.ManagedThreadId.ToString() + 123 Thread.CurrentThread.ManagedThreadId.ToString() +
124 ")"); 124 ")");
125 m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
125 m_openSim.CreateRegion(regionsToLoad[i], true, out scene); 126 m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
127 regionsToLoad[i].EstateSettings.Save();
126 if (scene != null) 128 if (scene != null)
127 { 129 {
128 m_newRegionCreatedHandler = OnNewRegionCreated; 130 m_newRegionCreatedHandler = OnNewRegionCreated;
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 026c6ed..826a1b0 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -562,12 +562,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
562 /// <description>desired region X coordinate (integer)</description></item> 562 /// <description>desired region X coordinate (integer)</description></item>
563 /// <item><term>region_y</term> 563 /// <item><term>region_y</term>
564 /// <description>desired region Y coordinate (integer)</description></item> 564 /// <description>desired region Y coordinate (integer)</description></item>
565 /// <item><term>region_master_first</term> 565 /// <item><term>estate_owner_first</term>
566 /// <description>firstname of region master</description></item> 566 /// <description>firstname of estate owner (formerly region master)
567 /// <item><term>region_master_last</term> 567 /// (required if new estate is being created, optional otherwise)</description></item>
568 /// <description>lastname of region master</description></item> 568 /// <item><term>estate_owner_last</term>
569 /// <item><term>region_master_uuid</term> 569 /// <description>lastname of estate owner (formerly region master)
570 /// <description>explicit UUID to use for master avatar (optional)</description></item> 570 /// (required if new estate is being created, optional otherwise)</description></item>
571 /// <item><term>estate_owner_uuid</term>
572 /// <description>explicit UUID to use for estate owner (optional)</description></item>
571 /// <item><term>listen_ip</term> 573 /// <item><term>listen_ip</term>
572 /// <description>internal IP address (dotted quad)</description></item> 574 /// <description>internal IP address (dotted quad)</description></item>
573 /// <item><term>listen_port</term> 575 /// <item><term>listen_port</term>
@@ -583,6 +585,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
583 /// <item><term>enable_voice</term> 585 /// <item><term>enable_voice</term>
584 /// <description>if true, enable voice on all parcels, 586 /// <description>if true, enable voice on all parcels,
585 /// ('true' or 'false') (optional, default: false)</description></item> 587 /// ('true' or 'false') (optional, default: false)</description></item>
588 /// <item><term>estate_name</term>
589 /// <description>the name of the estate to join (or to create if it doesn't
590 /// already exist)</description></item>
586 /// </list> 591 /// </list>
587 /// 592 ///
588 /// XmlRpcCreateRegionMethod returns 593 /// XmlRpcCreateRegionMethod returns
@@ -621,9 +626,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
621 { 626 {
622 "password", 627 "password",
623 "region_name", 628 "region_name",
624 "region_master_first", "region_master_last", 629 "listen_ip", "external_address",
625 "region_master_password", 630 "estate_name"
626 "listen_ip", "external_address"
627 }); 631 });
628 CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); 632 CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"});
629 633
@@ -694,18 +698,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
694 698
695 region.ExternalHostName = (string) requestData["external_address"]; 699 region.ExternalHostName = (string) requestData["external_address"];
696 700
697 string masterFirst = (string) requestData["region_master_first"];
698 string masterLast = (string) requestData["region_master_last"];
699 string masterPassword = (string) requestData["region_master_password"];
700
701 UUID userID = UUID.Zero;
702 if (requestData.ContainsKey("region_master_uuid"))
703 {
704 // ok, client wants us to use an explicit UUID
705 // regardless of what the avatar name provided
706 userID = new UUID((string) requestData["estate_owner_uuid"]);
707 }
708
709 bool persist = Convert.ToBoolean((string) requestData["persist"]); 701 bool persist = Convert.ToBoolean((string) requestData["persist"]);
710 if (persist) 702 if (persist)
711 { 703 {
@@ -740,7 +732,55 @@ namespace OpenSim.ApplicationPlugins.RemoteController
740 { 732 {
741 region.Persistent = false; 733 region.Persistent = false;
742 } 734 }
743 735
736 // Set the estate
737
738 // Check for an existing estate
739 List<int> estateIDs = m_application.StorageManager.EstateDataStore.GetEstates((string) requestData["estate_name"]);
740 if (estateIDs.Count < 1)
741 {
742 UUID userID = UUID.Zero;
743 if (requestData.ContainsKey("estate_owner_uuid"))
744 {
745 // ok, client wants us to use an explicit UUID
746 // regardless of what the avatar name provided
747 userID = new UUID((string) requestData["estate_owner_uuid"]);
748 }
749 else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last"))
750 {
751 // We need to look up the UUID for the avatar with the provided name.
752 string ownerFirst = (string) requestData["estate_owner_first"];
753 string ownerLast = (string) requestData["estate_owner_last"];
754
755 Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
756 IUserAccountService accountService = currentOrFirst.UserAccountService;
757 UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
758 ownerFirst, ownerLast);
759 userID = user.PrincipalID;
760 }
761 else
762 {
763 throw new Exception("Estate owner details not provided.");
764 }
765
766 // Create a new estate with the name provided
767 region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(region.RegionID, true);
768
769 region.EstateSettings.EstateName = (string) requestData["estate_name"];
770 region.EstateSettings.EstateOwner = userID;
771 // Persistence does not seem to effect the need to save a new estate
772 region.EstateSettings.Save();
773 }
774 else
775 {
776 int estateID = estateIDs[0];
777
778 region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(estateID);
779
780 if (!m_application.StorageManager.EstateDataStore.LinkRegion(region.RegionID, estateID))
781 throw new Exception("Failed to join estate.");
782 }
783
744 // Create the region and perform any initial initialization 784 // Create the region and perform any initial initialization
745 785
746 IScene newScene; 786 IScene newScene;
@@ -749,9 +789,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
749 // If an access specification was provided, use it. 789 // If an access specification was provided, use it.
750 // Otherwise accept the default. 790 // Otherwise accept the default.
751 newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess); 791 newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess);
752 newScene.RegionInfo.EstateSettings.EstateOwner = userID; 792 newScene.RegionInfo.EstateSettings.Save();
753 if (persist)
754 newScene.RegionInfo.EstateSettings.Save();
755 793
756 // enable voice on newly created region if 794 // enable voice on newly created region if
757 // requested by either the XmlRpc request or the 795 // requested by either the XmlRpc request or the
@@ -1615,7 +1653,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1615 if (destinationFolder.Type != (short)AssetType.Clothing) 1653 if (destinationFolder.Type != (short)AssetType.Clothing)
1616 { 1654 {
1617 destinationFolder = new InventoryFolderBase(); 1655 destinationFolder = new InventoryFolderBase();
1618 1656
1619 destinationFolder.ID = UUID.Random(); 1657 destinationFolder.ID = UUID.Random();
1620 destinationFolder.Name = "Clothing"; 1658 destinationFolder.Name = "Clothing";
1621 destinationFolder.Owner = destination; 1659 destinationFolder.Owner = destination;
@@ -3100,7 +3138,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
3100 /// <param name="password"></param> 3138 /// <param name="password"></param>
3101 private bool ChangeUserPassword(string firstName, string lastName, string password) 3139 private bool ChangeUserPassword(string firstName, string lastName, string password)
3102 { 3140 {
3103 Scene scene = m_application.SceneManager.CurrentOrFirstScene; 3141 Scene scene = m_application.SceneManager.CurrentOrFirstScene;
3104 IUserAccountService userAccountService = scene.UserAccountService; 3142 IUserAccountService userAccountService = scene.UserAccountService;
3105 IAuthenticationService authenticationService = scene.AuthenticationService; 3143 IAuthenticationService authenticationService = scene.AuthenticationService;
3106 3144