Difference between revisions of "LlGetEnv"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 18: Line 18:
{{!}}-
{{!}}-
{{!}}"sim_channel"
{{!}}"sim_channel"
{{!}}Get the current region's [[Het-Grid_FAQ#What_is_a_channel.3F|channel]] string, for example "Second Life Server"
{{!}}Get the current region's [[Het-Grid_FAQ#What_is_a_channel.3F|channel]] string, for example "Second Life Server".
{{!}}-
{{!}}-
{{!}}"sim_version"
{{!}}"sim_version"
{{!}}Get the current region's [[Version numbering|version number]] string, for example "10.11.30.215699"
{{!}}Get the current region's [[Version numbering|version number]] string, for example "10.11.30.215699".
{{!}}-
{{!}}-
{{!}}"frame_number"
{{!}}"frame_number"
{{!}}Get the frame number of the simulator, for example "42042".  Note that the return value is a string, so cast to an integer for use in calculations
{{!}}Get the frame number of the simulator, for example "42042".  Note that the return value is a string, so cast to an integer for use in calculations.
{{!}}-
{{!}}"region_idle"
{{!}}Get the region's idle status, "1" or "0". Note that the return value is a string, so cast to an integer for use in calculations.
{{!}}}
{{!}}}
|examples=<lsl>
|examples=<lsl>
Line 50: Line 53:
|also_events
|also_events
|also_articles
|also_articles
|notes
|notes=* Region idling lowers a region's framerate when no avatars are currently on or looking into the region.  Scripts measuring time dilation with [[llGetRegionTimeDilation]] may report significant time dilation if the region is idle.
|history=* {{Jira|SVC-4874}}
|history=* {{Jira|SVC-4874}}
*Introduced in [[Release Notes/Second Life RC LeTigre/10#10.11.30.215699|Second Life RC LeTigre 10.11.30.215699]], deployed on 2010-12-01.
*Introduced in [[Release Notes/Second Life RC LeTigre/10#10.11.30.215699|Second Life RC LeTigre 10.11.30.215699]], deployed on 2010-12-01.

Revision as of 09:13, 15 May 2012

Summary

Function: string llGetEnv( string name );

Returns a string with the requested data about the region.

• string name The name of the data to request

Table of valid name values.
Name Description
"sim_channel" Get the current region's channel string, for example "Second Life Server".
"sim_version" Get the current region's version number string, for example "10.11.30.215699".
"frame_number" Get the frame number of the simulator, for example "42042". Note that the return value is a string, so cast to an integer for use in calculations.
"region_idle" Get the region's idle status, "1" or "0". Note that the return value is a string, so cast to an integer for use in calculations.

Examples

<lsl> default {

   touch_start(integer total_number)
   {
       string version = llGetEnv("sim_version");
       llOwnerSay("Region " + llGetRegionName() + " is running "
                  + llGetEnv("sim_channel") + " version " + version );
       list ver = llParseString2List(version, ["."], []);
       llOwnerSay("Build: "+llList2String(ver, 3));
       llOwnerSay("Build Date: "+llList2String(ver, 2)+"-"+llList2String(ver, 1)+"-20"+llList2String(ver, 0));
   }

}

</lsl>

Notes

  • Region idling lowers a region's framerate when no avatars are currently on or looking into the region. Scripts measuring time dilation with llGetRegionTimeDilation may report significant time dilation if the region is idle.

See Also

Deep Notes

History

  • SVC-4874
  • Introduced in Second Life RC LeTigre 10.11.30.215699, deployed on 2010-12-01.
  • Deployed to rest of Agni with Second Life Server 10.11.30.215699, Second Life RC BlueSteel 10.12.06.216207, Second Life RC Magnum 10.11.30.215699
  • "frame_number" option added in Second Life RC BlueSteel 12.01.03.247042
    • Returns an integer that represents the current 'frame' of the simulator. Generally only useful for specific debugging cases.
  • Removed (temporarily?) in Second Life RC BlueSteel 12.01.06.247303

Signature

function string llGetEnv( string name );