aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorUbitUmarov2018-11-28 08:20:38 +0000
committerUbitUmarov2018-11-28 08:20:38 +0000
commit47bc1fb25717c0203d1b7db4d14b8765d382a371 (patch)
treeb6638cff5e4b412bc03aa6c3a1d5486985468453 /OpenSim/Region/ScriptEngine
parentYEngine no longer uses mono.tasklets (diff)
downloadopensim-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 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs75
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs10
4 files changed, 1 insertions, 88 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);