aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2009-10-21 02:19:45 +0100
committerMelanie2009-10-21 02:19:45 +0100
commit2a886fd76c9df972fa3096d19b37047f7eda672f (patch)
treeb40b4af467af8c72b48714c4d691aedbd2e67a63 /OpenSim
parentCleanup and comment the region module loader. Add support for configuring (diff)
downloadopensim-SC_OLD-2a886fd76c9df972fa3096d19b37047f7eda672f.zip
opensim-SC_OLD-2a886fd76c9df972fa3096d19b37047f7eda672f.tar.gz
opensim-SC_OLD-2a886fd76c9df972fa3096d19b37047f7eda672f.tar.bz2
opensim-SC_OLD-2a886fd76c9df972fa3096d19b37047f7eda672f.tar.xz
Really make module port selection work. Implement port setting in
LLProxyLoginModule.
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs33
-rw-r--r--OpenSim/Client/Linden/LLProxyLoginModule.cs12
-rw-r--r--OpenSim/Framework/MainServer.cs4
3 files changed, 42 insertions, 7 deletions
diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
index 13cb34c..ddc37ed 100644
--- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
@@ -93,7 +93,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
93 { 93 {
94 // Get the config string 94 // Get the config string
95 string moduleString = 95 string moduleString =
96 modulesConfig.GetString(node.Id, String.Empty); 96 modulesConfig.GetString("Setup_" + node.Id, String.Empty);
97 97
98 // We have a selector 98 // We have a selector
99 if (moduleString != String.Empty) 99 if (moduleString != String.Empty)
@@ -121,6 +121,31 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
121 } 121 }
122 else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null) 122 else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
123 { 123 {
124 // Get the config string
125 string moduleString =
126 modulesConfig.GetString("Setup_" + node.Id, String.Empty);
127
128 // We have a selector
129 if (moduleString != String.Empty)
130 {
131 // Allow disabling modules even if they don't have
132 // support for it
133 if (moduleString == "disabled")
134 continue;
135
136 // Split off port, if present
137 string[] moduleParts = moduleString.Split(new char[] {'/'}, 2);
138 // Format is [port/][class]
139 string className = moduleParts[0];
140 if (moduleParts.Length > 1)
141 className = moduleParts[1];
142
143 // Match the class name if given
144 if (className != String.Empty &&
145 node.Type.ToString() != className)
146 continue;
147 }
148
124 m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type); 149 m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
125 m_nonSharedModules.Add(node); 150 m_nonSharedModules.Add(node);
126 } 151 }
@@ -137,11 +162,11 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
137 // 162 //
138 foreach (TypeExtensionNode node in m_sharedModules) 163 foreach (TypeExtensionNode node in m_sharedModules)
139 { 164 {
140 Object[] ctorArgs = new Object[] {0}; 165 Object[] ctorArgs = new Object[] {(uint)0};
141 166
142 // Read the config again 167 // Read the config again
143 string moduleString = 168 string moduleString =
144 modulesConfig.GetString(node.Id, String.Empty); 169 modulesConfig.GetString("Setup_" + node.Id, String.Empty);
145 170
146 // Get the port number, if there is one 171 // Get the port number, if there is one
147 if (moduleString != String.Empty) 172 if (moduleString != String.Empty)
@@ -302,7 +327,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
302 327
303 // Read the config 328 // Read the config
304 string moduleString = 329 string moduleString =
305 modulesConfig.GetString(node.Id, String.Empty); 330 modulesConfig.GetString("Setup_" + node.Id, String.Empty);
306 331
307 // Get the port number, if there is one 332 // Get the port number, if there is one
308 if (moduleString != String.Empty) 333 if (moduleString != String.Empty)
diff --git a/OpenSim/Client/Linden/LLProxyLoginModule.cs b/OpenSim/Client/Linden/LLProxyLoginModule.cs
index 2da774f..ad67c44 100644
--- a/OpenSim/Client/Linden/LLProxyLoginModule.cs
+++ b/OpenSim/Client/Linden/LLProxyLoginModule.cs
@@ -50,8 +50,16 @@ namespace OpenSim.Client.Linden
50 /// </summary> 50 /// </summary>
51 public class LLProxyLoginModule : ISharedRegionModule 51 public class LLProxyLoginModule : ISharedRegionModule
52 { 52 {
53 private uint m_port = 0;
54
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 55 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 56
57 public LLProxyLoginModule(uint port)
58 {
59 m_log.DebugFormat("[CLIENT]: LLProxyLoginModule port {0}", port);
60 m_port = port;
61 }
62
55 protected bool RegionLoginsEnabled 63 protected bool RegionLoginsEnabled
56 { 64 {
57 get 65 get
@@ -148,8 +156,8 @@ namespace OpenSim.Client.Linden
148 protected void AddHttpHandlers() 156 protected void AddHttpHandlers()
149 { 157 {
150 //we will add our handlers to the first scene we received, as all scenes share a http server. But will this ever change? 158 //we will add our handlers to the first scene we received, as all scenes share a http server. But will this ever change?
151 MainServer.Instance.AddXmlRPCHandler("expect_user", ExpectUser, false); 159 MainServer.GetHttpServer(m_port).AddXmlRPCHandler("expect_user", ExpectUser, false);
152 MainServer.Instance.AddXmlRPCHandler("logoff_user", LogOffUser, false); 160 MainServer.GetHttpServer(m_port).AddXmlRPCHandler("logoff_user", LogOffUser, false);
153 } 161 }
154 162
155 protected void AddScene(Scene scene) 163 protected void AddScene(Scene scene)
diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs
index 21033b3..7da4893 100644
--- a/OpenSim/Framework/MainServer.cs
+++ b/OpenSim/Framework/MainServer.cs
@@ -42,8 +42,10 @@ namespace OpenSim.Framework
42 set { instance = value; } 42 set { instance = value; }
43 } 43 }
44 44
45 public IHttpServer GetHttpServer(uint port) 45 public static IHttpServer GetHttpServer(uint port)
46 { 46 {
47 if (port == 0)
48 return Instance;
47 if (port == Instance.Port) 49 if (port == Instance.Port)
48 return Instance; 50 return Instance;
49 51