change llGetTime() source clock

melanie
UbitUmarov 2016-11-06 02:43:33 +00:00
parent 6bc76860d1
commit d07f48605f
1 changed files with 9 additions and 10 deletions

View File

@ -113,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected float m_MinTimerInterval = 0.5f; protected float m_MinTimerInterval = 0.5f;
protected float m_recoilScaleFactor = 0.0f; protected float m_recoilScaleFactor = 0.0f;
protected DateTime m_timer = DateTime.Now; protected double m_timer = Util.GetTimeStampMS();
protected bool m_waitingForScriptAnswer = false; protected bool m_waitingForScriptAnswer = false;
protected bool m_automaticLinkPermission = false; protected bool m_automaticLinkPermission = false;
protected IMessageTransferModule m_TransferModule = null; protected IMessageTransferModule m_TransferModule = null;
@ -3048,22 +3048,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llGetTime() public LSL_Float llGetTime()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
TimeSpan ScriptTime = DateTime.Now - m_timer; double ScriptTime = Util.GetTimeStampMS() - m_timer;
return (double)(ScriptTime.TotalMilliseconds / 1000); return (ScriptTime / 1000.0);
} }
public void llResetTime() public void llResetTime()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_timer = DateTime.Now; m_timer = Util.GetTimeStampMS();
} }
public LSL_Float llGetAndResetTime() public LSL_Float llGetAndResetTime()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
TimeSpan ScriptTime = DateTime.Now - m_timer; double now = Util.GetTimeStampMS();
m_timer = DateTime.Now; double ScriptTime = now - m_timer;
return (double)(ScriptTime.TotalMilliseconds / 1000); m_timer = now;
return (ScriptTime / 1000.0);
} }
public void llSound(string sound, double volume, int queue, int loop) public void llSound(string sound, double volume, int queue, int loop)
@ -14544,7 +14545,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool checkNonPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_NONPHYSICAL) == ScriptBaseClass.RC_REJECT_NONPHYSICAL); bool checkNonPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_NONPHYSICAL) == ScriptBaseClass.RC_REJECT_NONPHYSICAL);
bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL);
if (World.SupportsRayCastFiltered()) if (World.SupportsRayCastFiltered())
{ {
if (dist == 0) if (dist == 0)
@ -14704,7 +14704,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
list.Add(new LSL_Integer(values)); list.Add(new LSL_Integer(values));
return list; return list;
} }