diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs index 461c651070..74612bb7e6 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 fd8c4dd119..b7b9adbef7 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 dbc401bff2..6474feb0e7 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) + { + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } + + if (m_enabled) + { + authenticate = true; + welcomeMessage = "Welcome to OpenSim"; + IConfig standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) + { + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); + } + } + } + + 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) { - 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 0000000000..6a55ce815f --- /dev/null +++ b/OpenSim/Client/Linden/Resources/LindenModules.addin.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/prebuild.xml b/prebuild.xml index 4655c0f27b..102805df15 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2223,6 +2223,7 @@ +