diff options
author | Charles Krinke | 2007-12-18 02:41:34 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-18 02:41:34 +0000 |
commit | 6f389ba4cf54d7e964b98430f7a6601d3ec0c73b (patch) | |
tree | 2c092e7bea58052485854d3a3c9e548c790abb5b /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL | |
parent | * Fixed a potential race condition with adding Caps handlers (diff) | |
download | opensim-SC-6f389ba4cf54d7e964b98430f7a6601d3ec0c73b.zip opensim-SC-6f389ba4cf54d7e964b98430f7a6601d3ec0c73b.tar.gz opensim-SC-6f389ba4cf54d7e964b98430f7a6601d3ec0c73b.tar.bz2 opensim-SC-6f389ba4cf54d7e964b98430f7a6601d3ec0c73b.tar.xz |
Many Thanks to Alondria for adding:
The list type and a bunch of support functions to LSL
Added/ReImplmented: llGetListLength(), llList2Integer(), osList2Double() (note rename),
llList2Float(), llList2String(), llList2Key(), llList2Vector(), llList2Rot(),
llList2List(), llDeleteSubList(), llGetListEntryType(), llList2CSV(), llCSV2List(),
llListInsertList(), llDumpList2String(),
Borked Still: llListSort(), llListRandomize(), llList2ListStrided(), llListFindList(),
Changed: llHTTPRequest() (Made wrapper of LSL_Types.list->List<string>)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 64 |
2 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 00ddbba..4063647 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
47 | dataTypes.Add("key", "string"); | 47 | dataTypes.Add("key", "string"); |
48 | dataTypes.Add("vector", "LSL_Types.Vector3"); | 48 | dataTypes.Add("vector", "LSL_Types.Vector3"); |
49 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); | 49 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); |
50 | dataTypes.Add("list", "List<string>"); | 50 | dataTypes.Add("list", "LSL_Types.list"); |
51 | dataTypes.Add("null", "null"); | 51 | dataTypes.Add("null", "null"); |
52 | } | 52 | } |
53 | 53 | ||
@@ -259,7 +259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
259 | 259 | ||
260 | // Replace List []'s | 260 | // Replace List []'s |
261 | Script = | 261 | Script = |
262 | Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", | 262 | Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)", |
263 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 263 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
264 | 264 | ||
265 | 265 | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index d669c15..1657b74 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -1061,12 +1061,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1061 | return m_LSL_Functions.llGetCenterOfMass(); | 1061 | return m_LSL_Functions.llGetCenterOfMass(); |
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | public List<string> llListSort(List<string> src, int stride, int ascending) | 1064 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) |
1065 | { | 1065 | { |
1066 | return m_LSL_Functions.llListSort(src, stride, ascending); | 1066 | return m_LSL_Functions.llListSort(src, stride, ascending); |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | public int llGetListLength(List<string> src) | 1069 | public int llGetListLength(LSL_Types.list src) |
1070 | { | 1070 | { |
1071 | return m_LSL_Functions.llGetListLength(src); | 1071 | return m_LSL_Functions.llGetListLength(src); |
1072 | } | 1072 | } |
@@ -1074,67 +1074,67 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1074 | // | 1074 | // |
1075 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 1075 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
1076 | // | 1076 | // |
1077 | public int llList2Integer(List<string> src, int index) | 1077 | public int llList2Integer(LSL_Types.list src, int index) |
1078 | { | 1078 | { |
1079 | return m_LSL_Functions.llList2Integer(src, index); | 1079 | return m_LSL_Functions.llList2Integer(src, index); |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | public double llList2double(List<string> src, int index) | 1082 | public double osList2Double(LSL_Types.list src, int index) |
1083 | { | 1083 | { |
1084 | return m_LSL_Functions.llList2double(src, index); | 1084 | return m_LSL_Functions.osList2Double(src, index); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | public string llList2String(List<string> src, int index) | 1087 | public string llList2String(LSL_Types.list src, int index) |
1088 | { | 1088 | { |
1089 | return m_LSL_Functions.llList2String(src, index); | 1089 | return m_LSL_Functions.llList2String(src, index); |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | public string llList2Key(List<string> src, int index) | 1092 | public string llList2Key(LSL_Types.list src, int index) |
1093 | { | 1093 | { |
1094 | return m_LSL_Functions.llList2Key(src, index); | 1094 | return m_LSL_Functions.llList2Key(src, index); |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | public vector llList2Vector(List<string> src, int index) | 1097 | public vector llList2Vector(LSL_Types.list src, int index) |
1098 | { | 1098 | { |
1099 | return m_LSL_Functions.llList2Vector(src, index); | 1099 | return m_LSL_Functions.llList2Vector(src, index); |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | public rotation llList2Rot(List<string> src, int index) | 1102 | public rotation llList2Rot(LSL_Types.list src, int index) |
1103 | { | 1103 | { |
1104 | return m_LSL_Functions.llList2Rot(src, index); | 1104 | return m_LSL_Functions.llList2Rot(src, index); |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | public List<string> llList2List(List<string> src, int start, int end) | 1107 | public LSL_Types.list llList2List(LSL_Types.list src, int start, int end) |
1108 | { | 1108 | { |
1109 | return m_LSL_Functions.llList2List(src, start, end); | 1109 | return m_LSL_Functions.llList2List(src, start, end); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | public List<string> llDeleteSubList(List<string> src, int start, int end) | 1112 | public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end) |
1113 | { | 1113 | { |
1114 | return m_LSL_Functions.llDeleteSubList(src, start, end); | 1114 | return m_LSL_Functions.llDeleteSubList(src, start, end); |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | public int llGetListEntryType(List<string> src, int index) | 1117 | public int llGetListEntryType(LSL_Types.list src, int index) |
1118 | { | 1118 | { |
1119 | return m_LSL_Functions.llGetListEntryType(src, index); | 1119 | return m_LSL_Functions.llGetListEntryType(src, index); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | public string llList2CSV(List<string> src) | 1122 | public string llList2CSV(LSL_Types.list src) |
1123 | { | 1123 | { |
1124 | return m_LSL_Functions.llList2CSV(src); | 1124 | return m_LSL_Functions.llList2CSV(src); |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | public List<string> llCSV2List(string src) | 1127 | public LSL_Types.list llCSV2List(string src) |
1128 | { | 1128 | { |
1129 | return m_LSL_Functions.llCSV2List(src); | 1129 | return m_LSL_Functions.llCSV2List(src); |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | public List<string> llListRandomize(List<string> src, int stride) | 1132 | public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) |
1133 | { | 1133 | { |
1134 | return m_LSL_Functions.llListRandomize(src, stride); | 1134 | return m_LSL_Functions.llListRandomize(src, stride); |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) | 1137 | public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) |
1138 | { | 1138 | { |
1139 | return m_LSL_Functions.llList2ListStrided(src, start, end, stride); | 1139 | return m_LSL_Functions.llList2ListStrided(src, start, end, stride); |
1140 | } | 1140 | } |
@@ -1144,12 +1144,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1144 | return m_LSL_Functions.llGetRegionCorner(); | 1144 | return m_LSL_Functions.llGetRegionCorner(); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | public List<string> llListInsertList(List<string> dest, List<string> src, int start) | 1147 | public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) |
1148 | { | 1148 | { |
1149 | return m_LSL_Functions.llListInsertList(dest, src, start); | 1149 | return m_LSL_Functions.llListInsertList(dest, src, start); |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | public int llListFindList(List<string> src, List<string> test) | 1152 | public int llListFindList(LSL_Types.list src, LSL_Types.list test) |
1153 | { | 1153 | { |
1154 | return m_LSL_Functions.llListFindList(src, test); | 1154 | return m_LSL_Functions.llListFindList(src, test); |
1155 | } | 1155 | } |
@@ -1375,9 +1375,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1375 | m_LSL_Functions.llSetCameraAtOffset(offset); | 1375 | m_LSL_Functions.llSetCameraAtOffset(offset); |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | public void llDumpList2String() | 1378 | public string llDumpList2String(LSL_Types.list src, string seperator) |
1379 | { | 1379 | { |
1380 | m_LSL_Functions.llDumpList2String(); | 1380 | return m_LSL_Functions.llDumpList2String(src, seperator); |
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | public void llScriptDanger(vector pos) | 1383 | public void llScriptDanger(vector pos) |
@@ -1385,7 +1385,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1385 | m_LSL_Functions.llScriptDanger(pos); | 1385 | m_LSL_Functions.llScriptDanger(pos); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) | 1388 | public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) |
1389 | { | 1389 | { |
1390 | m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); | 1390 | m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); |
1391 | } | 1391 | } |
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1448 | return m_LSL_Functions.llMD5String(src, nonce); | 1448 | return m_LSL_Functions.llMD5String(src, nonce); |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | public void llSetPrimitiveParams(List<string> rules) | 1451 | public void llSetPrimitiveParams(LSL_Types.list rules) |
1452 | { | 1452 | { |
1453 | m_LSL_Functions.llSetPrimitiveParams(rules); | 1453 | m_LSL_Functions.llSetPrimitiveParams(rules); |
1454 | } | 1454 | } |
@@ -1483,7 +1483,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1483 | return m_LSL_Functions.llLog(val); | 1483 | return m_LSL_Functions.llLog(val); |
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | public List<string> llGetAnimationList(string id) | 1486 | public LSL_Types.list llGetAnimationList(string id) |
1487 | { | 1487 | { |
1488 | return m_LSL_Functions.llGetAnimationList(id); | 1488 | return m_LSL_Functions.llGetAnimationList(id); |
1489 | } | 1489 | } |
@@ -1538,7 +1538,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1538 | return m_LSL_Functions.llGetNumberOfNotecardLines(name); | 1538 | return m_LSL_Functions.llGetNumberOfNotecardLines(name); |
1539 | } | 1539 | } |
1540 | 1540 | ||
1541 | public List<string> llGetBoundingBox(string obj) | 1541 | public LSL_Types.list llGetBoundingBox(string obj) |
1542 | { | 1542 | { |
1543 | return m_LSL_Functions.llGetBoundingBox(obj); | 1543 | return m_LSL_Functions.llGetBoundingBox(obj); |
1544 | } | 1544 | } |
@@ -1581,7 +1581,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1581 | m_LSL_Functions.llSetLocalRot(rot); | 1581 | m_LSL_Functions.llSetLocalRot(rot); |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers) | 1584 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) |
1585 | { | 1585 | { |
1586 | return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); | 1586 | return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); |
1587 | } | 1587 | } |
@@ -1646,7 +1646,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1646 | m_LSL_Functions.llLoadURL(avatar_id, message, url); | 1646 | m_LSL_Functions.llLoadURL(avatar_id, message, url); |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | public void llParcelMediaCommandList(List<string> commandList) | 1649 | public void llParcelMediaCommandList(LSL_Types.list commandList) |
1650 | { | 1650 | { |
1651 | m_LSL_Functions.llParcelMediaCommandList(commandList); | 1651 | m_LSL_Functions.llParcelMediaCommandList(commandList); |
1652 | } | 1652 | } |
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1669 | return m_LSL_Functions.llGetInventoryType(name); | 1669 | return m_LSL_Functions.llGetInventoryType(name); |
1670 | } | 1670 | } |
1671 | 1671 | ||
1672 | public void llSetPayPrice(int price, List<string> quick_pay_buttons) | 1672 | public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons) |
1673 | { | 1673 | { |
1674 | m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); | 1674 | m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); |
1675 | } | 1675 | } |
@@ -1724,7 +1724,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1724 | m_LSL_Functions.llRemoveFromLandBanList(avatar); | 1724 | m_LSL_Functions.llRemoveFromLandBanList(avatar); |
1725 | } | 1725 | } |
1726 | 1726 | ||
1727 | public void llSetCameraParams(List<string> rules) | 1727 | public void llSetCameraParams(LSL_Types.list rules) |
1728 | { | 1728 | { |
1729 | m_LSL_Functions.llSetCameraParams(rules); | 1729 | m_LSL_Functions.llSetCameraParams(rules); |
1730 | } | 1730 | } |
@@ -1734,7 +1734,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1734 | m_LSL_Functions.llClearCameraParams(); | 1734 | m_LSL_Functions.llClearCameraParams(); |
1735 | } | 1735 | } |
1736 | 1736 | ||
1737 | public double llListStatistics(int operation, List<string> src) | 1737 | public double llListStatistics(int operation, LSL_Types.list src) |
1738 | { | 1738 | { |
1739 | return m_LSL_Functions.llListStatistics(operation, src); | 1739 | return m_LSL_Functions.llListStatistics(operation, src); |
1740 | } | 1740 | } |
@@ -1759,7 +1759,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1759 | return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); | 1759 | return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); |
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | public string llHTTPRequest(string url, List<string> parameters, string body) | 1762 | public string llHTTPRequest(string url, LSL_Types.list parameters, string body) |
1763 | { | 1763 | { |
1764 | return m_LSL_Functions.llHTTPRequest(url, parameters, body); | 1764 | return m_LSL_Functions.llHTTPRequest(url, parameters, body); |
1765 | } | 1765 | } |
@@ -1779,7 +1779,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1779 | return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); | 1779 | return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | public List<string> llGetParcelPrimOwners(vector pos) | 1782 | public LSL_Types.list llGetParcelPrimOwners(vector pos) |
1783 | { | 1783 | { |
1784 | return m_LSL_Functions.llGetParcelPrimOwners(pos); | 1784 | return m_LSL_Functions.llGetParcelPrimOwners(pos); |
1785 | } | 1785 | } |
@@ -1797,7 +1797,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1797 | return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); | 1797 | return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); |
1798 | } | 1798 | } |
1799 | 1799 | ||
1800 | public List<string> llGetParcelDetails(vector pos, List<string> param) | 1800 | public LSL_Types.list llGetParcelDetails(vector pos, LSL_Types.list param) |
1801 | { | 1801 | { |
1802 | return m_LSL_Functions.llGetParcelDetails(pos, param); | 1802 | return m_LSL_Functions.llGetParcelDetails(pos, param); |
1803 | } | 1803 | } |