From b104934a258c34a77c0470b8495d9d286c82f4f5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 Apr 2019 13:50:51 +0100 Subject: [PATCH] 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 --- .../Shared/Api/Implementation/OSSL_Api.cs | 23 +++- .../Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Shared/Api/Runtime/OSSL_Stub.cs | 6 + bin/ScriptSyntax.xml | 123 +++++++++--------- 4 files changed, 93 insertions(+), 60 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7348499461..4a74c1530b 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 protected IUrlModule m_UrlModule = null; protected ISoundModule m_SoundModule = null; internal IConfig m_osslconfig; + internal TimeZoneInfo PSTTimeZone = null; public void Initialize( IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) @@ -201,7 +202,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api default: break; } - } + + try + { + PSTTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); + } + catch + { + PSTTimeZone = null; + } + } public override Object InitializeLifetimeService() { @@ -5441,5 +5451,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return String.Empty; return detectedParams.Key.ToString(); } + + // returns PST or PDT wall clock + public LSL_Float osGetPSTWallclock() + { + m_host.AddScriptLPS(1); + if(PSTTimeZone == null) + return DateTime.Now.TimeOfDay.TotalSeconds; + + DateTime time = TimeZoneInfo.ConvertTime(DateTime.UtcNow, PSTTimeZone); + return time.TimeOfDay.TotalSeconds; + } } } \ 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 49b3f74e8c..26bac00da4 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 LSL_String osGetInventoryName(LSL_Key itemId); LSL_String osGetInventoryDesc(LSL_String itemNameOrId); LSL_Key osGetLastChangedEventKey(); + LSL_Float osGetPSTWallclock(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index fb491e4923..7a4a5fb1d3 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 { return m_OSSL_Functions.osGetLastChangedEventKey(); } + + public LSL_Float osGetPSTWallclock() + { + return m_OSSL_Functions.osGetPSTWallclock(); + } + } } diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 8f2f6002f9..989984a31b 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -1,4 +1,4 @@ -20392e48-fad2-094e-bc5b-cda003a1e940 +e796a21f-5a66-e4ec-833f-c4896b8e87e4 llsd-lsl-syntax-version2 controls @@ -6116,6 +6116,41 @@ arguments atypefloat btypefloat + margintypefloat + + + osApproxEquals + + returninteger + arguments + ratyperotation + rbtyperotation + margintypefloat + + + osApproxEquals + + returninteger + arguments + ratyperotation + rbtyperotation + + + osApproxEquals + + returninteger + arguments + vatypevector + vbtypevector + margintypefloat + + + osApproxEquals + + returninteger + arguments + vatypevector + vbtypevector osApproxEquals @@ -6124,41 +6159,6 @@ arguments atypefloat btypefloat - margintypefloat - - - osApproxEquals - - returninteger - arguments - ratyperotation - rbtyperotation - - - osApproxEquals - - returninteger - arguments - vatypevector - vbtypevector - margintypefloat - - - osApproxEquals - - returninteger - arguments - ratyperotation - rbtyperotation - margintypefloat - - - osApproxEquals - - returninteger - arguments - vatypevector - vbtypevector osAvatarName2Key @@ -6284,6 +6284,8 @@ returnstring arguments drawListtypestring + startXtypeinteger + startYtypeinteger endXtypeinteger endYtypeinteger @@ -6293,8 +6295,6 @@ returnstring arguments drawListtypestring - startXtypeinteger - startYtypeinteger endXtypeinteger endYtypeinteger @@ -6433,13 +6433,13 @@ arguments avatartypestring - targettypestring osForceOtherSit arguments avatartypestring + targettypestring osFormatString @@ -6653,6 +6653,11 @@ rulestypelist + osGetPSTWallclock + + returnfloat + arguments + osGetRegionMapTexture returnkey @@ -6865,6 +6870,7 @@ nametypestring positiontypevector notecardtypestring + optionstypeinteger osNpcCreate @@ -6875,7 +6881,6 @@ nametypestring positiontypevector notecardtypestring - optionstypeinteger osNpcGetOwner @@ -7100,13 +7105,13 @@ osRegionNotice arguments - agentIDtypekey msgtypestring osRegionNotice arguments + agentIDtypekey msgtypestring @@ -7478,6 +7483,8 @@ arguments srctypestring valuetypestring + starttypeinteger + counttypeinteger ignorecasetypeinteger @@ -7487,8 +7494,6 @@ arguments srctypestring valuetypestring - starttypeinteger - counttypeinteger ignorecasetypeinteger @@ -7551,6 +7556,15 @@ osTeleportAgent + + arguments + agenttypestring + regionNametypestring + positiontypevector + lookattypevector + + + osTeleportAgent arguments agenttypestring @@ -7568,15 +7582,6 @@ lookattypevector - osTeleportAgent - - arguments - agenttypestring - regionNametypestring - positiontypevector - lookattypevector - - osTeleportObject returninteger @@ -7588,13 +7593,6 @@ osTeleportOwner - - arguments - positiontypevector - lookattypevector - - - osTeleportOwner arguments regionNametypestring @@ -7611,6 +7609,13 @@ lookattypevector + osTeleportOwner + + arguments + positiontypevector + lookattypevector + + osTerrainFlush arguments