diff options
author | diva | 2009-05-25 20:30:24 +0000 |
---|---|---|
committer | diva | 2009-05-25 20:30:24 +0000 |
commit | cb704ecde19c512bfa4fc0b317d37fec63e76713 (patch) | |
tree | 1960e54ce2312b95f030009c335b5211322ef60d /OpenSim/SimulatorServices/SimulationService.cs | |
parent | * reseparate inventory item creator id and creator uuid (diff) | |
download | opensim-SC_OLD-cb704ecde19c512bfa4fc0b317d37fec63e76713.zip opensim-SC_OLD-cb704ecde19c512bfa4fc0b317d37fec63e76713.tar.gz opensim-SC_OLD-cb704ecde19c512bfa4fc0b317d37fec63e76713.tar.bz2 opensim-SC_OLD-cb704ecde19c512bfa4fc0b317d37fec63e76713.tar.xz |
Beginning of refactoring RESTComms/LocalComms in the new style of services and connectors. This commit has the beginning of the In connector, not the Out. Nothing of this is finished yet, and it doesn't run. But it should compile ok.
Diffstat (limited to 'OpenSim/SimulatorServices/SimulationService.cs')
-rw-r--r-- | OpenSim/SimulatorServices/SimulationService.cs | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/OpenSim/SimulatorServices/SimulationService.cs b/OpenSim/SimulatorServices/SimulationService.cs new file mode 100644 index 0000000..8f01436 --- /dev/null +++ b/OpenSim/SimulatorServices/SimulationService.cs | |||
@@ -0,0 +1,85 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Collections.Generic; | ||
4 | using log4net; | ||
5 | using Nini.Config; | ||
6 | using OpenSim.Framework; | ||
7 | using OpenSim.Framework.Servers.HttpServer; | ||
8 | using OpenSim.Region.Framework.Scenes; | ||
9 | using OpenSim.Region.Framework.Interfaces; | ||
10 | using OpenSim.Server.Base; | ||
11 | using OpenSim.Server.Handlers.Base; | ||
12 | |||
13 | |||
14 | namespace OpenSim.SimulatorServices | ||
15 | { | ||
16 | public class SimulationService : ISharedRegionModule | ||
17 | { | ||
18 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
19 | private static bool m_Enabled = false; | ||
20 | |||
21 | private IConfigSource m_Config; | ||
22 | bool m_Registered = false; | ||
23 | |||
24 | #region IRegionModule interface | ||
25 | |||
26 | public void Initialise(IConfigSource config) | ||
27 | { | ||
28 | m_Config = config; | ||
29 | |||
30 | IConfig moduleConfig = config.Configs["Modules"]; | ||
31 | if (moduleConfig != null) | ||
32 | { | ||
33 | string name = moduleConfig.GetString("AssetServices", ""); | ||
34 | if (name == Name) | ||
35 | { | ||
36 | m_Enabled = true; | ||
37 | m_log.Info("[SIM SERVICE]: SimulationService enabled"); | ||
38 | |||
39 | } | ||
40 | } | ||
41 | |||
42 | } | ||
43 | |||
44 | public void PostInitialise() | ||
45 | { | ||
46 | } | ||
47 | |||
48 | public void Close() | ||
49 | { | ||
50 | } | ||
51 | |||
52 | public string Name | ||
53 | { | ||
54 | get { return "SimulationService"; } | ||
55 | } | ||
56 | |||
57 | public void AddRegion(Scene scene) | ||
58 | { | ||
59 | if (!m_Enabled) | ||
60 | return; | ||
61 | |||
62 | if (!m_Registered) | ||
63 | { | ||
64 | m_Registered = true; | ||
65 | |||
66 | m_log.Info("[SIM SERVICE]: Starting..."); | ||
67 | |||
68 | Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, scene }; | ||
69 | |||
70 | ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:SimulationServiceInConnector", args); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | public void RemoveRegion(Scene scene) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void RegionLoaded(Scene scene) | ||
79 | { | ||
80 | } | ||
81 | |||
82 | #endregion | ||
83 | |||
84 | } | ||
85 | } | ||