aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
authorMW2009-03-03 12:51:54 +0000
committerMW2009-03-03 12:51:54 +0000
commit76133d07630d8a1547c034b28585a931f751ad1b (patch)
tree672bd4752f83c566942ce92b36a307bf187cfbea /OpenSim/Region/Application/OpenSimBase.cs
parentRenamed OpenSimBase m_autoCreateLindenStack to m_autoCreateClientStack (diff)
downloadopensim-SC_OLD-76133d07630d8a1547c034b28585a931f751ad1b.zip
opensim-SC_OLD-76133d07630d8a1547c034b28585a931f751ad1b.tar.gz
opensim-SC_OLD-76133d07630d8a1547c034b28585a931f751ad1b.tar.bz2
opensim-SC_OLD-76133d07630d8a1547c034b28585a931f751ad1b.tar.xz
Refactoring of CreateCommsManagerPlugin.
Plus some general cleanup of a few other files (deleting excess blank lines etc)
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs34
1 files changed, 0 insertions, 34 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 7569502..323d90c 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -206,7 +206,6 @@ namespace OpenSim
206 } 206 }
207 207
208 AddPluginCommands(); 208 AddPluginCommands();
209
210 } 209 }
211 210
212 protected virtual void AddPluginCommands() 211 protected virtual void AddPluginCommands()
@@ -269,14 +268,10 @@ namespace OpenSim
269 268
270 protected override void Initialize() 269 protected override void Initialize()
271 { 270 {
272 //
273 // Called from base.StartUp() 271 // Called from base.StartUp()
274 //
275 272
276 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 273 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
277
278 InitialiseAssetCache(); 274 InitialiseAssetCache();
279
280 m_sceneManager.OnRestartSim += handleRestartRegion; 275 m_sceneManager.OnRestartSim += handleRestartRegion;
281 } 276 }
282 277
@@ -291,10 +286,8 @@ namespace OpenSim
291 /// returns an IAssetCache implementation, if possible. This is a virtual 286 /// returns an IAssetCache implementation, if possible. This is a virtual
292 /// method. 287 /// method.
293 /// </summary> 288 /// </summary>
294
295 protected virtual void InitialiseAssetCache() 289 protected virtual void InitialiseAssetCache()
296 { 290 {
297
298 LegacyAssetClientPluginInitialiser linit = null; 291 LegacyAssetClientPluginInitialiser linit = null;
299 CryptoAssetClientPluginInitialiser cinit = null; 292 CryptoAssetClientPluginInitialiser cinit = null;
300 AssetClientPluginInitialiser init = null; 293 AssetClientPluginInitialiser init = null;
@@ -308,7 +301,6 @@ namespace OpenSim
308 // If "default" is specified, then the value is adjusted 301 // If "default" is specified, then the value is adjusted
309 // according to whether or not the server is running in 302 // according to whether or not the server is running in
310 // standalone mode. 303 // standalone mode.
311
312 if (mode.ToLower() == "default") 304 if (mode.ToLower() == "default")
313 { 305 {
314 if (m_configSettings.Standalone == false) 306 if (m_configSettings.Standalone == false)
@@ -319,19 +311,15 @@ namespace OpenSim
319 311
320 switch (mode.ToLower()) 312 switch (mode.ToLower())
321 { 313 {
322
323 // If grid is specified then the grid server is chose regardless 314 // If grid is specified then the grid server is chose regardless
324 // of whether the server is standalone. 315 // of whether the server is standalone.
325
326 case "grid" : 316 case "grid" :
327 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); 317 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
328 assetServer = loadAssetServer("Grid", linit); 318 assetServer = loadAssetServer("Grid", linit);
329 break; 319 break;
330 320
331
332 // If cryptogrid is specified then the cryptogrid server is chose regardless 321 // If cryptogrid is specified then the cryptogrid server is chose regardless
333 // of whether the server is standalone. 322 // of whether the server is standalone.
334
335 case "cryptogrid" : 323 case "cryptogrid" :
336 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, 324 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
337 Environment.CurrentDirectory, true); 325 Environment.CurrentDirectory, true);
@@ -340,7 +328,6 @@ namespace OpenSim
340 328
341 // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless 329 // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless
342 // of whether the server is standalone. 330 // of whether the server is standalone.
343
344 case "cryptogrid_eou" : 331 case "cryptogrid_eou" :
345 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, 332 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
346 Environment.CurrentDirectory, false); 333 Environment.CurrentDirectory, false);
@@ -349,7 +336,6 @@ namespace OpenSim
349 336
350 // If file is specified then the file server is chose regardless 337 // If file is specified then the file server is chose regardless
351 // of whether the server is standalone. 338 // of whether the server is standalone.
352
353 case "file" : 339 case "file" :
354 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); 340 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
355 assetServer = loadAssetServer("File", linit); 341 assetServer = loadAssetServer("File", linit);
@@ -358,14 +344,12 @@ namespace OpenSim
358 // If local is specified then we're going to use the local SQL server 344 // If local is specified then we're going to use the local SQL server
359 // implementation. We drop through, because that will be the fallback 345 // implementation. We drop through, because that will be the fallback
360 // for the following default clause too. 346 // for the following default clause too.
361
362 case "local" : 347 case "local" :
363 break; 348 break;
364 349
365 // If the asset_database value is none of the previously mentioned strings, then we 350 // If the asset_database value is none of the previously mentioned strings, then we
366 // try to load a turnkey plugin that matches this value. If not we drop through to 351 // try to load a turnkey plugin that matches this value. If not we drop through to
367 // a local default. 352 // a local default.
368
369 default : 353 default :
370 try 354 try
371 { 355 {
@@ -376,11 +360,9 @@ namespace OpenSim
376 catch {} 360 catch {}
377 m_log.Info("[OPENSIMBASE] Default assetserver will be used"); 361 m_log.Info("[OPENSIMBASE] Default assetserver will be used");
378 break; 362 break;
379
380 } 363 }
381 364
382 // Open the local SQL-based database asset server 365 // Open the local SQL-based database asset server
383
384 if (assetServer == null) 366 if (assetServer == null)
385 { 367 {
386 init = new AssetClientPluginInitialiser(m_configSettings); 368 init = new AssetClientPluginInitialiser(m_configSettings);
@@ -391,18 +373,14 @@ namespace OpenSim
391 373
392 // Initialize the asset cache, passing a reference to the selected 374 // Initialize the asset cache, passing a reference to the selected
393 // asset server interface. 375 // asset server interface.
394
395 m_assetCache = ResolveAssetCache(assetServer); 376 m_assetCache = ResolveAssetCache(assetServer);
396
397 } 377 }
398 378
399 // This method loads the identified asset server, passing an approrpiately 379 // This method loads the identified asset server, passing an approrpiately
400 // initialized Initialise wrapper. There should to be exactly one match, 380 // initialized Initialise wrapper. There should to be exactly one match,
401 // if not, then the first match is used. 381 // if not, then the first match is used.
402
403 private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi) 382 private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi)
404 { 383 {
405
406 if (id != null && id != String.Empty) 384 if (id != null && id != String.Empty)
407 { 385 {
408 m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id); 386 m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id);
@@ -424,9 +402,7 @@ namespace OpenSim
424 m_log.DebugFormat("[OPENSIMBASE] Asset server {0} not loaded ({1})", id, e.Message); 402 m_log.DebugFormat("[OPENSIMBASE] Asset server {0} not loaded ({1})", id, e.Message);
425 } 403 }
426 } 404 }
427
428 return null; 405 return null;
429
430 } 406 }
431 407
432 /// <summary> 408 /// <summary>
@@ -439,21 +415,14 @@ namespace OpenSim
439 /// The AssetCache value is obtained from the 415 /// The AssetCache value is obtained from the
440 /// [StartUp]/AssetCache value in the configuration file. 416 /// [StartUp]/AssetCache value in the configuration file.
441 /// </summary> 417 /// </summary>
442
443 protected virtual IAssetCache ResolveAssetCache(IAssetServer assetServer) 418 protected virtual IAssetCache ResolveAssetCache(IAssetServer assetServer)
444 { 419 {
445
446 IAssetCache assetCache = null; 420 IAssetCache assetCache = null;
447
448
449 if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty) 421 if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty)
450 { 422 {
451
452 m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset cache id={0}", m_configSettings.AssetCache); 423 m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset cache id={0}", m_configSettings.AssetCache);
453
454 try 424 try
455 { 425 {
456
457 PluginInitialiserBase init = new AssetCachePluginInitialiser(m_configSettings, assetServer); 426 PluginInitialiserBase init = new AssetCachePluginInitialiser(m_configSettings, assetServer);
458 PluginLoader<IAssetCache> loader = new PluginLoader<IAssetCache>(init); 427 PluginLoader<IAssetCache> loader = new PluginLoader<IAssetCache>(init);
459 loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache)); 428 loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache));
@@ -461,7 +430,6 @@ namespace OpenSim
461 loader.Load(PLUGIN_ASSET_CACHE); 430 loader.Load(PLUGIN_ASSET_CACHE);
462 if (loader.Plugins.Count > 0) 431 if (loader.Plugins.Count > 0)
463 assetCache = (IAssetCache) loader.Plugins[0]; 432 assetCache = (IAssetCache) loader.Plugins[0];
464
465 } 433 }
466 catch (Exception e) 434 catch (Exception e)
467 { 435 {
@@ -471,9 +439,7 @@ namespace OpenSim
471 } 439 }
472 440
473 // If everything else fails, we force load the built-in asset cache 441 // If everything else fails, we force load the built-in asset cache
474
475 return (IAssetCache) ((assetCache != null) ? assetCache : new AssetCache(assetServer)); 442 return (IAssetCache) ((assetCache != null) ? assetCache : new AssetCache(assetServer));
476
477 } 443 }
478 444
479 public void ProcessLogin(bool LoginEnabled) 445 public void ProcessLogin(bool LoginEnabled)