mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +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:
@@ -2022,6 +2022,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_LSL_Functions.osOpenRemoteDataChannel(channel);
|
||||
}
|
||||
|
||||
public string osGetScriptEngineName()
|
||||
{
|
||||
return m_LSL_Functions.osGetScriptEngineName();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
string osGetScriptEngineName();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user