diff options
author | UbitUmarov | 2018-11-28 08:20:38 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-28 08:20:38 +0000 |
commit | 47bc1fb25717c0203d1b7db4d14b8765d382a371 (patch) | |
tree | b6638cff5e4b412bc03aa6c3a1d5486985468453 | |
parent | YEngine no longer uses mono.tasklets (diff) | |
download | opensim-SC-47bc1fb25717c0203d1b7db4d14b8765d382a371.zip opensim-SC-47bc1fb25717c0203d1b7db4d14b8765d382a371.tar.gz opensim-SC-47bc1fb25717c0203d1b7db4d14b8765d382a371.tar.bz2 opensim-SC-47bc1fb25717c0203d1b7db4d14b8765d382a371.tar.xz |
OSSL remove functions with illegal lsl types, also redundante
Diffstat (limited to '')
6 files changed, 13 insertions, 114 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0e3c97f..07a8728 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1923,81 +1923,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1923 | return m_ScriptEngine.World.GetSimulatorVersion(); | 1923 | return m_ScriptEngine.World.GetSimulatorVersion(); |
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | private Hashtable osdToHashtable(OSDMap map) | ||
1927 | { | ||
1928 | Hashtable result = new Hashtable(); | ||
1929 | foreach (KeyValuePair<string, OSD> item in map) { | ||
1930 | result.Add(item.Key, osdToObject(item.Value)); | ||
1931 | } | ||
1932 | return result; | ||
1933 | } | ||
1934 | |||
1935 | private ArrayList osdToArray(OSDArray list) | ||
1936 | { | ||
1937 | ArrayList result = new ArrayList(); | ||
1938 | foreach ( OSD item in list ) { | ||
1939 | result.Add(osdToObject(item)); | ||
1940 | } | ||
1941 | return result; | ||
1942 | } | ||
1943 | |||
1944 | private Object osdToObject(OSD decoded) | ||
1945 | { | ||
1946 | if ( decoded is OSDString ) { | ||
1947 | return (string) decoded.AsString(); | ||
1948 | } else if ( decoded is OSDInteger ) { | ||
1949 | return (int) decoded.AsInteger(); | ||
1950 | } else if ( decoded is OSDReal ) { | ||
1951 | return (float) decoded.AsReal(); | ||
1952 | } else if ( decoded is OSDBoolean ) { | ||
1953 | return (bool) decoded.AsBoolean(); | ||
1954 | } else if ( decoded is OSDMap ) { | ||
1955 | return osdToHashtable((OSDMap) decoded); | ||
1956 | } else if ( decoded is OSDArray ) { | ||
1957 | return osdToArray((OSDArray) decoded); | ||
1958 | } else { | ||
1959 | return null; | ||
1960 | } | ||
1961 | } | ||
1962 | |||
1963 | public Object osParseJSONNew(string JSON) | ||
1964 | { | ||
1965 | CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); | ||
1966 | |||
1967 | try | ||
1968 | { | ||
1969 | OSD decoded = OSDParser.DeserializeJson(JSON); | ||
1970 | return osdToObject(decoded); | ||
1971 | } | ||
1972 | catch(Exception e) | ||
1973 | { | ||
1974 | OSSLError("osParseJSONNew: Problems decoding JSON string " + JSON + " : " + e.Message) ; | ||
1975 | return null; | ||
1976 | } | ||
1977 | } | ||
1978 | |||
1979 | public Hashtable osParseJSON(string JSON) | ||
1980 | { | ||
1981 | CheckThreatLevel(ThreatLevel.None, "osParseJSON"); | ||
1982 | |||
1983 | Object decoded = osParseJSONNew(JSON); | ||
1984 | |||
1985 | if ( decoded is Hashtable ) { | ||
1986 | return (Hashtable) decoded; | ||
1987 | } else if ( decoded is ArrayList ) { | ||
1988 | ArrayList decoded_list = (ArrayList) decoded; | ||
1989 | Hashtable fakearray = new Hashtable(); | ||
1990 | int i = 0; | ||
1991 | for ( i = 0; i < decoded_list.Count ; i++ ) { | ||
1992 | fakearray.Add(i, decoded_list[i]); | ||
1993 | } | ||
1994 | return fakearray; | ||
1995 | } else { | ||
1996 | OSSLError("osParseJSON: unable to parse JSON string " + JSON); | ||
1997 | return null; | ||
1998 | } | ||
1999 | } | ||
2000 | |||
2001 | /// <summary> | 1926 | /// <summary> |
2002 | /// Send a message to to object identified by the given UUID | 1927 | /// Send a message to to object identified by the given UUID |
2003 | /// </summary> | 1928 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index ebbfd2e..cfdc7d5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -269,8 +269,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
269 | LSL_Integer osCheckODE(); | 269 | LSL_Integer osCheckODE(); |
270 | string osGetPhysicsEngineType(); | 270 | string osGetPhysicsEngineType(); |
271 | string osGetPhysicsEngineName(); | 271 | string osGetPhysicsEngineName(); |
272 | Object osParseJSONNew(string JSON); | ||
273 | Hashtable osParseJSON(string JSON); | ||
274 | 272 | ||
275 | void osMessageObject(key objectUUID,string message); | 273 | void osMessageObject(key objectUUID,string message); |
276 | 274 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 0dbc6c6..15a57cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
35 | public partial class ScriptBaseClass | 35 | public partial class ScriptBaseClass |
36 | { | 36 | { |
37 | // SCRIPTS CONSTANTS | 37 | // SCRIPTS CONSTANTS |
38 | public static readonly LSLInteger OS_APIVERSION = 1; | 38 | public static readonly LSLInteger OS_APIVERSION = 2; |
39 | 39 | ||
40 | public static readonly LSLInteger TRUE = 1; | 40 | public static readonly LSLInteger TRUE = 1; |
41 | public static readonly LSLInteger FALSE = 0; | 41 | public static readonly LSLInteger FALSE = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index ed83894..a55dc77 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -476,16 +476,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
476 | return m_OSSL_Functions.osGetSimulatorVersion(); | 476 | return m_OSSL_Functions.osGetSimulatorVersion(); |
477 | } | 477 | } |
478 | 478 | ||
479 | public Hashtable osParseJSON(string JSON) | ||
480 | { | ||
481 | return m_OSSL_Functions.osParseJSON(JSON); | ||
482 | } | ||
483 | |||
484 | public Object osParseJSONNew(string JSON) | ||
485 | { | ||
486 | return m_OSSL_Functions.osParseJSONNew(JSON); | ||
487 | } | ||
488 | |||
489 | public void osMessageObject(key objectUUID,string message) | 479 | public void osMessageObject(key objectUUID,string message) |
490 | { | 480 | { |
491 | m_OSSL_Functions.osMessageObject(objectUUID,message); | 481 | m_OSSL_Functions.osMessageObject(objectUUID,message); |
diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 46f7712..5f5c421 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml | |||
@@ -1,4 +1,4 @@ | |||
1 | a56cd39c-7cce-5185-6e57-d5284505356d | 1 | 94172d61-5659-3578-82df-8eef2e48ef45 |
2 | <llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer> | 2 | <llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer> |
3 | <key>controls</key> | 3 | <key>controls</key> |
4 | <map> | 4 | <map> |
@@ -1513,7 +1513,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
1513 | </map> | 1513 | </map> |
1514 | <key>OS_APIVERSION</key><map> | 1514 | <key>OS_APIVERSION</key><map> |
1515 | <key>type</key><string>integer</string> | 1515 | <key>type</key><string>integer</string> |
1516 | <key>value</key><string>1</string> | 1516 | <key>value</key><string>2</string> |
1517 | </map> | 1517 | </map> |
1518 | <key>OS_ATTACH_MSG_ALL</key><map> | 1518 | <key>OS_ATTACH_MSG_ALL</key><map> |
1519 | <key>type</key><string>integer</string> | 1519 | <key>type</key><string>integer</string> |
@@ -6804,18 +6804,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
6804 | <map><key>pos2</key><map><key>type</key><string>vector</string></map></map> | 6804 | <map><key>pos2</key><map><key>type</key><string>vector</string></map></map> |
6805 | </array> | 6805 | </array> |
6806 | </map> | 6806 | </map> |
6807 | <key>osParseJSON</key> | ||
6808 | <map> | ||
6809 | <key>arguments</key><array> | ||
6810 | <map><key>JSON</key><map><key>type</key><string>string</string></map></map> | ||
6811 | </array> | ||
6812 | </map> | ||
6813 | <key>osParseJSONNew</key> | ||
6814 | <map> | ||
6815 | <key>arguments</key><array> | ||
6816 | <map><key>JSON</key><map><key>type</key><string>string</string></map></map> | ||
6817 | </array> | ||
6818 | </map> | ||
6819 | <key>osPlaySound</key> | 6807 | <key>osPlaySound</key> |
6820 | <map> | 6808 | <map> |
6821 | <key>arguments</key><array> | 6809 | <key>arguments</key><array> |
@@ -6865,7 +6853,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
6865 | <key>return</key><string>integer</string> | 6853 | <key>return</key><string>integer</string> |
6866 | <key>arguments</key><array> | 6854 | <key>arguments</key><array> |
6867 | <map><key>seconds</key><map><key>type</key><string>float</string></map></map> | 6855 | <map><key>seconds</key><map><key>type</key><string>float</string></map></map> |
6868 | <map><key>msg</key><map><key>type</key><string>string</string></map></map> | ||
6869 | </array> | 6856 | </array> |
6870 | </map> | 6857 | </map> |
6871 | <key>osRegionRestart</key> | 6858 | <key>osRegionRestart</key> |
@@ -6873,6 +6860,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
6873 | <key>return</key><string>integer</string> | 6860 | <key>return</key><string>integer</string> |
6874 | <key>arguments</key><array> | 6861 | <key>arguments</key><array> |
6875 | <map><key>seconds</key><map><key>type</key><string>float</string></map></map> | 6862 | <map><key>seconds</key><map><key>type</key><string>float</string></map></map> |
6863 | <map><key>msg</key><map><key>type</key><string>string</string></map></map> | ||
6876 | </array> | 6864 | </array> |
6877 | </map> | 6865 | </map> |
6878 | <key>osReplaceString</key> | 6866 | <key>osReplaceString</key> |
@@ -7208,8 +7196,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7208 | <key>arguments</key><array> | 7196 | <key>arguments</key><array> |
7209 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7197 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7210 | <map><key>value</key><map><key>type</key><string>string</string></map></map> | 7198 | <map><key>value</key><map><key>type</key><string>string</string></map></map> |
7211 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | ||
7212 | <map><key>count</key><map><key>type</key><string>integer</string></map></map> | ||
7213 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> | 7199 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> |
7214 | </array> | 7200 | </array> |
7215 | </map> | 7201 | </map> |
@@ -7219,6 +7205,8 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7219 | <key>arguments</key><array> | 7205 | <key>arguments</key><array> |
7220 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7206 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7221 | <map><key>value</key><map><key>type</key><string>string</string></map></map> | 7207 | <map><key>value</key><map><key>type</key><string>string</string></map></map> |
7208 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | ||
7209 | <map><key>count</key><map><key>type</key><string>integer</string></map></map> | ||
7222 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> | 7210 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> |
7223 | </array> | 7211 | </array> |
7224 | </map> | 7212 | </map> |
@@ -7228,8 +7216,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7228 | <key>arguments</key><array> | 7216 | <key>arguments</key><array> |
7229 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7217 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7230 | <map><key>value</key><map><key>type</key><string>string</string></map></map> | 7218 | <map><key>value</key><map><key>type</key><string>string</string></map></map> |
7231 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | ||
7232 | <map><key>count</key><map><key>type</key><string>integer</string></map></map> | ||
7233 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> | 7219 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> |
7234 | </array> | 7220 | </array> |
7235 | </map> | 7221 | </map> |
@@ -7239,6 +7225,8 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7239 | <key>arguments</key><array> | 7225 | <key>arguments</key><array> |
7240 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7226 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7241 | <map><key>value</key><map><key>type</key><string>string</string></map></map> | 7227 | <map><key>value</key><map><key>type</key><string>string</string></map></map> |
7228 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | ||
7229 | <map><key>count</key><map><key>type</key><string>integer</string></map></map> | ||
7242 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> | 7230 | <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map> |
7243 | </array> | 7231 | </array> |
7244 | </map> | 7232 | </map> |
@@ -7275,7 +7263,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7275 | <key>arguments</key><array> | 7263 | <key>arguments</key><array> |
7276 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7264 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7277 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | 7265 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> |
7278 | <map><key>length</key><map><key>type</key><string>integer</string></map></map> | ||
7279 | </array> | 7266 | </array> |
7280 | </map> | 7267 | </map> |
7281 | <key>osStringSubString</key> | 7268 | <key>osStringSubString</key> |
@@ -7284,6 +7271,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7284 | <key>arguments</key><array> | 7271 | <key>arguments</key><array> |
7285 | <map><key>src</key><map><key>type</key><string>string</string></map></map> | 7272 | <map><key>src</key><map><key>type</key><string>string</string></map></map> |
7286 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> | 7273 | <map><key>start</key><map><key>type</key><string>integer</string></map></map> |
7274 | <map><key>length</key><map><key>type</key><string>integer</string></map></map> | ||
7287 | </array> | 7275 | </array> |
7288 | </map> | 7276 | </map> |
7289 | <key>osSunGetParam</key> | 7277 | <key>osSunGetParam</key> |
@@ -7304,6 +7292,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7304 | <map> | 7292 | <map> |
7305 | <key>arguments</key><array> | 7293 | <key>arguments</key><array> |
7306 | <map><key>agent</key><map><key>type</key><string>string</string></map></map> | 7294 | <map><key>agent</key><map><key>type</key><string>string</string></map></map> |
7295 | <map><key>regionName</key><map><key>type</key><string>string</string></map></map> | ||
7307 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> | 7296 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> |
7308 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> | 7297 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> |
7309 | </array> | 7298 | </array> |
@@ -7312,7 +7301,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7312 | <map> | 7301 | <map> |
7313 | <key>arguments</key><array> | 7302 | <key>arguments</key><array> |
7314 | <map><key>agent</key><map><key>type</key><string>string</string></map></map> | 7303 | <map><key>agent</key><map><key>type</key><string>string</string></map></map> |
7315 | <map><key>regionName</key><map><key>type</key><string>string</string></map></map> | ||
7316 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> | 7304 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> |
7317 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> | 7305 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> |
7318 | </array> | 7306 | </array> |
@@ -7340,7 +7328,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7340 | <key>osTeleportOwner</key> | 7328 | <key>osTeleportOwner</key> |
7341 | <map> | 7329 | <map> |
7342 | <key>arguments</key><array> | 7330 | <key>arguments</key><array> |
7343 | <map><key>regionName</key><map><key>type</key><string>string</string></map></map> | ||
7344 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> | 7331 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> |
7345 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> | 7332 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> |
7346 | </array> | 7333 | </array> |
@@ -7348,8 +7335,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7348 | <key>osTeleportOwner</key> | 7335 | <key>osTeleportOwner</key> |
7349 | <map> | 7336 | <map> |
7350 | <key>arguments</key><array> | 7337 | <key>arguments</key><array> |
7351 | <map><key>regionX</key><map><key>type</key><string>integer</string></map></map> | 7338 | <map><key>regionName</key><map><key>type</key><string>string</string></map></map> |
7352 | <map><key>regionY</key><map><key>type</key><string>integer</string></map></map> | ||
7353 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> | 7339 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> |
7354 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> | 7340 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> |
7355 | </array> | 7341 | </array> |
@@ -7357,6 +7343,8 @@ a56cd39c-7cce-5185-6e57-d5284505356d | |||
7357 | <key>osTeleportOwner</key> | 7343 | <key>osTeleportOwner</key> |
7358 | <map> | 7344 | <map> |
7359 | <key>arguments</key><array> | 7345 | <key>arguments</key><array> |
7346 | <map><key>regionX</key><map><key>type</key><string>integer</string></map></map> | ||
7347 | <map><key>regionY</key><map><key>type</key><string>integer</string></map></map> | ||
7360 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> | 7348 | <map><key>position</key><map><key>type</key><string>vector</string></map></map> |
7361 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> | 7349 | <map><key>lookat</key><map><key>type</key><string>vector</string></map></map> |
7362 | </array> | 7350 | </array> |
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index fa33880..6b1bf73 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini | |||
@@ -80,8 +80,6 @@ | |||
80 | Allow_osGetNPCList = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | 80 | Allow_osGetNPCList = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER |
81 | Allow_osGetRezzingObject = true | 81 | Allow_osGetRezzingObject = true |
82 | Allow_osNpcGetOwner = ${OSSL|osslNPC} | 82 | Allow_osNpcGetOwner = ${OSSL|osslNPC} |
83 | Allow_osParseJSON = true | ||
84 | Allow_osParseJSONNew = true | ||
85 | Allow_osSetSunParam = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | 83 | Allow_osSetSunParam = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER |
86 | Allow_osTeleportOwner = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | 84 | Allow_osTeleportOwner = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER |
87 | Allow_osWindActiveModelPluginName = true | 85 | Allow_osWindActiveModelPluginName = true |