diff options
author | MW | 2009-02-26 21:30:12 +0000 |
---|---|---|
committer | MW | 2009-02-26 21:30:12 +0000 |
commit | e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5 (patch) | |
tree | 8be1ecceedead7721711a8554c8ae70c8072bbfc | |
parent | * This patch reduces the excessive number of threads opened by the Timer even... (diff) | |
download | opensim-SC-e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5.zip opensim-SC-e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5.tar.gz opensim-SC-e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5.tar.bz2 opensim-SC-e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5.tar.xz |
Moved the Initialisation of the CommunicationsManager to a ApplicationPlugin.
Also in that plugin it registers the IUserService with all the Scenes (as they are created). So now we can start changing over all uses of IUserService, that currently access it from the CommunicationsManager to accessing it from the Scene.RequestModuleInterface call.
Once that is done we can move the UserService creation out to its own plugin and remove all references to it from the CommunicationsManager. Then we can take the next CommunicationsManager interface and repeat.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs | 253 | ||||
-rw-r--r-- | OpenSim/ApplicationPlugins/CreateCommsManager/Resources/CreateCommsManagerPlugin.addin.xml | 11 | ||||
-rw-r--r-- | OpenSim/Framework/IScene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Application/HGOpenSimNode.cs | 74 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 125 | ||||
-rw-r--r-- | prebuild.xml | 42 |
6 files changed, 407 insertions, 101 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs new file mode 100644 index 0000000..a5a4470 --- /dev/null +++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs | |||
@@ -0,0 +1,253 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Threading; | ||
32 | using log4net; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Framework.RegionLoader.Filesystem; | ||
35 | using OpenSim.Framework.RegionLoader.Web; | ||
36 | using OpenSim.Region.CoreModules.Agent.AssetTransaction; | ||
37 | using OpenSim.Region.CoreModules.Avatar.InstantMessage; | ||
38 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; | ||
39 | using OpenSim.Region.CoreModules.Scripting.LoadImageURL; | ||
40 | using OpenSim.Region.CoreModules.Scripting.XMLRPC; | ||
41 | using OpenSim.Framework.Communications; | ||
42 | using OpenSim.Framework.Communications.Cache; | ||
43 | using OpenSim.Region.Communications.Hypergrid; | ||
44 | using OpenSim.Region.Communications.Local; | ||
45 | using OpenSim.Region.Communications.OGS1; | ||
46 | using OpenSim.Framework.Servers; | ||
47 | using OpenSim.ApplicationPlugins.LoadRegions; | ||
48 | |||
49 | namespace OpenSim.ApplicationPlugins.CreateCommsManager | ||
50 | { | ||
51 | public class CreateCommsManagerPlugin : IApplicationPlugin | ||
52 | { | ||
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
54 | |||
55 | #region IApplicationPlugin Members | ||
56 | |||
57 | // TODO: required by IPlugin, but likely not at all right | ||
58 | string m_name = "CreateCommsManagerPlugin"; | ||
59 | string m_version = "0.0"; | ||
60 | |||
61 | public string Version { get { return m_version; } } | ||
62 | public string Name { get { return m_name; } } | ||
63 | |||
64 | protected OpenSimBase m_openSim; | ||
65 | |||
66 | protected BaseHttpServer m_httpServer; | ||
67 | protected CommunicationsManager m_commsManager; | ||
68 | protected GridInfoService m_gridInfoService; | ||
69 | protected IHyperlink HGServices = null; | ||
70 | |||
71 | protected LoadRegionsPlugin m_loadRegionsPlugin; | ||
72 | |||
73 | public void Initialise() | ||
74 | { | ||
75 | m_log.Info("[LOADREGIONS]: " + Name + " cannot be default-initialized!"); | ||
76 | throw new PluginNotInitialisedException(Name); | ||
77 | } | ||
78 | |||
79 | public void Initialise(OpenSimBase openSim) | ||
80 | { | ||
81 | m_openSim = openSim; | ||
82 | m_httpServer = openSim.HttpServer; | ||
83 | |||
84 | InitialiseCommsManager(openSim); | ||
85 | if (m_commsManager != null) | ||
86 | { | ||
87 | m_openSim.ApplicationRegistry.RegisterInterface<IUserService>(m_commsManager.UserService); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | public void PostInitialise() | ||
92 | { | ||
93 | if (m_openSim.ApplicationRegistry.TryGet<LoadRegionsPlugin>(out m_loadRegionsPlugin)) | ||
94 | { | ||
95 | m_loadRegionsPlugin.OnNewRegionCreated += RegionCreated; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | public void Dispose() | ||
100 | { | ||
101 | } | ||
102 | |||
103 | #endregion | ||
104 | |||
105 | private void RegionCreated(IScene scene) | ||
106 | { | ||
107 | if (m_commsManager != null) | ||
108 | { | ||
109 | scene.RegisterModuleInterface<IUserService>(m_commsManager.UserService); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | private void InitialiseCommsManager(OpenSimBase openSim) | ||
114 | { | ||
115 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile); | ||
116 | |||
117 | if ((openSim is OpenSim) || (openSim is OpenSimBackground)) | ||
118 | { | ||
119 | // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) | ||
120 | if (m_openSim.ConfigurationSettings.Standalone) | ||
121 | { | ||
122 | InitialiseStandaloneServices(libraryRootFolder); | ||
123 | } | ||
124 | else | ||
125 | { | ||
126 | // We are in grid mode | ||
127 | InitialiseGridServices(libraryRootFolder); | ||
128 | } | ||
129 | } | ||
130 | else if (openSim is HGOpenSimNode) | ||
131 | { | ||
132 | HGOpenSimNode hgNode = (HGOpenSimNode)openSim; | ||
133 | |||
134 | // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) | ||
135 | if (m_openSim.ConfigurationSettings.Standalone) | ||
136 | { | ||
137 | InitialiseHGStandaloneServices(libraryRootFolder); | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | // We are in grid mode | ||
142 | InitialiseHGGridServices(libraryRootFolder); | ||
143 | } | ||
144 | hgNode.HGServices = HGServices; | ||
145 | } | ||
146 | |||
147 | openSim.CommunicationsManager = m_commsManager; | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
151 | /// Initialises the backend services for standalone mode, and registers some http handlers | ||
152 | /// </summary> | ||
153 | /// <param name="libraryRootFolder"></param> | ||
154 | protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) | ||
155 | { | ||
156 | LocalInventoryService inventoryService = new LocalInventoryService(); | ||
157 | inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource); | ||
158 | |||
159 | LocalUserServices userService = | ||
160 | new LocalUserServices( | ||
161 | m_openSim.NetServersInfo.DefaultHomeLocX, m_openSim.NetServersInfo.DefaultHomeLocY, inventoryService); | ||
162 | userService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneUserPlugin, m_openSim.ConfigurationSettings.StandaloneUserSource); | ||
163 | |||
164 | LocalBackEndServices backendService = new LocalBackEndServices(); | ||
165 | |||
166 | LocalLoginService loginService = | ||
167 | new LocalLoginService( | ||
168 | userService, m_openSim.ConfigurationSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_openSim.NetServersInfo, | ||
169 | m_openSim.ConfigurationSettings.StandaloneAuthenticate, libraryRootFolder); | ||
170 | |||
171 | m_commsManager | ||
172 | = new CommunicationsLocal( | ||
173 | m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, userService, userService, | ||
174 | inventoryService, backendService, userService, | ||
175 | libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile); | ||
176 | |||
177 | // set up XMLRPC handler for client's initial login request message | ||
178 | m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); | ||
179 | |||
180 | // provides the web form login | ||
181 | m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); | ||
182 | |||
183 | // Provides the LLSD login | ||
184 | m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); | ||
185 | |||
186 | // provide grid info | ||
187 | // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); | ||
188 | m_gridInfoService = new GridInfoService(m_openSim.ConfigSource.Source); | ||
189 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | ||
190 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | ||
191 | } | ||
192 | |||
193 | protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder) | ||
194 | { | ||
195 | m_commsManager | ||
196 | = new CommunicationsOGS1(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, libraryRootFolder); | ||
197 | |||
198 | m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); | ||
199 | } | ||
200 | |||
201 | protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder) | ||
202 | { | ||
203 | // Standalone mode | ||
204 | |||
205 | HGInventoryService inventoryService = new HGInventoryService(m_openSim.NetServersInfo.InventoryURL, null, false); | ||
206 | inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource); | ||
207 | |||
208 | LocalUserServices userService = | ||
209 | new LocalUserServices( | ||
210 | m_openSim.NetServersInfo.DefaultHomeLocX, m_openSim.NetServersInfo.DefaultHomeLocY, inventoryService); | ||
211 | userService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneUserPlugin, m_openSim.ConfigurationSettings.StandaloneUserSource); | ||
212 | |||
213 | //LocalBackEndServices backendService = new LocalBackEndServices(); | ||
214 | HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, m_openSim.SceneManager); | ||
215 | |||
216 | LocalLoginService loginService = | ||
217 | new LocalLoginService( | ||
218 | userService, m_openSim.ConfigurationSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_openSim.NetServersInfo, | ||
219 | m_openSim.ConfigurationSettings.StandaloneAuthenticate, libraryRootFolder); | ||
220 | |||
221 | |||
222 | m_commsManager = new HGCommunicationsStandalone(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, | ||
223 | userService, userService, inventoryService, gridService, userService, libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile); | ||
224 | |||
225 | inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; | ||
226 | HGServices = gridService; | ||
227 | |||
228 | // set up XMLRPC handler for client's initial login request message | ||
229 | m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); | ||
230 | |||
231 | // provides the web form login | ||
232 | m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); | ||
233 | |||
234 | // Provides the LLSD login | ||
235 | m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); | ||
236 | |||
237 | // provide grid info | ||
238 | // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); | ||
239 | m_gridInfoService = new GridInfoService(m_openSim.ConfigSource.Source); | ||
240 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | ||
241 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | ||
242 | } | ||
243 | |||
244 | protected virtual void InitialiseHGGridServices(LibraryRootFolder libraryRootFolder) | ||
245 | { | ||
246 | m_commsManager = new HGCommunicationsGridMode(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, m_openSim.SceneManager, libraryRootFolder); | ||
247 | |||
248 | HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; | ||
249 | |||
250 | m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); | ||
251 | } | ||
252 | } | ||
253 | } | ||
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/Resources/CreateCommsManagerPlugin.addin.xml b/OpenSim/ApplicationPlugins/CreateCommsManager/Resources/CreateCommsManagerPlugin.addin.xml new file mode 100644 index 0000000..2a488ef --- /dev/null +++ b/OpenSim/ApplicationPlugins/CreateCommsManager/Resources/CreateCommsManagerPlugin.addin.xml | |||
@@ -0,0 +1,11 @@ | |||
1 | <Addin id="OpenSim.ApplicationPlugins.CreateCommsManager" version="0.1"> | ||
2 | <Runtime> | ||
3 | <Import assembly="OpenSim.ApplicationPlugins.CreateCommsManager.dll"/> | ||
4 | </Runtime> | ||
5 | <Dependencies> | ||
6 | <Addin id="OpenSim" version="0.5" /> | ||
7 | </Dependencies> | ||
8 | <Extension path = "/OpenSim/Startup"> | ||
9 | <Plugin id="CreateCommsManager" type="OpenSim.ApplicationPlugins.CreateCommsManager.CreateCommsManagerPlugin" /> | ||
10 | </Extension> | ||
11 | </Addin> | ||
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index c400309..572d045 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -89,6 +89,9 @@ namespace OpenSim.Framework | |||
89 | T RequestModuleInterface<T>(); | 89 | T RequestModuleInterface<T>(); |
90 | T[] RequestModuleInterfaces<T>(); | 90 | T[] RequestModuleInterfaces<T>(); |
91 | 91 | ||
92 | void RegisterModuleInterface<M>(M mod); | ||
93 | void StackModuleInterface<M>(M mod); | ||
94 | |||
92 | void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback); | 95 | void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback); |
93 | } | 96 | } |
94 | } | 97 | } |
diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs index 1130c70..b0be40d 100644 --- a/OpenSim/Region/Application/HGOpenSimNode.cs +++ b/OpenSim/Region/Application/HGOpenSimNode.cs | |||
@@ -73,57 +73,57 @@ namespace OpenSim | |||
73 | 73 | ||
74 | } | 74 | } |
75 | 75 | ||
76 | protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) | 76 | //protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) |
77 | { | 77 | //{ |
78 | // Standalone mode | 78 | // // Standalone mode |
79 | 79 | ||
80 | HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false); | 80 | // HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false); |
81 | inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); | 81 | // inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); |
82 | 82 | ||
83 | LocalUserServices userService = | 83 | // LocalUserServices userService = |
84 | new LocalUserServices( | 84 | // new LocalUserServices( |
85 | m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); | 85 | // m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); |
86 | userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); | 86 | // userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); |
87 | 87 | ||
88 | //LocalBackEndServices backendService = new LocalBackEndServices(); | 88 | // //LocalBackEndServices backendService = new LocalBackEndServices(); |
89 | HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager); | 89 | // HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager); |
90 | 90 | ||
91 | LocalLoginService loginService = | 91 | // LocalLoginService loginService = |
92 | new LocalLoginService( | 92 | // new LocalLoginService( |
93 | userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo, | 93 | // userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo, |
94 | m_configSettings.StandaloneAuthenticate, libraryRootFolder); | 94 | // m_configSettings.StandaloneAuthenticate, libraryRootFolder); |
95 | 95 | ||
96 | 96 | ||
97 | m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache, | 97 | // m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache, |
98 | userService, userService, inventoryService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile); | 98 | // userService, userService, inventoryService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile); |
99 | 99 | ||
100 | inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; | 100 | // inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; |
101 | HGServices = gridService; | 101 | // HGServices = gridService; |
102 | 102 | ||
103 | // set up XMLRPC handler for client's initial login request message | 103 | // // set up XMLRPC handler for client's initial login request message |
104 | m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); | 104 | // m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); |
105 | 105 | ||
106 | // provides the web form login | 106 | // // provides the web form login |
107 | m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); | 107 | // m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); |
108 | 108 | ||
109 | // Provides the LLSD login | 109 | // // Provides the LLSD login |
110 | m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); | 110 | // m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); |
111 | 111 | ||
112 | // provide grid info | 112 | // // provide grid info |
113 | // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); | 113 | // // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); |
114 | m_gridInfoService = new GridInfoService(m_config.Source); | 114 | // m_gridInfoService = new GridInfoService(m_config.Source); |
115 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | 115 | // m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); |
116 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | 116 | // m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); |
117 | } | 117 | //} |
118 | 118 | ||
119 | protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder) | 119 | //protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder) |
120 | { | 120 | //{ |
121 | m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder); | 121 | // m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder); |
122 | 122 | ||
123 | HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; | 123 | // HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; |
124 | 124 | ||
125 | m_httpServer.AddStreamHandler(new SimStatusHandler()); | 125 | // m_httpServer.AddStreamHandler(new SimStatusHandler()); |
126 | } | 126 | //} |
127 | 127 | ||
128 | protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, | 128 | protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, |
129 | AgentCircuitManager circuitManager) | 129 | AgentCircuitManager circuitManager) |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 6045dc0..3f7c757 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -186,28 +186,25 @@ namespace OpenSim | |||
186 | 186 | ||
187 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_configSettings.LibrariesXMLFile); | 187 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_configSettings.LibrariesXMLFile); |
188 | 188 | ||
189 | // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) | 189 | //// Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) |
190 | if (m_configSettings.Standalone) | 190 | //if (m_configSettings.Standalone) |
191 | { | 191 | //{ |
192 | InitialiseStandaloneServices(libraryRootFolder); | 192 | // InitialiseStandaloneServices(libraryRootFolder); |
193 | } | 193 | //} |
194 | else | 194 | //else |
195 | { | 195 | //{ |
196 | // We are in grid mode | 196 | // // We are in grid mode |
197 | InitialiseGridServices(libraryRootFolder); | 197 | // InitialiseGridServices(libraryRootFolder); |
198 | } | 198 | //} |
199 | 199 | ||
200 | // Create a ModuleLoader instance | 200 | // Create a ModuleLoader instance |
201 | m_moduleLoader = new ModuleLoader(m_config.Source); | 201 | m_moduleLoader = new ModuleLoader(m_config.Source); |
202 | 202 | ||
203 | LoadPlugins(); | 203 | LoadPlugins(); |
204 | |||
205 | |||
206 | foreach (IApplicationPlugin plugin in m_plugins) | 204 | foreach (IApplicationPlugin plugin in m_plugins) |
207 | { | 205 | { |
208 | plugin.PostInitialise(); | 206 | plugin.PostInitialise(); |
209 | } | 207 | } |
210 | |||
211 | 208 | ||
212 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) | 209 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) |
213 | if ((m_commsManager != null) && (m_commsManager.GridService != null)) | 210 | if ((m_commsManager != null) && (m_commsManager.GridService != null)) |
@@ -272,56 +269,56 @@ namespace OpenSim | |||
272 | m_console.Notice(moduleCommander.Help); | 269 | m_console.Notice(moduleCommander.Help); |
273 | } | 270 | } |
274 | 271 | ||
275 | /// <summary> | 272 | ///// <summary> |
276 | /// Initialises the backend services for standalone mode, and registers some http handlers | 273 | ///// Initialises the backend services for standalone mode, and registers some http handlers |
277 | /// </summary> | 274 | ///// </summary> |
278 | /// <param name="libraryRootFolder"></param> | 275 | ///// <param name="libraryRootFolder"></param> |
279 | protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) | 276 | //protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) |
280 | { | 277 | //{ |
281 | LocalInventoryService inventoryService = new LocalInventoryService(); | 278 | // LocalInventoryService inventoryService = new LocalInventoryService(); |
282 | inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); | 279 | // inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); |
283 | 280 | ||
284 | LocalUserServices userService = | 281 | // LocalUserServices userService = |
285 | new LocalUserServices( | 282 | // new LocalUserServices( |
286 | m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); | 283 | // m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); |
287 | userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); | 284 | // userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); |
288 | 285 | ||
289 | LocalBackEndServices backendService = new LocalBackEndServices(); | 286 | // LocalBackEndServices backendService = new LocalBackEndServices(); |
290 | 287 | ||
291 | LocalLoginService loginService = | 288 | // LocalLoginService loginService = |
292 | new LocalLoginService( | 289 | // new LocalLoginService( |
293 | userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_networkServersInfo, | 290 | // userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_networkServersInfo, |
294 | m_configSettings.StandaloneAuthenticate, libraryRootFolder); | 291 | // m_configSettings.StandaloneAuthenticate, libraryRootFolder); |
295 | 292 | ||
296 | m_commsManager | 293 | // m_commsManager |
297 | = new CommunicationsLocal( | 294 | // = new CommunicationsLocal( |
298 | m_networkServersInfo, m_httpServer, m_assetCache, userService, userService, | 295 | // m_networkServersInfo, m_httpServer, m_assetCache, userService, userService, |
299 | inventoryService, backendService, userService, | 296 | // inventoryService, backendService, userService, |
300 | libraryRootFolder, m_configSettings.DumpAssetsToFile); | 297 | // libraryRootFolder, m_configSettings.DumpAssetsToFile); |
301 | 298 | ||
302 | // set up XMLRPC handler for client's initial login request message | 299 | // // set up XMLRPC handler for client's initial login request message |
303 | m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); | 300 | // m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); |
304 | 301 | ||
305 | // provides the web form login | 302 | // // provides the web form login |
306 | m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); | 303 | // m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); |
307 | 304 | ||
308 | // Provides the LLSD login | 305 | // // Provides the LLSD login |
309 | m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); | 306 | // m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); |
310 | 307 | ||
311 | // provide grid info | 308 | // // provide grid info |
312 | // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); | 309 | // // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); |
313 | m_gridInfoService = new GridInfoService(m_config.Source); | 310 | // m_gridInfoService = new GridInfoService(m_config.Source); |
314 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | 311 | // m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); |
315 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | 312 | // m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); |
316 | } | 313 | //} |
317 | 314 | ||
318 | protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder) | 315 | //protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder) |
319 | { | 316 | //{ |
320 | m_commsManager | 317 | // m_commsManager |
321 | = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder); | 318 | // = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder); |
322 | 319 | ||
323 | m_httpServer.AddStreamHandler(new SimStatusHandler()); | 320 | // m_httpServer.AddStreamHandler(new SimStatusHandler()); |
324 | } | 321 | //} |
325 | 322 | ||
326 | protected override void Initialize() | 323 | protected override void Initialize() |
327 | { | 324 | { |
diff --git a/prebuild.xml b/prebuild.xml index 8b388e4..2531e0b 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1429,6 +1429,48 @@ | |||
1429 | </Files> | 1429 | </Files> |
1430 | </Project> | 1430 | </Project> |
1431 | 1431 | ||
1432 | <Project name="OpenSim.ApplicationPlugins.CreateCommsManager" path="OpenSim/ApplicationPlugins/CreateCommsManager" type="Library"> | ||
1433 | <Configuration name="Debug"> | ||
1434 | <Options> | ||
1435 | <OutputPath>../../../bin/</OutputPath> | ||
1436 | </Options> | ||
1437 | </Configuration> | ||
1438 | <Configuration name="Release"> | ||
1439 | <Options> | ||
1440 | <OutputPath>../../../bin/</OutputPath> | ||
1441 | </Options> | ||
1442 | </Configuration> | ||
1443 | |||
1444 | <ReferencePath>../../../bin/</ReferencePath> | ||
1445 | <Reference name="Mono.Addins.dll" /> | ||
1446 | <Reference name="System"/> | ||
1447 | <Reference name="System.Xml"/> | ||
1448 | <Reference name="OpenMetaverseTypes.dll" /> | ||
1449 | <Reference name="OpenMetaverse.StructuredData.dll"/> | ||
1450 | <Reference name="Nini.dll" /> | ||
1451 | <Reference name="OpenSim"/> | ||
1452 | <Reference name="OpenSim.Region.ClientStack"/> | ||
1453 | <Reference name="OpenSim.Region.CoreModules"/> | ||
1454 | <Reference name="OpenSim.Region.Framework"/> | ||
1455 | <Reference name="OpenSim.Framework"/> | ||
1456 | <Reference name="OpenSim.Framework.Console"/> | ||
1457 | <Reference name="OpenSim.Framework.RegionLoader.Filesystem"/> | ||
1458 | <Reference name="OpenSim.Framework.RegionLoader.Web"/> | ||
1459 | <Reference name="OpenSim.Framework.Servers"/> | ||
1460 | <Reference name="log4net.dll"/> | ||
1461 | <Reference name="OpenSim.Region.Communications.OGS1"/> | ||
1462 | <Reference name="XMLRPC.dll"/> | ||
1463 | <Reference name="OpenSim.Region.Communications.Local"/> | ||
1464 | <Reference name="OpenSim.Region.Communications.Hypergrid"/> | ||
1465 | <Reference name="OpenSim.Framework.Communications"/> | ||
1466 | <Reference name="OpenSim.ApplicationPlugins.LoadRegions"/> | ||
1467 | |||
1468 | <Files> | ||
1469 | <Match pattern="*.cs" recurse="true"/> | ||
1470 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> | ||
1471 | </Files> | ||
1472 | </Project> | ||
1473 | |||
1432 | <Project name="OpenSim.ApplicationPlugins.RemoteController" path="OpenSim/ApplicationPlugins/RemoteController" type="Library"> | 1474 | <Project name="OpenSim.ApplicationPlugins.RemoteController" path="OpenSim/ApplicationPlugins/RemoteController" type="Library"> |
1433 | <Configuration name="Debug"> | 1475 | <Configuration name="Debug"> |
1434 | <Options> | 1476 | <Options> |