mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
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.
This commit is contained in:
@@ -549,5 +549,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
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);
|
||||
void osSetRegionWaterHeight(double height);
|
||||
|
||||
string osGetScriptEngineName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,5 +195,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
m_OSSL_Functions.osSetStateEvents(events);
|
||||
}
|
||||
|
||||
public string osGetScriptEngineName()
|
||||
{
|
||||
return m_OSSL_Functions.osGetScriptEngineName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user