aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
authorMic Bowman2012-08-29 14:56:51 -0700
committerMic Bowman2012-08-29 14:56:51 -0700
commit3d736d575ff9670ac813f13eb1cff07dea10328b (patch)
treebe3458150faf0a738c2e14814b2ff3992e4b4d5a /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
parentimplementing rule tracking (diff)
downloadopensim-SC_OLD-3d736d575ff9670ac813f13eb1cff07dea10328b.zip
opensim-SC_OLD-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.gz
opensim-SC_OLD-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.bz2
opensim-SC_OLD-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.xz
This partially implements the LSL function to set the response
type for an HTTP request. Since the "official" LSL function limits the use of the response type, it is implemented as osSetContentType with a string for the content mime type and a threat level of high. With this function you should be able to implement rather functional media-on-a-prim application with much less difficulty.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 09fcf50..e245684 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -140,12 +140,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
140 internal float m_ScriptDistanceFactor = 1.0f; 140 internal float m_ScriptDistanceFactor = 1.0f;
141 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); 141 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
142 142
143 protected IUrlModule m_UrlModule = null;
144
143 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) 145 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
144 { 146 {
145 m_ScriptEngine = ScriptEngine; 147 m_ScriptEngine = ScriptEngine;
146 m_host = host; 148 m_host = host;
147 m_item = item; 149 m_item = item;
148 150
151 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
152
149 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) 153 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
150 m_OSFunctionsEnabled = true; 154 m_OSFunctionsEnabled = true;
151 155
@@ -3358,5 +3362,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3358 3362
3359 return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); 3363 return new LSL_Key(m_host.ParentGroup.FromPartID.ToString());
3360 } 3364 }
3361 } 3365
3366 /// <summary>
3367 /// Sets the response type for an HTTP request/response
3368 /// </summary>
3369 /// <returns></returns>
3370 public void osSetContentType(LSL_Key id, string type)
3371 {
3372 CheckThreatLevel(ThreatLevel.High,"osSetResponseType");
3373 if (m_UrlModule != null)
3374 m_UrlModule.HttpContentType(new UUID(id),type);
3375 }
3376
3377 }
3362} \ No newline at end of file 3378} \ No newline at end of file