From: kurt taylor (krtaylor)
Another new OSSL function for returning the name of the script engine currently running, osGetScriptEngineName, added to both DotNet and XEngine OSSL API.0.6.0-stable
parent
bf34f65125
commit
5e63206018
|
@ -2022,6 +2022,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
m_LSL_Functions.osOpenRemoteDataChannel(channel);
|
m_LSL_Functions.osOpenRemoteDataChannel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string osGetScriptEngineName()
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.osGetScriptEngineName();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public double llList2Float(LSL_Types.list src, int index)
|
public double llList2Float(LSL_Types.list src, int index)
|
||||||
|
|
|
@ -543,5 +543,31 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj);
|
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string osGetScriptEngineName()
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
int scriptEngineNameIndex = 0;
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName))
|
||||||
|
{
|
||||||
|
// parse off the "ScriptEngine."
|
||||||
|
scriptEngineNameIndex = m_ScriptEngine.ScriptEngineName.IndexOf(".", scriptEngineNameIndex);
|
||||||
|
scriptEngineNameIndex++; // get past delimiter
|
||||||
|
|
||||||
|
int scriptEngineNameLength = m_ScriptEngine.ScriptEngineName.Length - scriptEngineNameIndex;
|
||||||
|
|
||||||
|
// create char array then a string that is only the script engine name
|
||||||
|
Char[] scriptEngineNameCharArray = m_ScriptEngine.ScriptEngineName.ToCharArray(scriptEngineNameIndex, scriptEngineNameLength);
|
||||||
|
String scriptEngineName = new String(scriptEngineNameCharArray);
|
||||||
|
|
||||||
|
return scriptEngineName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,5 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
|
|
||||||
void osOpenRemoteDataChannel(string channel);
|
void osOpenRemoteDataChannel(string channel);
|
||||||
|
|
||||||
|
string osGetScriptEngineName();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
IConfig Config { get; }
|
IConfig Config { get; }
|
||||||
Object AsyncCommands { get; }
|
Object AsyncCommands { get; }
|
||||||
ILog Log { get; }
|
ILog Log { get; }
|
||||||
|
string ScriptEngineName { get; }
|
||||||
|
|
||||||
bool PostScriptEvent(LLUUID itemID, EventParams parms);
|
bool PostScriptEvent(LLUUID itemID, EventParams parms);
|
||||||
bool PostObjectEvent(uint localID, EventParams parms);
|
bool PostObjectEvent(uint localID, EventParams parms);
|
||||||
|
|
|
@ -549,5 +549,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
throw new Exception("OSSL Runtime Error: " + msg);
|
throw new Exception("OSSL Runtime Error: " + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string osGetScriptEngineName()
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
int scriptEngineNameIndex = 0;
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName))
|
||||||
|
{
|
||||||
|
// parse off the "ScriptEngine."
|
||||||
|
scriptEngineNameIndex = m_ScriptEngine.ScriptEngineName.IndexOf(".", scriptEngineNameIndex);
|
||||||
|
scriptEngineNameIndex++; // get past delimiter
|
||||||
|
|
||||||
|
int scriptEngineNameLength = m_ScriptEngine.ScriptEngineName.Length - scriptEngineNameIndex;
|
||||||
|
|
||||||
|
// create char array then a string that is only the script engine name
|
||||||
|
Char[] scriptEngineNameCharArray = m_ScriptEngine.ScriptEngineName.ToCharArray(scriptEngineNameIndex, scriptEngineNameLength);
|
||||||
|
String scriptEngineName = new String(scriptEngineNameCharArray);
|
||||||
|
|
||||||
|
return scriptEngineName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,5 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
|
|
||||||
double osList2Double(LSL_Types.list src, int index);
|
double osList2Double(LSL_Types.list src, int index);
|
||||||
void osSetRegionWaterHeight(double height);
|
void osSetRegionWaterHeight(double height);
|
||||||
|
|
||||||
|
string osGetScriptEngineName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,5 +195,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osSetStateEvents(events);
|
m_OSSL_Functions.osSetStateEvents(events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string osGetScriptEngineName()
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osGetScriptEngineName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue