aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-01 01:01:16 +0000
committerJustin Clarke Casey2008-06-01 01:01:16 +0000
commit8e1d3386561f263646c10c875aa00af4b3c9f815 (patch)
tree3fc89893ecdd75b0be7283dd0b4a2b9376b59964 /OpenSim/Region/Application/OpenSimBase.cs
parent* Updates permission module so that GenericCommunicationPermission returns tr... (diff)
downloadopensim-SC-8e1d3386561f263646c10c875aa00af4b3c9f815.zip
opensim-SC-8e1d3386561f263646c10c875aa00af4b3c9f815.tar.gz
opensim-SC-8e1d3386561f263646c10c875aa00af4b3c9f815.tar.bz2
opensim-SC-8e1d3386561f263646c10c875aa00af4b3c9f815.tar.xz
* Refactor: Split opensim background server into a separate class
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs (renamed from OpenSim/Region/Application/OpenSimMain.cs)39
1 files changed, 6 insertions, 33 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 03dbf78..468881e 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -50,7 +50,10 @@ using OpenSim.Region.Physics.Manager;
50 50
51namespace OpenSim 51namespace OpenSim
52{ 52{
53 public class OpenSimMain : RegionApplicationBase 53 /// <summary>
54 /// Common OpenSim region service code
55 /// </summary>
56 public class OpenSimBase : RegionApplicationBase
54 { 57 {
55 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
56 59
@@ -139,7 +142,7 @@ namespace OpenSim
139 set { m_moduleLoader = value; } 142 set { m_moduleLoader = value; }
140 } 143 }
141 144
142 public OpenSimMain(IConfigSource configSource) 145 public OpenSimBase(IConfigSource configSource)
143 : base() 146 : base()
144 { 147 {
145 IConfig startupConfig = configSource.Configs["Startup"]; 148 IConfig startupConfig = configSource.Configs["Startup"];
@@ -321,36 +324,7 @@ namespace OpenSim
321 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); 324 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
322 } 325 }
323 326
324
325 m_networkServersInfo.loadFromConfiguration(m_config); 327 m_networkServersInfo.loadFromConfiguration(m_config);
326
327 }
328
329 private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false);
330
331 /// <summary>
332 /// Performs initialisation of the scene, such as loading configuration from disk.
333 /// </summary>
334 public override void StartUp()
335 {
336 //
337 // Called from app startup (OpenSim.Application)
338 //
339 m_log.Info("====================================================================");
340 m_log.Info("========================= STARTING OPENSIM =========================");
341 m_log.Info("====================================================================");
342 m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid");
343
344 InternalStartUp();
345
346 // We are done with startup
347 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
348 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
349
350 WorldHasComeToAnEnd.WaitOne();
351 m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye.");
352
353 Environment.Exit(0);
354 } 328 }
355 329
356 /// <summary> 330 /// <summary>
@@ -692,8 +666,6 @@ namespace OpenSim
692 666
693 m_sceneManager.Close(); 667 m_sceneManager.Close();
694 668
695 WorldHasComeToAnEnd.Set();
696
697 base.Shutdown(); 669 base.Shutdown();
698 } 670 }
699 671
@@ -727,3 +699,4 @@ namespace OpenSim
727 } 699 }
728 } 700 }
729} 701}
702