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.
afrisby
Charles Krinke 2007-12-14 16:10:56 +00:00
parent 9ed2b26232
commit 9ca70e029a
2 changed files with 10 additions and 8 deletions

View File

@ -248,10 +248,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// Replace <x,y,z> and <x,y,z,r>
Script =
Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)",
Regex.Replace(Script, @"<([^,>;\)]*,[^,>;\)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Quaternion($1)",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
Script =
Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)",
Regex.Replace(Script, @"<([^,>;\)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Vector3($1)",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// Replace List []'s

View File

@ -69,6 +69,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
//MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
}
private DateTime m_timer = DateTime.Now;
private string m_state = "default";
public string State()
@ -843,19 +844,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public double llGetTime()
{
NotImplemented("llGetTime");
return 0;
TimeSpan ScriptTime = DateTime.Now - m_timer;
return (double)(ScriptTime.TotalMilliseconds / 1000);
}
public void llResetTime()
{
NotImplemented("llResetTime");
m_timer = DateTime.Now;
}
public double llGetAndResetTime()
{
NotImplemented("llGetAndResetTime");
return 0;
TimeSpan ScriptTime = DateTime.Now - m_timer;
m_timer = DateTime.Now;
return (double)(ScriptTime.TotalMilliseconds / 1000);
}
public void llSound()