aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs82
1 files changed, 46 insertions, 36 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
index e6b4a89..ec14b97 100644
--- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
@@ -110,7 +110,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
110 } 110 }
111 } 111 }
112 112
113 private void InitialiseCommsManager(OpenSimBase openSim) 113 protected void InitialiseCommsManager(OpenSimBase openSim)
114 { 114 {
115 LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile); 115 LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile);
116 116
@@ -118,48 +118,59 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
118 118
119 if (hgrid) 119 if (hgrid)
120 { 120 {
121 HGOpenSimNode hgNode = null; 121 InitialiseHGServices(openSim, libraryRootFolder);
122 try
123 {
124 hgNode = (HGOpenSimNode)openSim;
125 }
126 catch (Exception e)
127 {
128 m_log.Error("[CreateComms] " + e.Message);
129 m_log.Error("[CreateComms] The OpenSim application class was : " + openSim.ToString());
130 m_log.Error("[CreateComms] To use hypergrid mode, please make sure you are starting opensim with the command line: opensim.exe -hypergrid=true");
131 Environment.Exit(1);
132 }
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 } 122 }
146 else 123 else
147 { 124 {
148 // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) 125 InitialiseStandardServices(libraryRootFolder);
149 if (m_openSim.ConfigurationSettings.Standalone)
150 {
151 InitialiseStandaloneServices(libraryRootFolder);
152 }
153 else
154 {
155 // We are in grid mode
156 InitialiseGridServices(libraryRootFolder);
157 }
158 } 126 }
159 127
160 openSim.CommunicationsManager = m_commsManager; 128 openSim.CommunicationsManager = m_commsManager;
161 } 129 }
162 130
131 protected void InitialiseHGServices(OpenSimBase openSim, LibraryRootFolder libraryRootFolder)
132 {
133 HGOpenSimNode hgNode = null;
134 try
135 {
136 hgNode = (HGOpenSimNode)openSim;
137 }
138 catch (Exception e)
139 {
140 m_log.Error("[CreateComms] " + e.Message);
141 m_log.Error("[CreateComms] The OpenSim application class was : " + openSim.ToString());
142 m_log.Error("[CreateComms] To use hypergrid mode, please make sure you are starting opensim with the command line: opensim.exe -hypergrid=true");
143 m_log.Error("[CreateComms] Also hypergrid mode can not be ran while using the -background=true command line argument.");
144 Environment.Exit(1);
145 }
146
147 // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false)
148 if (m_openSim.ConfigurationSettings.Standalone)
149 {
150 InitialiseHGStandaloneServices(libraryRootFolder);
151 }
152 else
153 {
154 // We are in grid mode
155 InitialiseHGGridServices(libraryRootFolder);
156 }
157 hgNode.HGServices = HGServices;
158 }
159
160 protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder)
161 {
162 // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false)
163 if (m_openSim.ConfigurationSettings.Standalone)
164 {
165 InitialiseStandaloneServices(libraryRootFolder);
166 }
167 else
168 {
169 // We are in grid mode
170 InitialiseGridServices(libraryRootFolder);
171 }
172 }
173
163 /// <summary> 174 /// <summary>
164 /// Initialises the backend services for standalone mode, and registers some http handlers 175 /// Initialises the backend services for standalone mode, and registers some http handlers
165 /// </summary> 176 /// </summary>
@@ -252,7 +263,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
252 private void CreateGridInfoService() 263 private void CreateGridInfoService()
253 { 264 {
254 // provide grid info 265 // provide grid info
255 // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini")));
256 m_gridInfoService = new GridInfoService(m_openSim.ConfigSource.Source); 266 m_gridInfoService = new GridInfoService(m_openSim.ConfigSource.Source);
257 m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); 267 m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
258 m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); 268 m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));