diff options
author | Charles Krinke | 2007-12-14 16:10:56 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-14 16:10:56 +0000 |
commit | 9ca70e029aed533a2cd702e4b21ed937f49b7aa8 (patch) | |
tree | 1c406c574fd7617600c32bfa049fba44bcd1f416 /OpenSim/Region/ScriptEngine/DotNetEngine | |
parent | * Just making Create public (diff) | |
download | opensim-SC-9ca70e029aed533a2cd702e4b21ed937f49b7aa8.zip opensim-SC-9ca70e029aed533a2cd702e4b21ed937f49b7aa8.tar.gz opensim-SC-9ca70e029aed533a2cd702e4b21ed937f49b7aa8.tar.bz2 opensim-SC-9ca70e029aed533a2cd702e4b21ed937f49b7aa8.tar.xz |
Again, thanks to Alondria for: adding llGetTime, llResetTime, and llGetAndResetTime.
Also for fixing Rot/Vector Regex from being too greedy by removing bug in the
LSL->C# converter that was causing the vector and rotation parser.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 8155b44..d9ebd14 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -248,10 +248,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
248 | 248 | ||
249 | // Replace <x,y,z> and <x,y,z,r> | 249 | // Replace <x,y,z> and <x,y,z,r> |
250 | Script = | 250 | Script = |
251 | Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", | 251 | Regex.Replace(Script, @"<([^,>;\)]*,[^,>;\)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Quaternion($1)", |
252 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 252 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
253 | Script = | 253 | Script = |
254 | Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)", | 254 | Regex.Replace(Script, @"<([^,>;\)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Vector3($1)", |
255 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 255 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
256 | 256 | ||
257 | // Replace List []'s | 257 | // Replace List []'s |
@@ -317,4 +317,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
317 | return Return; | 317 | return Return; |
318 | } | 318 | } |
319 | } | 319 | } |
320 | } \ No newline at end of file | 320 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 40c6533..8563694 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -69,6 +69,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
69 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); | 69 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); |
70 | } | 70 | } |
71 | 71 | ||
72 | private DateTime m_timer = DateTime.Now; | ||
72 | private string m_state = "default"; | 73 | private string m_state = "default"; |
73 | 74 | ||
74 | public string State() | 75 | public string State() |
@@ -843,19 +844,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
843 | 844 | ||
844 | public double llGetTime() | 845 | public double llGetTime() |
845 | { | 846 | { |
846 | NotImplemented("llGetTime"); | 847 | TimeSpan ScriptTime = DateTime.Now - m_timer; |
847 | return 0; | 848 | return (double)(ScriptTime.TotalMilliseconds / 1000); |
848 | } | 849 | } |
849 | 850 | ||
850 | public void llResetTime() | 851 | public void llResetTime() |
851 | { | 852 | { |
852 | NotImplemented("llResetTime"); | 853 | m_timer = DateTime.Now; |
853 | } | 854 | } |
854 | 855 | ||
855 | public double llGetAndResetTime() | 856 | public double llGetAndResetTime() |
856 | { | 857 | { |
857 | NotImplemented("llGetAndResetTime"); | 858 | TimeSpan ScriptTime = DateTime.Now - m_timer; |
858 | return 0; | 859 | m_timer = DateTime.Now; |
860 | return (double)(ScriptTime.TotalMilliseconds / 1000); | ||
859 | } | 861 | } |
860 | 862 | ||
861 | public void llSound() | 863 | public void llSound() |