Really make module port selection work. Implement port setting in

LLProxyLoginModule.
prioritization
Melanie 2009-10-21 02:19:45 +01:00
parent f568982e69
commit 2a886fd76c
4 changed files with 46 additions and 7 deletions

View File

@ -93,7 +93,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
{ {
// Get the config string // Get the config string
string moduleString = string moduleString =
modulesConfig.GetString(node.Id, String.Empty); modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// We have a selector // We have a selector
if (moduleString != String.Empty) if (moduleString != String.Empty)
@ -121,6 +121,31 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
} }
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null) else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{ {
// Get the config string
string moduleString =
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// We have a selector
if (moduleString != String.Empty)
{
// Allow disabling modules even if they don't have
// support for it
if (moduleString == "disabled")
continue;
// Split off port, if present
string[] moduleParts = moduleString.Split(new char[] {'/'}, 2);
// Format is [port/][class]
string className = moduleParts[0];
if (moduleParts.Length > 1)
className = moduleParts[1];
// Match the class name if given
if (className != String.Empty &&
node.Type.ToString() != className)
continue;
}
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type); m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node); m_nonSharedModules.Add(node);
} }
@ -137,11 +162,11 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
// //
foreach (TypeExtensionNode node in m_sharedModules) foreach (TypeExtensionNode node in m_sharedModules)
{ {
Object[] ctorArgs = new Object[] {0}; Object[] ctorArgs = new Object[] {(uint)0};
// Read the config again // Read the config again
string moduleString = string moduleString =
modulesConfig.GetString(node.Id, String.Empty); modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// Get the port number, if there is one // Get the port number, if there is one
if (moduleString != String.Empty) if (moduleString != String.Empty)
@ -302,7 +327,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
// Read the config // Read the config
string moduleString = string moduleString =
modulesConfig.GetString(node.Id, String.Empty); modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// Get the port number, if there is one // Get the port number, if there is one
if (moduleString != String.Empty) if (moduleString != String.Empty)

View File

@ -50,8 +50,16 @@ namespace OpenSim.Client.Linden
/// </summary> /// </summary>
public class LLProxyLoginModule : ISharedRegionModule public class LLProxyLoginModule : ISharedRegionModule
{ {
private uint m_port = 0;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public LLProxyLoginModule(uint port)
{
m_log.DebugFormat("[CLIENT]: LLProxyLoginModule port {0}", port);
m_port = port;
}
protected bool RegionLoginsEnabled protected bool RegionLoginsEnabled
{ {
get get
@ -148,8 +156,8 @@ namespace OpenSim.Client.Linden
protected void AddHttpHandlers() protected void AddHttpHandlers()
{ {
//we will add our handlers to the first scene we received, as all scenes share a http server. But will this ever change? //we will add our handlers to the first scene we received, as all scenes share a http server. But will this ever change?
MainServer.Instance.AddXmlRPCHandler("expect_user", ExpectUser, false); MainServer.GetHttpServer(m_port).AddXmlRPCHandler("expect_user", ExpectUser, false);
MainServer.Instance.AddXmlRPCHandler("logoff_user", LogOffUser, false); MainServer.GetHttpServer(m_port).AddXmlRPCHandler("logoff_user", LogOffUser, false);
} }
protected void AddScene(Scene scene) protected void AddScene(Scene scene)

View File

@ -42,8 +42,10 @@ namespace OpenSim.Framework
set { instance = value; } set { instance = value; }
} }
public IHttpServer GetHttpServer(uint port) public static IHttpServer GetHttpServer(uint port)
{ {
if (port == 0)
return Instance;
if (port == Instance.Port) if (port == Instance.Port)
return Instance; return Instance;

View File

@ -32,3 +32,7 @@
;Include-CenomeCache = "config-include/CenomeCache.ini" ;Include-CenomeCache = "config-include/CenomeCache.ini"
;AssetCaching = "GlynnTuckerAssetCache" ;AssetCaching = "GlynnTuckerAssetCache"
;; Optionally, the port for the LLProxyLoginModule module can be changed
;Setup_LLProxyLoginModule = "9090/"