diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Application/IApplicationPlugin.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs (renamed from OpenSim/Region/Application/OpenSimMainConsole.cs) | 9 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBackground.cs | 80 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs (renamed from OpenSim/Region/Application/OpenSimMain.cs) | 39 |
5 files changed, 94 insertions, 40 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 9aa885f..72fdf10 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -82,12 +82,12 @@ namespace OpenSim | |||
82 | 82 | ||
83 | if (background) | 83 | if (background) |
84 | { | 84 | { |
85 | OpenSimMain sim = new OpenSimMain(configSource); | 85 | OpenSimBase sim = new OpenSimBackground(configSource); |
86 | sim.StartUp(); | 86 | sim.StartUp(); |
87 | } | 87 | } |
88 | else | 88 | else |
89 | { | 89 | { |
90 | OpenSimMain sim = new OpenSimMainConsole(configSource); | 90 | OpenSimBase sim = new OpenSim(configSource); |
91 | sim.StartUp(); | 91 | sim.StartUp(); |
92 | 92 | ||
93 | while (true) | 93 | while (true) |
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 30f8da8..7ca4383 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim | |||
34 | [TypeExtensionPoint("/OpenSim/Startup")] | 34 | [TypeExtensionPoint("/OpenSim/Startup")] |
35 | public interface IApplicationPlugin | 35 | public interface IApplicationPlugin |
36 | { | 36 | { |
37 | void Initialise(OpenSimMain openSim); | 37 | void Initialise(OpenSimBase openSim); |
38 | void Close(); | 38 | void Close(); |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSim.cs index 467db14..1bed036 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -46,7 +46,10 @@ namespace OpenSim | |||
46 | { | 46 | { |
47 | public delegate void ConsoleCommand(string[] comParams); | 47 | public delegate void ConsoleCommand(string[] comParams); |
48 | 48 | ||
49 | public class OpenSimMainConsole : OpenSimMain, conscmd_callback | 49 | /// <summary> |
50 | /// Interactive OpenSim region server | ||
51 | /// </summary> | ||
52 | public class OpenSim : OpenSimBase, conscmd_callback | ||
50 | { | 53 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 55 | ||
@@ -56,8 +59,7 @@ namespace OpenSim | |||
56 | private string m_timedScript = "disabled"; | 59 | private string m_timedScript = "disabled"; |
57 | private Timer m_scriptTimer; | 60 | private Timer m_scriptTimer; |
58 | 61 | ||
59 | public OpenSimMainConsole(IConfigSource configSource) | 62 | public OpenSim(IConfigSource configSource) : base(configSource) |
60 | : base(configSource) | ||
61 | { | 63 | { |
62 | } | 64 | } |
63 | 65 | ||
@@ -620,7 +622,6 @@ namespace OpenSim | |||
620 | { | 622 | { |
621 | RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); | 623 | RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); |
622 | string regionName; | 624 | string regionName; |
623 | System.Net.EndPoint ep = null; | ||
624 | 625 | ||
625 | if (regionInfo == null) | 626 | if (regionInfo == null) |
626 | { | 627 | { |
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs new file mode 100644 index 0000000..0c3a0a3 --- /dev/null +++ b/OpenSim/Region/Application/OpenSimBackground.cs | |||
@@ -0,0 +1,80 @@ | |||
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.Reflection; | ||
29 | using System.Threading; | ||
30 | using log4net; | ||
31 | using Nini.Config; | ||
32 | |||
33 | namespace OpenSim | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Consoleless OpenSim region server | ||
37 | /// </summary> | ||
38 | public class OpenSimBackground : OpenSimBase | ||
39 | { | ||
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
42 | private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false); | ||
43 | |||
44 | public OpenSimBackground(IConfigSource configSource) : base(configSource) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Performs initialisation of the scene, such as loading configuration from disk. | ||
50 | /// </summary> | ||
51 | public override void StartUp() | ||
52 | { | ||
53 | // | ||
54 | // Called from app startup (OpenSim.Application) | ||
55 | // | ||
56 | m_log.Info("===================================================================="); | ||
57 | m_log.Info("========================= STARTING OPENSIM ========================="); | ||
58 | m_log.Info("===================================================================="); | ||
59 | m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid"); | ||
60 | |||
61 | InternalStartUp(); | ||
62 | |||
63 | // We are done with startup | ||
64 | m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", | ||
65 | m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); | ||
66 | |||
67 | WorldHasComeToAnEnd.WaitOne(); | ||
68 | } | ||
69 | |||
70 | /// <summary> | ||
71 | /// Performs any last-minute sanity checking and shuts down the region server | ||
72 | /// </summary> | ||
73 | public override void Shutdown() | ||
74 | { | ||
75 | WorldHasComeToAnEnd.Set(); | ||
76 | |||
77 | base.Shutdown(); | ||
78 | } | ||
79 | } | ||
80 | } | ||
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 | ||
51 | namespace OpenSim | 51 | namespace 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 | |||