Anonymous | Login | Signup for a new account | 2021-01-15 22:09 PST | ![]() |
Main | My View | View Issues | Change Log | Roadmap | Summary | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0007984 | opensim | [REGION] Script Functions | public | 2016-08-03 08:12 | 2017-05-21 08:46 | |||||
Reporter | BlueWall | |||||||||
Assigned To | BlueWall | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||
Status | patch included | Resolution | open | |||||||
Platform | Operating System | Operating System Version | ||||||||
Product Version | master (dev code) | |||||||||
Target Version | 0.8.1-rc2 | Fixed in Version | ||||||||
Summary | 0007984: llList2Json | |||||||||
Description | The llList2Json function inserts delimiters ahead of quotations when inserting a json object or array in a list being prepared to create json objects with nested data. (see included script) Comparison of output OpenSim: Json test with list_LSLConstantList: [22,19,5] [07:43] Constant Test: Json test with list_LSLIntegerList: [22,19,5] [07:43] Constant Test: Json test with list_LSLStringList: ["a","b","c"] [07:43] Constant Test: Json test with list_LSLStringList: {"lsl_constant":"[22,19,5]","lsl_integer":"[22,19,5]","lsl_string":"[\"a\",\"b\",\"c\"]","lsl_constant_directory":"{\"CAMERA_FOCUS_LOCKED\":22,\"VEHICLE_ANGULAR_MOTOR_DIRECTION\":19,\"INVENTORY_CLOTHING\":5,\"TEXTURE_BLANK\":\"5748decc-f629-461c-9a36-a35a221fe21f\",\"PI\":3.14159274101257}"} SecondLife: "lsl_constant":[22,19,5],"lsl_integer":[22,19,5],"lsl_string":["a","b","c"],"lsl_constant_directory":{"CAMERA_FOCUS_LOCKED":22,"VEHICLE_ANGULAR_MOTOR_DIRECTION":19,"INVENTORY_CLOTHING":5,"TEXTURE_BLANK":"5748decc-f629-461c-9a36-a35a221fe21f","PI":3.141593}} | |||||||||
Steps To Reproduce | default { state_entry() { llSay(0, "Script running"); } touch_start(integer det) { list list_LSLConstantList = [ CAMERA_FOCUS_LOCKED, // 22 VEHICLE_ANGULAR_MOTOR_DIRECTION, // 19 INVENTORY_CLOTHING // 5 ]; list list_LSLIntegerList = [ 22, 19, 5 ]; list list_LSLStringList = [ "a", "b", "c" ]; string sJsonArray; string sJsonObject; sJsonArray = llList2Json(JSON_ARRAY, list_LSLConstantList); llOwnerSay("Json test with list_LSLConstantList: "+sJsonArray); sJsonArray = llList2Json(JSON_ARRAY, list_LSLIntegerList); llOwnerSay("Json test with list_LSLIntegerList: "+sJsonArray); sJsonArray = llList2Json(JSON_ARRAY, list_LSLStringList); llOwnerSay("Json test with list_LSLStringList: "+sJsonArray); list list_LSLConstantDirectory = [ "CAMERA_FOCUS_LOCKED", CAMERA_FOCUS_LOCKED, "VEHICLE_ANGULAR_MOTOR_DIRECTION", VEHICLE_ANGULAR_MOTOR_DIRECTION, "INVENTORY_CLOTHING", INVENTORY_CLOTHING, "TEXTURE_BLANK", TEXTURE_BLANK, "PI", PI ]; list list_JsonObjectList = [ "lsl_constant", llList2Json(JSON_ARRAY, list_LSLConstantList), "lsl_integer", llList2Json(JSON_ARRAY, list_LSLIntegerList), "lsl_string", llList2Json(JSON_ARRAY, list_LSLStringList), "lsl_constant_directory", llList2Json(JSON_OBJECT, list_LSLConstantDirectory) ]; sJsonArray = llList2Json(JSON_OBJECT, list_JsonObjectList); llOwnerSay("Json test with list_LSLStringList: "+sJsonArray); } } | |||||||||
Tags | No tags attached. | |||||||||
Git Revision or version number | ||||||||||
Run Mode | Grid (Multiple Regions per Sim) | |||||||||
Physics Engine | BasicPhysics | |||||||||
Script Engine | ||||||||||
Environment | Mono / Linux64 | |||||||||
Mono Version | Other | |||||||||
Viewer | Alchemy/Firestorm | |||||||||
Attached Files | ![]() | |||||||||
![]() |
|
(0030977) BlueWall (administrator) 2016-08-03 08:16 |
See attached |
(0031891) UbitUmarov (administrator) 2017-05-21 08:29 |
script above on current master 08:25] mantis7984: Json test with list_LSLConstantList: [22,19,5] [08:25] mantis7984: Json test with list_LSLIntegerList: [22,19,5] [08:25] mantis7984: Json test with list_LSLStringList: ["a","b","c"] [08:25] mantis7984: Json test with list_LSLStringList: {"lsl_constant":[22,19,5],"lsl_integer":[22,19,5],"lsl_string":["a","b","c"],"lsl_constant_directory":{"CAMERA_FOCUS_LOCKED":22,"VEHICLE_ANGULAR_MOTOR_DIRECTION":19,"INVENTORY_CLOTHING":5,"TEXTURE_BLANK":"5748decc-f629-461c-9a36-a35a221fe21f","PI":3.141593} |
(0031892) UbitUmarov (administrator) 2017-05-21 08:35 |
sorry not using the patch bc it no longer applies and the issues where a lot more than just this |
(0031893) UbitUmarov (administrator) 2017-05-21 08:46 |
Cases I know that not encode as SL; - char '/' is not escaped (as "\/"), seems that now is optional and lib LitJSON we use does not do it, and SL does. - json = llJsonSetValue("[]",[JSON_APPEND], "\"test\""); returns ["\"test\""] and not ["test"] |
![]() |
|||
Date Modified | Username | Field | Change |
2016-08-03 08:12 | BlueWall | New Issue | |
2016-08-03 08:12 | BlueWall | Status | new => assigned |
2016-08-03 08:12 | BlueWall | Assigned To | => BlueWall |
2016-08-03 08:15 | BlueWall | File Added: 0001-Add-test-for-json-object-when-processing-strings-in-.patch | |
2016-08-03 08:16 | BlueWall | Note Added: 0030977 | |
2016-08-03 08:16 | BlueWall | Status | assigned => patch included |
2017-05-21 06:10 | BlueWall | Relationship added | related to 0008172 |
2017-05-21 08:29 | UbitUmarov | Note Added: 0031891 | |
2017-05-21 08:35 | UbitUmarov | Note Added: 0031892 | |
2017-05-21 08:46 | UbitUmarov | Note Added: 0031893 |
Copyright © 2000 - 2012 MantisBT Group |