diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 4 |
2 files changed, 21 insertions, 4 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; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 7f6f851..982ac52 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -401,8 +401,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
401 | m_moapModule = m_scene.RequestModuleInterface<IMoapModule>(); | 401 | m_moapModule = m_scene.RequestModuleInterface<IMoapModule>(); |
402 | 402 | ||
403 | // This log line will be commented out when no longer required for debugging | 403 | // This log line will be commented out when no longer required for debugging |
404 | if (m_moapModule == null) | 404 | // if (m_moapModule == null) |
405 | m_log.Warn("[PERMISSIONS]: Media on a prim module not found, media on a prim permissions will not work"); | 405 | // m_log.Warn("[PERMISSIONS]: Media on a prim module not found, media on a prim permissions will not work"); |
406 | } | 406 | } |
407 | 407 | ||
408 | public void Close() | 408 | public void Close() |