diff options
author | Justin Clarke Casey | 2008-09-18 18:58:39 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-18 18:58:39 +0000 |
commit | 48978ba3e015e5ac8f3b7e2700926220f5648f93 (patch) | |
tree | 7ee0d5a4b2cb0ca92ba75414b4eb3b0b98350c65 /OpenSim/Region/ScriptEngine | |
parent | * Make the ode simulation update loop print out the stack if an exception occ... (diff) | |
download | opensim-SC_OLD-48978ba3e015e5ac8f3b7e2700926220f5648f93.zip opensim-SC_OLD-48978ba3e015e5ac8f3b7e2700926220f5648f93.tar.gz opensim-SC_OLD-48978ba3e015e5ac8f3b7e2700926220f5648f93.tar.bz2 opensim-SC_OLD-48978ba3e015e5ac8f3b7e2700926220f5648f93.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=2212
* Update llGetNumberOfNotecardLines() and llGetNotecardLine() to use dataserver on dotnetengine
* Thanks M.Igarashi
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 23 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs index 08693b3..825ecf2 100644 --- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs | |||
@@ -1601,7 +1601,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1601 | return m_LSL_Functions.llGetNumberOfPrims(); | 1601 | return m_LSL_Functions.llGetNumberOfPrims(); |
1602 | } | 1602 | } |
1603 | 1603 | ||
1604 | public int llGetNumberOfNotecardLines(string name) | 1604 | public string llGetNumberOfNotecardLines(string name) |
1605 | { | 1605 | { |
1606 | return m_LSL_Functions.llGetNumberOfNotecardLines(name); | 1606 | return m_LSL_Functions.llGetNumberOfNotecardLines(name); |
1607 | } | 1607 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index a9ecd70..2eb50ef 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -8210,22 +8210,26 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
8210 | { | 8210 | { |
8211 | throw new Exception("LSL Runtime Error: " + msg); | 8211 | throw new Exception("LSL Runtime Error: " + msg); |
8212 | } | 8212 | } |
8213 | public int llGetNumberOfNotecardLines(string name) | 8213 | |
8214 | public string llGetNumberOfNotecardLines(string name) | ||
8214 | { | 8215 | { |
8215 | m_host.AddScriptLPS(1); | 8216 | m_host.AddScriptLPS(1); |
8216 | 8217 | ||
8217 | // TODO: this script function should actually return | ||
8218 | // the number of lines via the dataserver event | ||
8219 | // once it is implemented - krtaylor | ||
8220 | |||
8221 | String[] notecardLines = GetNotecardLines(name); | 8218 | String[] notecardLines = GetNotecardLines(name); |
8222 | if (!String.IsNullOrEmpty(notecardLines[0])) | 8219 | if (!String.IsNullOrEmpty(notecardLines[0])) |
8223 | { | 8220 | { |
8224 | return notecardLines.Length; | 8221 | UUID rq = UUID.Random(); |
8222 | |||
8223 | UUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( | ||
8224 | m_localID, m_itemID, rq.ToString()); | ||
8225 | |||
8226 | m_ScriptEngine.m_ASYNCLSLCommandManager. | ||
8227 | m_Dataserver.DataserverReply(rq.ToString(), notecardLines.Length.ToString()); | ||
8228 | return tid.ToString(); | ||
8225 | } | 8229 | } |
8226 | else | 8230 | else |
8227 | { | 8231 | { |
8228 | return 0; | 8232 | return UUID.Zero.ToString(); |
8229 | } | 8233 | } |
8230 | // ScriptSleep(100); | 8234 | // ScriptSleep(100); |
8231 | } | 8235 | } |
@@ -8234,24 +8238,27 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
8234 | { | 8238 | { |
8235 | m_host.AddScriptLPS(1); | 8239 | m_host.AddScriptLPS(1); |
8236 | 8240 | ||
8237 | // TODO: this script function should actually return | ||
8238 | // the requested notecard line via the dataserver event | ||
8239 | // once it is implemented - krtaylor | ||
8240 | |||
8241 | String[] notecardLines = GetNotecardLines(name); | 8241 | String[] notecardLines = GetNotecardLines(name); |
8242 | 8242 | ||
8243 | line--; // array starts at 0 | 8243 | // line index starts at zero |
8244 | if ((!String.IsNullOrEmpty(notecardLines[0])) && | 8244 | if ((!String.IsNullOrEmpty(notecardLines[0])) && |
8245 | (line >= 0) && | 8245 | (line >= 0) && |
8246 | (line < notecardLines.Length)) | 8246 | (line < notecardLines.Length)) |
8247 | { | 8247 | { |
8248 | // ScriptSleep(100); | 8248 | // ScriptSleep(100); |
8249 | return notecardLines[line]; | 8249 | UUID rq = UUID.Random(); |
8250 | |||
8251 | UUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( | ||
8252 | m_localID, m_itemID, rq.ToString()); | ||
8253 | |||
8254 | m_ScriptEngine.m_ASYNCLSLCommandManager. | ||
8255 | m_Dataserver.DataserverReply(rq.ToString(), notecardLines[line]); | ||
8256 | return tid.ToString(); | ||
8250 | } | 8257 | } |
8251 | else | 8258 | else |
8252 | { | 8259 | { |
8253 | // ScriptSleep(100); | 8260 | // ScriptSleep(100); |
8254 | return String.Empty; | 8261 | return UUID.Zero.ToString(); |
8255 | } | 8262 | } |
8256 | } | 8263 | } |
8257 | 8264 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index 9e3742c..d4cf3f5 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs | |||
@@ -540,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
540 | //wiki: integer llGetNumberOfPrims() | 540 | //wiki: integer llGetNumberOfPrims() |
541 | LSL_Types.LSLInteger llGetNumberOfPrims(); | 541 | LSL_Types.LSLInteger llGetNumberOfPrims(); |
542 | //wiki: key llGetNumberOfNotecardLines(string name) | 542 | //wiki: key llGetNumberOfNotecardLines(string name) |
543 | int llGetNumberOfNotecardLines(string name); | 543 | string llGetNumberOfNotecardLines(string name); |
544 | //wiki: list llGetBoundingBox(key object) | 544 | //wiki: list llGetBoundingBox(key object) |
545 | LSL_Types.list llGetBoundingBox(string obj); | 545 | LSL_Types.list llGetBoundingBox(string obj); |
546 | //wiki: vector llGetGeometricCenter() | 546 | //wiki: vector llGetGeometricCenter() |