diff options
author | UbitUmarov | 2016-11-06 02:43:33 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-06 02:43:33 +0000 |
commit | d07f48605f90a0f0485d0ac11ec5641bbb88a28a (patch) | |
tree | cb2421feebf994f961c91160ab31a13aba436286 | |
parent | avoid a null ref, few changes to udp updates send (diff) | |
download | opensim-SC_OLD-d07f48605f90a0f0485d0ac11ec5641bbb88a28a.zip opensim-SC_OLD-d07f48605f90a0f0485d0ac11ec5641bbb88a28a.tar.gz opensim-SC_OLD-d07f48605f90a0f0485d0ac11ec5641bbb88a28a.tar.bz2 opensim-SC_OLD-d07f48605f90a0f0485d0ac11ec5641bbb88a28a.tar.xz |
change llGetTime() source clock
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ba22201..02a9ebc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
113 | protected float m_MinTimerInterval = 0.5f; | 113 | protected float m_MinTimerInterval = 0.5f; |
114 | protected float m_recoilScaleFactor = 0.0f; | 114 | protected float m_recoilScaleFactor = 0.0f; |
115 | 115 | ||
116 | protected DateTime m_timer = DateTime.Now; | 116 | protected double m_timer = Util.GetTimeStampMS(); |
117 | protected bool m_waitingForScriptAnswer = false; | 117 | protected bool m_waitingForScriptAnswer = false; |
118 | protected bool m_automaticLinkPermission = false; | 118 | protected bool m_automaticLinkPermission = false; |
119 | protected IMessageTransferModule m_TransferModule = null; | 119 | protected IMessageTransferModule m_TransferModule = null; |
@@ -3048,22 +3048,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3048 | public LSL_Float llGetTime() | 3048 | public LSL_Float llGetTime() |
3049 | { | 3049 | { |
3050 | m_host.AddScriptLPS(1); | 3050 | m_host.AddScriptLPS(1); |
3051 | TimeSpan ScriptTime = DateTime.Now - m_timer; | 3051 | double ScriptTime = Util.GetTimeStampMS() - m_timer; |
3052 | return (double)(ScriptTime.TotalMilliseconds / 1000); | 3052 | return (ScriptTime / 1000.0); |
3053 | } | 3053 | } |
3054 | 3054 | ||
3055 | public void llResetTime() | 3055 | public void llResetTime() |
3056 | { | 3056 | { |
3057 | m_host.AddScriptLPS(1); | 3057 | m_host.AddScriptLPS(1); |
3058 | m_timer = DateTime.Now; | 3058 | m_timer = Util.GetTimeStampMS(); |
3059 | } | 3059 | } |
3060 | 3060 | ||
3061 | public LSL_Float llGetAndResetTime() | 3061 | public LSL_Float llGetAndResetTime() |
3062 | { | 3062 | { |
3063 | m_host.AddScriptLPS(1); | 3063 | m_host.AddScriptLPS(1); |
3064 | TimeSpan ScriptTime = DateTime.Now - m_timer; | 3064 | double now = Util.GetTimeStampMS(); |
3065 | m_timer = DateTime.Now; | 3065 | double ScriptTime = now - m_timer; |
3066 | return (double)(ScriptTime.TotalMilliseconds / 1000); | 3066 | m_timer = now; |
3067 | return (ScriptTime / 1000.0); | ||
3067 | } | 3068 | } |
3068 | 3069 | ||
3069 | public void llSound(string sound, double volume, int queue, int loop) | 3070 | public void llSound(string sound, double volume, int queue, int loop) |
@@ -14544,7 +14545,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14544 | bool checkNonPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_NONPHYSICAL) == ScriptBaseClass.RC_REJECT_NONPHYSICAL); | 14545 | bool checkNonPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_NONPHYSICAL) == ScriptBaseClass.RC_REJECT_NONPHYSICAL); |
14545 | bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); | 14546 | bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); |
14546 | 14547 | ||
14547 | |||
14548 | if (World.SupportsRayCastFiltered()) | 14548 | if (World.SupportsRayCastFiltered()) |
14549 | { | 14549 | { |
14550 | if (dist == 0) | 14550 | if (dist == 0) |
@@ -14650,7 +14650,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14650 | { | 14650 | { |
14651 | return a.Depth.CompareTo(b.Depth); | 14651 | return a.Depth.CompareTo(b.Depth); |
14652 | }); | 14652 | }); |
14653 | 14653 | ||
14654 | int values = 0; | 14654 | int values = 0; |
14655 | SceneObjectGroup thisgrp = m_host.ParentGroup; | 14655 | SceneObjectGroup thisgrp = m_host.ParentGroup; |
14656 | 14656 | ||
@@ -14704,7 +14704,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14704 | } | 14704 | } |
14705 | 14705 | ||
14706 | list.Add(new LSL_Integer(values)); | 14706 | list.Add(new LSL_Integer(values)); |
14707 | |||
14708 | return list; | 14707 | return list; |
14709 | } | 14708 | } |
14710 | 14709 | ||