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/LLClientStackModule.cs | 24 ++++++-- OpenSim/Client/Linden/LLProxyLoginModule.cs | 50 +++++++++++---- OpenSim/Client/Linden/LLStandaloneLoginModule.cs | 72 ++++++++++++++++------ .../Linden/Resources/LindenModules.addin.xml | 15 +++++ 4 files changed, 125 insertions(+), 36 deletions(-) create mode 100644 OpenSim/Client/Linden/Resources/LindenModules.addin.xml (limited to 'OpenSim') diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs index 461c651..74612bb 100644 --- a/OpenSim/Client/Linden/LLClientStackModule.cs +++ b/OpenSim/Client/Linden/LLClientStackModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Client.Linden { - public class LLClientStackModule : IRegionModule + public class LLClientStackModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -55,11 +55,10 @@ namespace OpenSim.Client.Linden protected string m_clientStackDll = "OpenSim.Region.ClientStack.LindenUDP.dll"; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { if (m_scene == null) { - m_scene = scene; m_source = source; IConfig startupConfig = m_source.Configs["Startup"]; @@ -70,8 +69,23 @@ namespace OpenSim.Client.Linden } } - public void PostInitialise() + public void AddRegion(Scene scene) { + + } + + public void RemoveRegion(Scene scene) + { + + } + + public void RegionLoaded(Scene scene) + { + if (m_scene == null) + { + m_scene = scene; + } + if ((m_scene != null) && (m_createClientStack)) { m_log.Info("[LLClientStackModule] Starting up LLClientStack."); diff --git a/OpenSim/Client/Linden/LLProxyLoginModule.cs b/OpenSim/Client/Linden/LLProxyLoginModule.cs index fd8c4dd..b7b9adb 100644 --- a/OpenSim/Client/Linden/LLProxyLoginModule.cs +++ b/OpenSim/Client/Linden/LLProxyLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -48,7 +48,7 @@ namespace OpenSim.Client.Linden /// /// Handles login user (expect user) and logoff user messages from the remote LL login server /// - public class LLProxyLoginModule : IRegionModule + public class LLProxyLoginModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -74,18 +74,21 @@ namespace OpenSim.Client.Linden #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_enabled = startupConfig.GetBoolean("gridmode", false); + } + } + + public void AddRegion(Scene scene) { if (m_firstScene == null) { m_firstScene = scene; - IConfig startupConfig = source.Configs["Startup"]; - if (startupConfig != null) - { - m_enabled = startupConfig.GetBoolean("gridmode", false); - } - if (m_enabled) { AddHttpHandlers(); @@ -96,6 +99,15 @@ namespace OpenSim.Client.Linden { AddScene(scene); } + + } + + public void RemoveRegion(Scene scene) + { + if (m_enabled) + { + RemoveScene(scene); + } } public void PostInitialise() @@ -108,6 +120,11 @@ namespace OpenSim.Client.Linden } + public void RegionLoaded(Scene scene) + { + + } + public string Name { get { return "LLProxyLoginModule"; } @@ -140,6 +157,17 @@ namespace OpenSim.Client.Linden } } } + + protected void RemoveScene(Scene scene) + { + lock (m_scenes) + { + if (m_scenes.Contains(scene)) + { + m_scenes.Remove(scene); + } + } + } /// /// Received from the user server when a user starts logging in. This call allows /// the region to prepare for direct communication from the client. Sends back an empty @@ -200,7 +228,7 @@ namespace OpenSim.Client.Linden { bool success = false; string denyMess = ""; - + Scene scene; if (TryGetRegion(regionHandle, out scene)) { @@ -226,7 +254,7 @@ namespace OpenSim.Client.Linden agentData.firstname, agentData.lastname); } } - + } else { 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; diff --git a/OpenSim/Client/Linden/Resources/LindenModules.addin.xml b/OpenSim/Client/Linden/Resources/LindenModules.addin.xml new file mode 100644 index 0000000..6a55ce8 --- /dev/null +++ b/OpenSim/Client/Linden/Resources/LindenModules.addin.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + -- cgit v1.1