diff options
author | UbitUmarov | 2019-04-08 13:50:51 +0100 |
---|---|---|
committer | UbitUmarov | 2019-04-08 13:50:51 +0100 |
commit | b104934a258c34a77c0470b8495d9d286c82f4f5 (patch) | |
tree | dab6471bc23aea9ebea3f1132a99d958be63552f /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | make robust ban by MAC options visible, thx Bill Blight (diff) | |
download | opensim-SC-b104934a258c34a77c0470b8495d9d286c82f4f5.zip opensim-SC-b104934a258c34a77c0470b8495d9d286c82f4f5.tar.gz opensim-SC-b104934a258c34a77c0470b8495d9d286c82f4f5.tar.bz2 opensim-SC-b104934a258c34a77c0470b8495d9d286c82f4f5.tar.xz |
add osGetPSTWallclock() returns wall clock in PST or PDT, for those that for some odd reason think need it. OpenSim girds shoudl use UTC (gtm) but whatever
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7348499..4a74c15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -145,6 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
145 | protected IUrlModule m_UrlModule = null; | 145 | protected IUrlModule m_UrlModule = null; |
146 | protected ISoundModule m_SoundModule = null; | 146 | protected ISoundModule m_SoundModule = null; |
147 | internal IConfig m_osslconfig; | 147 | internal IConfig m_osslconfig; |
148 | internal TimeZoneInfo PSTTimeZone = null; | ||
148 | 149 | ||
149 | public void Initialize( | 150 | public void Initialize( |
150 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) | 151 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
@@ -201,7 +202,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
201 | default: | 202 | default: |
202 | break; | 203 | break; |
203 | } | 204 | } |
204 | } | 205 | |
206 | try | ||
207 | { | ||
208 | PSTTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); | ||
209 | } | ||
210 | catch | ||
211 | { | ||
212 | PSTTimeZone = null; | ||
213 | } | ||
214 | } | ||
205 | 215 | ||
206 | public override Object InitializeLifetimeService() | 216 | public override Object InitializeLifetimeService() |
207 | { | 217 | { |
@@ -5441,5 +5451,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5441 | return String.Empty; | 5451 | return String.Empty; |
5442 | return detectedParams.Key.ToString(); | 5452 | return detectedParams.Key.ToString(); |
5443 | } | 5453 | } |
5454 | |||
5455 | // returns PST or PDT wall clock | ||
5456 | public LSL_Float osGetPSTWallclock() | ||
5457 | { | ||
5458 | m_host.AddScriptLPS(1); | ||
5459 | if(PSTTimeZone == null) | ||
5460 | return DateTime.Now.TimeOfDay.TotalSeconds; | ||
5461 | |||
5462 | DateTime time = TimeZoneInfo.ConvertTime(DateTime.UtcNow, PSTTimeZone); | ||
5463 | return time.TimeOfDay.TotalSeconds; | ||
5464 | } | ||
5444 | } | 5465 | } |
5445 | } \ No newline at end of file | 5466 | } \ No newline at end of file |