aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs23
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
4 files changed, 37 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 4335592..d528160 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10903,31 +10903,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10903 public LSL_Float llListStatistics(int operation, LSL_List src) 10903 public LSL_Float llListStatistics(int operation, LSL_List src)
10904 { 10904 {
10905 m_host.AddScriptLPS(1); 10905 m_host.AddScriptLPS(1);
10906 LSL_List nums = LSL_List.ToDoubleList(src);
10907 switch (operation) 10906 switch (operation)
10908 { 10907 {
10909 case ScriptBaseClass.LIST_STAT_RANGE: 10908 case ScriptBaseClass.LIST_STAT_RANGE:
10910 return nums.Range(); 10909 return src.Range();
10911 case ScriptBaseClass.LIST_STAT_MIN: 10910 case ScriptBaseClass.LIST_STAT_MIN:
10912 return nums.Min(); 10911 return src.Min();
10913 case ScriptBaseClass.LIST_STAT_MAX: 10912 case ScriptBaseClass.LIST_STAT_MAX:
10914 return nums.Max(); 10913 return src.Max();
10915 case ScriptBaseClass.LIST_STAT_MEAN: 10914 case ScriptBaseClass.LIST_STAT_MEAN:
10916 return nums.Mean(); 10915 return src.Mean();
10917 case ScriptBaseClass.LIST_STAT_MEDIAN: 10916 case ScriptBaseClass.LIST_STAT_MEDIAN:
10918 return nums.Median(); 10917 return LSL_List.ToDoubleList(src).Median();
10919 case ScriptBaseClass.LIST_STAT_NUM_COUNT: 10918 case ScriptBaseClass.LIST_STAT_NUM_COUNT:
10920 return nums.NumericLength(); 10919 return src.NumericLength();
10921 case ScriptBaseClass.LIST_STAT_STD_DEV: 10920 case ScriptBaseClass.LIST_STAT_STD_DEV:
10922 return nums.StdDev(); 10921 return src.StdDev();
10923 case ScriptBaseClass.LIST_STAT_SUM: 10922 case ScriptBaseClass.LIST_STAT_SUM:
10924 return nums.Sum(); 10923 return src.Sum();
10925 case ScriptBaseClass.LIST_STAT_SUM_SQUARES: 10924 case ScriptBaseClass.LIST_STAT_SUM_SQUARES:
10926 return nums.SumSqrs(); 10925 return src.SumSqrs();
10927 case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN: 10926 case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN:
10928 return nums.GeometricMean(); 10927 return src.GeometricMean();
10929 case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN: 10928 case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN:
10930 return nums.HarmonicMean(); 10929 return src.HarmonicMean();
10931 default: 10930 default:
10932 return 0.0; 10931 return 0.0;
10933 } 10932 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index ceff889..7aacfd4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -141,6 +141,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
141 internal bool m_debuggerSafe = false; 141 internal bool m_debuggerSafe = false;
142 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); 142 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
143 143
144 protected IUrlModule m_UrlModule = null;
145
144 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) 146 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
145 { 147 {
146 m_ScriptEngine = ScriptEngine; 148 m_ScriptEngine = ScriptEngine;
@@ -148,6 +150,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
148 m_item = item; 150 m_item = item;
149 m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false); 151 m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
150 152
153 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
154
151 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) 155 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
152 m_OSFunctionsEnabled = true; 156 m_OSFunctionsEnabled = true;
153 157
@@ -3406,5 +3410,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3406 3410
3407 return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); 3411 return new LSL_Key(m_host.ParentGroup.FromPartID.ToString());
3408 } 3412 }
3413
3414 /// <summary>
3415 /// Sets the response type for an HTTP request/response
3416 /// </summary>
3417 /// <returns></returns>
3418 public void osSetContentType(LSL_Key id, string type)
3419 {
3420 CheckThreatLevel(ThreatLevel.High,"osSetResponseType");
3421 if (m_UrlModule != null)
3422 m_UrlModule.HttpContentType(new UUID(id),type);
3423 }
3409 } 3424 }
3410} 3425}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index d0e041c..07149b6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -365,5 +365,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
365 /// </summary> 365 /// </summary>
366 /// <returns>Rezzing object key or NULL_KEY if rezzed by agent or otherwise unknown.</returns> 366 /// <returns>Rezzing object key or NULL_KEY if rezzed by agent or otherwise unknown.</returns>
367 LSL_Key osGetRezzingObject(); 367 LSL_Key osGetRezzingObject();
368
369 /// <summary>
370 /// Sets the response type for an HTTP request/response
371 /// </summary>
372 /// <returns></returns>
373 void osSetContentType(LSL_Key id, string type);
368 } 374 }
369} 375}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index e9131e4..ba1ade2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -955,5 +955,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
955 { 955 {
956 return m_OSSL_Functions.osGetRezzingObject(); 956 return m_OSSL_Functions.osGetRezzingObject();
957 } 957 }
958
959 public void osSetContentType(LSL_Key id, string type)
960 {
961 m_OSSL_Functions.osSetContentType(id,type);
962 }
958 } 963 }
959} 964}