mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
minor changes on llgettime
This commit is contained in:
@@ -117,7 +117,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
protected float m_recoilScaleFactor = 0.0f;
|
||||
protected bool m_AllowGodFunctions;
|
||||
|
||||
protected double m_timer = Util.GetTimeStampMS();
|
||||
protected double m_timer = Util.GetTimeStamp();
|
||||
protected bool m_waitingForScriptAnswer = false;
|
||||
protected bool m_automaticLinkPermission = false;
|
||||
protected int m_notecardLineReadCharsMax = 255;
|
||||
@@ -2821,21 +2821,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public LSL_Float llGetTime()
|
||||
{
|
||||
double ScriptTime = Util.GetTimeStampMS() - m_timer;
|
||||
return (float)Math.Round((ScriptTime / 1000.0), 3);
|
||||
double ScriptTime = Util.GetTimeStamp() - m_timer;
|
||||
return Math.Round(ScriptTime, 3);
|
||||
}
|
||||
|
||||
public void llResetTime()
|
||||
{
|
||||
m_timer = Util.GetTimeStampMS();
|
||||
m_timer = Util.GetTimeStamp();
|
||||
}
|
||||
|
||||
public LSL_Float llGetAndResetTime()
|
||||
{
|
||||
double now = Util.GetTimeStampMS();
|
||||
double now = Util.GetTimeStamp();
|
||||
double ScriptTime = now - m_timer;
|
||||
m_timer = now;
|
||||
return (float)Math.Round((ScriptTime / 1000.0), 3);
|
||||
return Math.Round(ScriptTime, 3);
|
||||
}
|
||||
|
||||
public void llSound(string sound, double volume, int queue, int loop)
|
||||
|
||||
@@ -78,14 +78,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
inst.Die();
|
||||
}
|
||||
|
||||
public void SetLSLTimer(double time)
|
||||
public void SetLSLTimerMS(double timeMS)
|
||||
{
|
||||
m_timer = time;
|
||||
m_timer = 0.001 * timeMS;
|
||||
}
|
||||
|
||||
public double getLSLTimer()
|
||||
public double getLSLTimerMS()
|
||||
{
|
||||
return(m_timer);
|
||||
return m_timer * 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
if(m_XMRLSLApi is not null)
|
||||
{
|
||||
double scriptTime = Util.GetTimeStampMS() - m_XMRLSLApi.getLSLTimer();
|
||||
double scriptTime = Util.GetTimeStampMS() - m_XMRLSLApi.getLSLTimerMS();
|
||||
XmlElement scriptTimeN = doc.CreateElement("", "scrpTime", "");
|
||||
scriptTimeN.AppendChild(doc.CreateTextNode(scriptTime.ToString()));
|
||||
scriptStateN.AppendChild(scriptTimeN);
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
XmlElement scpttimeN = (XmlElement)scriptStateN.SelectSingleNode("scrpTime");
|
||||
if (scpttimeN != null && Double.TryParse(scpttimeN.InnerText, out double t))
|
||||
{
|
||||
m_XMRLSLApi.SetLSLTimer(Util.GetTimeStampMS() - t);
|
||||
m_XMRLSLApi.SetLSLTimerMS(Util.GetTimeStampMS() - t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user