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
Dr Scofield 2008-07-01 07:16:02 +00:00
parent bf34f65125
commit 5e63206018
7 changed files with 67 additions and 0 deletions

View File

@ -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)

View File

@ -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;
}
}
}
}

View File

@ -64,5 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Common
void osOpenRemoteDataChannel(string channel);
string osGetScriptEngineName();
}
}

View File

@ -46,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
IConfig Config { get; }
Object AsyncCommands { get; }
ILog Log { get; }
string ScriptEngineName { get; }
bool PostScriptEvent(LLUUID itemID, EventParams parms);
bool PostObjectEvent(uint localID, EventParams parms);

View File

@ -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;
}
}
}
}

View File

@ -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();
}
}

View File

@ -195,5 +195,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_OSSL_Functions.osSetStateEvents(events);
}
public string osGetScriptEngineName()
{
return m_OSSL_Functions.osGetScriptEngineName();
}
}
}