Reintroduces the discovery mechanism to use llRequestSimulatorData("", 128)
Causes the dataserver event to return "OpenSim" when running on OpenSim. Requires ThreatLevel to be "High" or above to function.0.6.0-stable
parent
1cf0798863
commit
cffd73c59f
|
@ -372,5 +372,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||||
controllingClient.SendScriptRunningReply(objectID, itemID,
|
controllingClient.SendScriptRunningReply(objectID, itemID,
|
||||||
id.Running);
|
id.Running);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IScriptApi GetApi(UUID itemID, string name)
|
||||||
|
{
|
||||||
|
return m_ScriptManager.GetApi(itemID, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -619,7 +619,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||||
|
|
||||||
InstanceData id = GetScript(localID, itemID);
|
InstanceData id = GetScript(localID, itemID);
|
||||||
|
|
||||||
|
if (id == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return id.StartParam;
|
return id.StartParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IScriptApi GetApi(UUID itemID, string name)
|
||||||
|
{
|
||||||
|
uint localID = GetLocalID(itemID);
|
||||||
|
|
||||||
|
InstanceData id = GetScript(localID, itemID);
|
||||||
|
if (id == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (id.Apis.ContainsKey(name))
|
||||||
|
return id.Apis[name];
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,5 +66,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
IConfig Config { get; }
|
IConfig Config { get; }
|
||||||
string ScriptEngineName { get; }
|
string ScriptEngineName { get; }
|
||||||
ILog Log { get; }
|
ILog Log { get; }
|
||||||
|
IScriptApi GetApi(UUID itemID, string name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,5 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
/// Queue an event for execution
|
/// Queue an event for execution
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IScriptWorkItem QueueEventHandler(object parms);
|
IScriptWorkItem QueueEventHandler(object parms);
|
||||||
|
|
||||||
IScriptApi GetApi(UUID itemID, string name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7182,6 +7182,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public LSL_String llRequestSimulatorData(string simulator, int data)
|
public LSL_String llRequestSimulatorData(string simulator, int data)
|
||||||
{
|
{
|
||||||
|
IOSSL_Api ossl = (IOSSL_Api)m_ScriptEngine.GetApi(m_itemID, "OSSL");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -7223,6 +7225,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
else
|
else
|
||||||
reply = "UNKNOWN";
|
reply = "UNKNOWN";
|
||||||
break;
|
break;
|
||||||
|
case 128:
|
||||||
|
if (ossl != null)
|
||||||
|
ossl.CheckThreatLevel(ThreatLevel.High, "llRequestSimulatorData");
|
||||||
|
reply = "OpenSim";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return UUID.Zero.ToString(); // Raise no event
|
return UUID.Zero.ToString(); // Raise no event
|
||||||
|
|
|
@ -87,18 +87,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// modification of user data, or allows the compromise of
|
// modification of user data, or allows the compromise of
|
||||||
// sensitive data by design.
|
// sensitive data by design.
|
||||||
|
|
||||||
public enum ThreatLevel
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
Nuisance = 1,
|
|
||||||
VeryLow = 2,
|
|
||||||
Low = 3,
|
|
||||||
Moderate = 4,
|
|
||||||
High = 5,
|
|
||||||
VeryHigh = 6,
|
|
||||||
Severe = 7
|
|
||||||
};
|
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
|
public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
|
||||||
{
|
{
|
||||||
|
@ -180,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
throw new Exception("OSSL Runtime Error: " + msg);
|
throw new Exception("OSSL Runtime Error: " + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void CheckThreatLevel(ThreatLevel level, string function)
|
public void CheckThreatLevel(ThreatLevel level, string function)
|
||||||
{
|
{
|
||||||
if (!m_OSFunctionsEnabled)
|
if (!m_OSFunctionsEnabled)
|
||||||
OSSLError(function+": permission denied"); // throws
|
OSSLError(function+": permission denied"); // throws
|
||||||
|
|
|
@ -28,8 +28,22 @@ using System.Collections;
|
||||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
{
|
{
|
||||||
|
public enum ThreatLevel
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Nuisance = 1,
|
||||||
|
VeryLow = 2,
|
||||||
|
Low = 3,
|
||||||
|
Moderate = 4,
|
||||||
|
High = 5,
|
||||||
|
VeryHigh = 6,
|
||||||
|
Severe = 7
|
||||||
|
};
|
||||||
|
|
||||||
public interface IOSSL_Api
|
public interface IOSSL_Api
|
||||||
{
|
{
|
||||||
|
void CheckThreatLevel(ThreatLevel level, string function);
|
||||||
|
|
||||||
//OpenSim functions
|
//OpenSim functions
|
||||||
string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
|
string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
|
||||||
string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
|
string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
|
||||||
|
|
Loading…
Reference in New Issue