aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorDr Scofield2008-07-01 07:16:02 +0000
committerDr Scofield2008-07-01 07:16:02 +0000
commit5e63206018d6d24671ad59d77951082b77f02618 (patch)
tree28da5c8f920b1dc9afa83d8c68ceb5d6e43aee32 /OpenSim/Region/ScriptEngine/Shared
parentMantis#1639. Thank you, Melanie for a patch that: (diff)
downloadopensim-SC_OLD-5e63206018d6d24671ad59d77951082b77f02618.zip
opensim-SC_OLD-5e63206018d6d24671ad59d77951082b77f02618.tar.gz
opensim-SC_OLD-5e63206018d6d24671ad59d77951082b77f02618.tar.bz2
opensim-SC_OLD-5e63206018d6d24671ad59d77951082b77f02618.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs26
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index dbb78a4..5414b95 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -549,5 +549,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
549 { 549 {
550 throw new Exception("OSSL Runtime Error: " + msg); 550 throw new Exception("OSSL Runtime Error: " + msg);
551 } 551 }
552
553 public string osGetScriptEngineName()
554 {
555 m_host.AddScriptLPS(1);
556
557 int scriptEngineNameIndex = 0;
558
559 if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName))
560 {
561 // parse off the "ScriptEngine."
562 scriptEngineNameIndex = m_ScriptEngine.ScriptEngineName.IndexOf(".", scriptEngineNameIndex);
563 scriptEngineNameIndex++; // get past delimiter
564
565 int scriptEngineNameLength = m_ScriptEngine.ScriptEngineName.Length - scriptEngineNameIndex;
566
567 // create char array then a string that is only the script engine name
568 Char[] scriptEngineNameCharArray = m_ScriptEngine.ScriptEngineName.ToCharArray(scriptEngineNameIndex, scriptEngineNameLength);
569 String scriptEngineName = new String(scriptEngineNameCharArray);
570
571 return scriptEngineName;
572 }
573 else
574 {
575 return String.Empty;
576 }
577 }
552 } 578 }
553} 579}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 1e14c63..d55491c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -64,5 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
64 64
65 double osList2Double(LSL_Types.list src, int index); 65 double osList2Double(LSL_Types.list src, int index);
66 void osSetRegionWaterHeight(double height); 66 void osSetRegionWaterHeight(double height);
67
68 string osGetScriptEngineName();
67 } 69 }
68} 70}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 34e2fb1..90c4419 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -195,5 +195,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
195 { 195 {
196 m_OSSL_Functions.osSetStateEvents(events); 196 m_OSSL_Functions.osSetStateEvents(events);
197 } 197 }
198
199 public string osGetScriptEngineName()
200 {
201 return m_OSSL_Functions.osGetScriptEngineName();
202 }
198 } 203 }
199} 204}