From a85f496f4d097a4441ae9e6df8e282c4b327e75a Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Thu, 21 May 2009 20:28:59 +0000 Subject: * Upgraded LLStandaloneLoginModule, LLProxyLoginModule and LLClientStackModule to new region modules. This was needed because the stand alone and grid modules weren't deleting old scenes, which caused an issue when deleting and recreating a region with same name on same x,y coordinates. Tested it on standalone and issue is fixed. Requires prebuild to be run again. Fixes Mantis #3699 --- OpenSim/Client/Linden/LLStandaloneLoginModule.cs | 72 +++++++++++++++++------- 1 file changed, 52 insertions(+), 20 deletions(-) (limited to 'OpenSim/Client/Linden/LLStandaloneLoginModule.cs') diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index dbc401b..6474feb 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -44,7 +44,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Client.Linden { - public class LLStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector + public class LLStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -53,6 +53,8 @@ namespace OpenSim.Client.Linden protected bool m_enabled = false; // Module is only enabled if running in standalone mode + protected bool authenticate; + protected string welcomeMessage; public bool RegionLoginsEnabled { @@ -68,38 +70,44 @@ namespace OpenSim.Client.Linden } } } - + protected LLStandaloneLoginService m_loginService; #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - if (m_firstScene == null) + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) { - m_firstScene = scene; + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } - IConfig startupConfig = source.Configs["Startup"]; - if (startupConfig != null) + if (m_enabled) + { + authenticate = true; + welcomeMessage = "Welcome to OpenSim"; + IConfig standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) { - m_enabled = !startupConfig.GetBoolean("gridmode", false); + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); } + } + } + + public void AddRegion(Scene scene) + { + if (m_firstScene == null) + { + m_firstScene = scene; if (m_enabled) { - bool authenticate = true; - string welcomeMessage = "Welcome to OpenSim"; - IConfig standaloneConfig = source.Configs["StandAlone"]; - if (standaloneConfig != null) - { - authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); - welcomeMessage = standaloneConfig.GetString("welcome_message"); - } - //TODO: fix casting. - LibraryRootFolder rootFolder + LibraryRootFolder rootFolder = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - + IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference @@ -121,6 +129,14 @@ namespace OpenSim.Client.Linden } } + public void RemoveRegion(Scene scene) + { + if (m_enabled) + { + RemoveScene(scene); + } + } + public void PostInitialise() { @@ -131,6 +147,11 @@ namespace OpenSim.Client.Linden } + public void RegionLoaded(Scene scene) + { + + } + public string Name { get { return "LLStandaloneLoginModule"; } @@ -154,6 +175,17 @@ namespace OpenSim.Client.Linden } } + protected void RemoveScene(Scene scene) + { + lock (m_scenes) + { + if (m_scenes.Contains(scene)) + { + m_scenes.Remove(scene); + } + } + } + public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason) { Scene scene; -- cgit v1.1