aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-07-26 21:41:39 +0100
committerJustin Clark-Casey (justincc)2010-07-26 21:41:39 +0100
commitf34795c6b3cd022bd9f6ed4cea02631f5b17bf72 (patch)
tree6242c86ed0d0503e3106727fd582a7de2af27a13
parentrelocate serialization code from SQLiteRegionData to MoapModule using load an... (diff)
downloadopensim-SC-f34795c6b3cd022bd9f6ed4cea02631f5b17bf72.zip
opensim-SC-f34795c6b3cd022bd9f6ed4cea02631f5b17bf72.tar.gz
opensim-SC-f34795c6b3cd022bd9f6ed4cea02631f5b17bf72.tar.bz2
opensim-SC-f34795c6b3cd022bd9f6ed4cea02631f5b17bf72.tar.xz
provide config option for media on a prim
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs21
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs4
-rw-r--r--bin/OpenSim.ini.example5
3 files changed, 26 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()
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index f4d9a18..a533f45 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -1248,6 +1248,11 @@
1248; enabled=false 1248; enabled=false
1249 1249
1250 1250
1251[MediaOnAPrim]
1252 ; Enable media on a prim facilities
1253 Enabled = true;
1254
1255
1251;; 1256;;
1252;; These are defaults that are overwritten below in [Architecture]. 1257;; These are defaults that are overwritten below in [Architecture].
1253;; These defaults allow OpenSim to work out of the box with 1258;; These defaults allow OpenSim to work out of the box with