From 522d6261f11ffaf8320c3f0775beb5d0608ce226 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Sep 2011 00:12:12 +0100 Subject: Correctly create a freshly created estate owner's default items and avatar entries on standalone if applicable. --- OpenSim/Region/Framework/Scenes/Scene.cs | 82 -------------------------------- 1 file changed, 82 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f394a95..976e001 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1170,88 +1170,6 @@ namespace OpenSim.Region.Framework.Scenes m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); m_teleportModule = RequestModuleInterface(); - - // Shoving this in here for now, because we have the needed - // interfaces at this point - // - // TODO: Find a better place for this - // - while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) - { - MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", m_regInfo.EstateSettings.EstateName); - List excluded = new List(new char[1]{' '}); - string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); - string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); - - UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last); - - if (account == null) - { - // Create a new account - account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty); - if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) - { - account.ServiceURLs = new Dictionary(); - account.ServiceURLs["HomeURI"] = string.Empty; - account.ServiceURLs["GatekeeperURI"] = string.Empty; - account.ServiceURLs["InventoryServerURI"] = string.Empty; - account.ServiceURLs["AssetServerURI"] = string.Empty; - } - - if (UserAccountService.StoreUserAccount(account)) - { - string password = MainConsole.Instance.PasswdPrompt("Password"); - string email = MainConsole.Instance.CmdPrompt("Email", ""); - - account.Email = email; - UserAccountService.StoreUserAccount(account); - - bool success = false; - success = AuthenticationService.SetPassword(account.PrincipalID, password); - if (!success) - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.", - first, last); - - GridRegion home = null; - if (GridService != null) - { - List defaultRegions = GridService.GetDefaultRegions(UUID.Zero); - if (defaultRegions != null && defaultRegions.Count >= 1) - home = defaultRegions[0]; - - if (GridUserService != null && home != null) - GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); - else - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.", - first, last); - - } - else - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.", - first, last); - - if (InventoryService != null) - success = InventoryService.CreateUserInventory(account.PrincipalID); - if (!success) - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", - first, last); - - - - m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last); - - m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; - m_regInfo.EstateSettings.Save(); - } - else - m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); - } - else - { - m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; - m_regInfo.EstateSettings.Save(); - } - } } #endregion -- cgit v1.1