Add llGetEnv to the partially computable functions.

Includes all known settings up to 16.12.03.322072 so far. It will be updated as new settings are added.
This commit is contained in:
Sei Lisa 2016-12-12 22:58:12 +01:00
parent b4a8b57184
commit ae984169ad
2 changed files with 19 additions and 2 deletions

View file

@ -19,13 +19,19 @@
from lslcommon import *
from lslbasefuncs import ELSLCantCompute, isinteger, iskey, islist, \
isvector, NULL_KEY, ZERO_VECTOR, ZERO_ROTATION
#isfloat, isstring, isrotation
isvector, isstring, NULL_KEY, ZERO_VECTOR, ZERO_ROTATION
#isfloat, isrotation
TouchEvents = ('touch', 'touch_start', 'touch_end')
DetectionEvents = ('touch', 'touch_start', 'touch_end',
'collision', 'collision_start', 'collision_end',
'sensor')
GetEnvSettings = ('agent_limit', 'dynamic_pathfinding', 'estate_id',
'estate_name', 'frame_number', 'region_cpu_ratio', 'region_idle',
'region_product_name', 'region_product_sku', 'region_start_time',
'sim_channel', 'sim_version', 'simulator_hostname',
'region_max_prims', # <http://wiki.secondlife.com/wiki/Release_Notes/Second_Life_RC_Magnum/16#16.11.02.321369>
'region_object_bonus') # <http://wiki.secondlife.com/wiki/Release_Notes/Second_Life_RC_Magnum/16#16.12.03.322072>
def llCloud(v):
assert isvector(v)
@ -201,4 +207,10 @@ def llGetDisplayName(id):
return u''
raise ELSLCantCompute
def llGetEnv(s):
assert isstring(s)
if s not in GetEnvSettings:
return u""
raise ELSLCantCompute
# TODO: Add more predictable functions.

View file

@ -1298,7 +1298,12 @@ def do_tests():
test('llListInsertList([], [1], -1)', [1])
test('llListInsertList([1,2,3,4,5],[9],-3)', [1,2,9,3,4,5])
test('llGetEnv(u"")', u'')
test('llGetEnv(u"yadda")', u'')
shouldexcept('llGetEnv(u"agent_limit")', ELSLCantCompute)
# JSON tests - Here be dragons.
print("9 errors expected past here -------------------------------------------------")
test('''llEscapeURL(llList2Json(JSON_OBJECT, [llUnescapeURL(
u"%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F"
u"%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F"