aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Media
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-07-26 21:41:39 +0100
committerJustin Clark-Casey (justincc)2010-07-26 23:34:23 +0100
commit4d23749241eb002c3815aa18789e8c3ffd44bfc1 (patch)
treee0220969bd7ce3464be560bc25c05f5e698821f3 /OpenSim/Region/CoreModules/World/Media
parentrelocate serialization code from SQLiteRegionData to MoapModule using load an... (diff)
downloadopensim-SC-4d23749241eb002c3815aa18789e8c3ffd44bfc1.zip
opensim-SC-4d23749241eb002c3815aa18789e8c3ffd44bfc1.tar.gz
opensim-SC-4d23749241eb002c3815aa18789e8c3ffd44bfc1.tar.bz2
opensim-SC-4d23749241eb002c3815aa18789e8c3ffd44bfc1.tar.xz
provide config option for media on a prim
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Media')
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index 0e03318..7afeeec 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -61,6 +61,11 @@ namespace OpenSim.Region.CoreModules.Media.Moap
61 public Type ReplaceableInterface { get { return null; } } 61 public Type ReplaceableInterface { get { return null; } }
62 62
63 /// <summary> 63 /// <summary>
64 /// Is this module enabled?
65 /// </summary>
66 protected bool m_isEnabled = true;
67
68 /// <summary>
64 /// The scene to which this module is attached 69 /// The scene to which this module is attached
65 /// </summary> 70 /// </summary>
66 protected Scene m_scene; 71 protected Scene m_scene;
@@ -85,13 +90,19 @@ namespace OpenSim.Region.CoreModules.Media.Moap
85 /// </summary> 90 /// </summary>
86 protected Dictionary<UUID, string> m_omuCapUrls = new Dictionary<UUID, string>(); 91 protected Dictionary<UUID, string> m_omuCapUrls = new Dictionary<UUID, string>();
87 92
88 public void Initialise(IConfigSource config) 93 public void Initialise(IConfigSource configSource)
89 { 94 {
90 // TODO: Add config switches to enable/disable this module 95 IConfig config = configSource.Configs["MediaOnAPrim"];
96
97 if (config != null && !config.GetBoolean("Enabled", false))
98 m_isEnabled = false;
91 } 99 }
92 100
93 public void AddRegion(Scene scene) 101 public void AddRegion(Scene scene)
94 { 102 {
103 if (!m_isEnabled)
104 return;
105
95 m_scene = scene; 106 m_scene = scene;
96 m_scene.RegisterModuleInterface<IMoapModule>(this); 107 m_scene.RegisterModuleInterface<IMoapModule>(this);
97 } 108 }
@@ -100,6 +111,9 @@ namespace OpenSim.Region.CoreModules.Media.Moap
100 111
101 public void RegionLoaded(Scene scene) 112 public void RegionLoaded(Scene scene)
102 { 113 {
114 if (!m_isEnabled)
115 return;
116
103 m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; 117 m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
104 m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps; 118 m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps;
105 m_scene.EventManager.OnSceneObjectLoaded += OnSceneObjectLoaded; 119 m_scene.EventManager.OnSceneObjectLoaded += OnSceneObjectLoaded;
@@ -108,6 +122,9 @@ namespace OpenSim.Region.CoreModules.Media.Moap
108 122
109 public void Close() 123 public void Close()
110 { 124 {
125 if (!m_isEnabled)
126 return;
127
111 m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; 128 m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
112 m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps; 129 m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps;
113 m_scene.EventManager.OnSceneObjectLoaded -= OnSceneObjectLoaded; 130 m_scene.EventManager.OnSceneObjectLoaded -= OnSceneObjectLoaded;