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

0.9.1.0-post-fixes
UbitUmarov 2019-04-08 13:50:51 +01:00
parent 539a3a9273
commit b104934a25
4 changed files with 93 additions and 60 deletions

View File

@ -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;
}
}
}

View File

@ -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();
}
}

View File

@ -1381,5 +1381,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osGetLastChangedEventKey();
}
public LSL_Float osGetPSTWallclock()
{
return m_OSSL_Functions.osGetPSTWallclock();
}
}
}

View File

@ -1,4 +1,4 @@
20392e48-fad2-094e-bc5b-cda003a1e940
e796a21f-5a66-e4ec-833f-c4896b8e87e4
<llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer>
<key>controls</key>
<map>
@ -6116,6 +6116,41 @@
<key>arguments</key><array>
<map><key>a</key><map><key>type</key><string>float</string></map></map>
<map><key>b</key><map><key>type</key><string>float</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>ra</key><map><key>type</key><string>rotation</string></map></map>
<map><key>rb</key><map><key>type</key><string>rotation</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>ra</key><map><key>type</key><string>rotation</string></map></map>
<map><key>rb</key><map><key>type</key><string>rotation</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>va</key><map><key>type</key><string>vector</string></map></map>
<map><key>vb</key><map><key>type</key><string>vector</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>va</key><map><key>type</key><string>vector</string></map></map>
<map><key>vb</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
@ -6124,41 +6159,6 @@
<key>arguments</key><array>
<map><key>a</key><map><key>type</key><string>float</string></map></map>
<map><key>b</key><map><key>type</key><string>float</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>ra</key><map><key>type</key><string>rotation</string></map></map>
<map><key>rb</key><map><key>type</key><string>rotation</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>va</key><map><key>type</key><string>vector</string></map></map>
<map><key>vb</key><map><key>type</key><string>vector</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>ra</key><map><key>type</key><string>rotation</string></map></map>
<map><key>rb</key><map><key>type</key><string>rotation</string></map></map>
<map><key>margin</key><map><key>type</key><string>float</string></map></map>
</array>
</map>
<key>osApproxEquals</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>va</key><map><key>type</key><string>vector</string></map></map>
<map><key>vb</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osAvatarName2Key</key>
@ -6284,6 +6284,8 @@
<key>return</key><string>string</string>
<key>arguments</key><array>
<map><key>drawList</key><map><key>type</key><string>string</string></map></map>
<map><key>startX</key><map><key>type</key><string>integer</string></map></map>
<map><key>startY</key><map><key>type</key><string>integer</string></map></map>
<map><key>endX</key><map><key>type</key><string>integer</string></map></map>
<map><key>endY</key><map><key>type</key><string>integer</string></map></map>
</array>
@ -6293,8 +6295,6 @@
<key>return</key><string>string</string>
<key>arguments</key><array>
<map><key>drawList</key><map><key>type</key><string>string</string></map></map>
<map><key>startX</key><map><key>type</key><string>integer</string></map></map>
<map><key>startY</key><map><key>type</key><string>integer</string></map></map>
<map><key>endX</key><map><key>type</key><string>integer</string></map></map>
<map><key>endY</key><map><key>type</key><string>integer</string></map></map>
</array>
@ -6433,13 +6433,13 @@
<map>
<key>arguments</key><array>
<map><key>avatar</key><map><key>type</key><string>string</string></map></map>
<map><key>target</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osForceOtherSit</key>
<map>
<key>arguments</key><array>
<map><key>avatar</key><map><key>type</key><string>string</string></map></map>
<map><key>target</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osFormatString</key>
@ -6653,6 +6653,11 @@
<map><key>rules</key><map><key>type</key><string>list</string></map></map>
</array>
</map>
<key>osGetPSTWallclock</key>
<map>
<key>return</key><string>float</string>
<key>arguments</key><undef/>
</map>
<key>osGetRegionMapTexture</key>
<map>
<key>return</key><string>key</string>
@ -6865,6 +6870,7 @@
<map><key>name</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>notecard</key><map><key>type</key><string>string</string></map></map>
<map><key>options</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osNpcCreate</key>
@ -6875,7 +6881,6 @@
<map><key>name</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>notecard</key><map><key>type</key><string>string</string></map></map>
<map><key>options</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osNpcGetOwner</key>
@ -7100,13 +7105,13 @@
<key>osRegionNotice</key>
<map>
<key>arguments</key><array>
<map><key>agentID</key><map><key>type</key><string>key</string></map></map>
<map><key>msg</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osRegionNotice</key>
<map>
<key>arguments</key><array>
<map><key>agentID</key><map><key>type</key><string>key</string></map></map>
<map><key>msg</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
@ -7478,6 +7483,8 @@
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>value</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>count</key><map><key>type</key><string>integer</string></map></map>
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
@ -7487,8 +7494,6 @@
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>value</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>count</key><map><key>type</key><string>integer</string></map></map>
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
@ -7551,6 +7556,15 @@
</array>
</map>
<key>osTeleportAgent</key>
<map>
<key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportAgent</key>
<map>
<key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map>
@ -7568,15 +7582,6 @@
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportAgent</key>
<map>
<key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportObject</key>
<map>
<key>return</key><string>integer</string>
@ -7588,13 +7593,6 @@
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
@ -7611,6 +7609,13 @@
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTerrainFlush</key>
<map>
<key>arguments</key><undef/>