mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
This commit is contained in:
@@ -10903,31 +10903,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_Float llListStatistics(int operation, LSL_List src)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
LSL_List nums = LSL_List.ToDoubleList(src);
|
||||
switch (operation)
|
||||
{
|
||||
case ScriptBaseClass.LIST_STAT_RANGE:
|
||||
return nums.Range();
|
||||
return src.Range();
|
||||
case ScriptBaseClass.LIST_STAT_MIN:
|
||||
return nums.Min();
|
||||
return src.Min();
|
||||
case ScriptBaseClass.LIST_STAT_MAX:
|
||||
return nums.Max();
|
||||
return src.Max();
|
||||
case ScriptBaseClass.LIST_STAT_MEAN:
|
||||
return nums.Mean();
|
||||
return src.Mean();
|
||||
case ScriptBaseClass.LIST_STAT_MEDIAN:
|
||||
return nums.Median();
|
||||
return LSL_List.ToDoubleList(src).Median();
|
||||
case ScriptBaseClass.LIST_STAT_NUM_COUNT:
|
||||
return nums.NumericLength();
|
||||
return src.NumericLength();
|
||||
case ScriptBaseClass.LIST_STAT_STD_DEV:
|
||||
return nums.StdDev();
|
||||
return src.StdDev();
|
||||
case ScriptBaseClass.LIST_STAT_SUM:
|
||||
return nums.Sum();
|
||||
return src.Sum();
|
||||
case ScriptBaseClass.LIST_STAT_SUM_SQUARES:
|
||||
return nums.SumSqrs();
|
||||
return src.SumSqrs();
|
||||
case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN:
|
||||
return nums.GeometricMean();
|
||||
return src.GeometricMean();
|
||||
case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN:
|
||||
return nums.HarmonicMean();
|
||||
return src.HarmonicMean();
|
||||
default:
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -141,6 +141,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
internal bool m_debuggerSafe = false;
|
||||
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
|
||||
|
||||
protected IUrlModule m_UrlModule = null;
|
||||
|
||||
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
|
||||
{
|
||||
m_ScriptEngine = ScriptEngine;
|
||||
@@ -148,6 +150,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_item = item;
|
||||
m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
|
||||
|
||||
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
|
||||
|
||||
if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
|
||||
m_OSFunctionsEnabled = true;
|
||||
|
||||
@@ -3406,5 +3410,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return new LSL_Key(m_host.ParentGroup.FromPartID.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the response type for an HTTP request/response
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void osSetContentType(LSL_Key id, string type)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High,"osSetResponseType");
|
||||
if (m_UrlModule != null)
|
||||
m_UrlModule.HttpContentType(new UUID(id),type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,5 +365,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
/// </summary>
|
||||
/// <returns>Rezzing object key or NULL_KEY if rezzed by agent or otherwise unknown.</returns>
|
||||
LSL_Key osGetRezzingObject();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the response type for an HTTP request/response
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
void osSetContentType(LSL_Key id, string type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,5 +955,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_OSSL_Functions.osGetRezzingObject();
|
||||
}
|
||||
|
||||
public void osSetContentType(LSL_Key id, string type)
|
||||
{
|
||||
m_OSSL_Functions.osSetContentType(id,type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user