aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs23
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs6
3 files changed, 29 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
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 49b3f74..26bac00 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -549,5 +549,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
549 LSL_String osGetInventoryName(LSL_Key itemId); 549 LSL_String osGetInventoryName(LSL_Key itemId);
550 LSL_String osGetInventoryDesc(LSL_String itemNameOrId); 550 LSL_String osGetInventoryDesc(LSL_String itemNameOrId);
551 LSL_Key osGetLastChangedEventKey(); 551 LSL_Key osGetLastChangedEventKey();
552 LSL_Float osGetPSTWallclock();
552 } 553 }
553} 554}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index fb491e4..7a4a5fb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1381,5 +1381,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1381 { 1381 {
1382 return m_OSSL_Functions.osGetLastChangedEventKey(); 1382 return m_OSSL_Functions.osGetLastChangedEventKey();
1383 } 1383 }
1384
1385 public LSL_Float osGetPSTWallclock()
1386 {
1387 return m_OSSL_Functions.osGetPSTWallclock();
1388 }
1389
1384 } 1390 }
1385} 1391}