OSSL remove functions with illegal lsl types, also redundante

0.9.1.0-post-fixes
UbitUmarov 2018-11-28 08:20:38 +00:00
parent a99055160b
commit 47bc1fb257
6 changed files with 24 additions and 125 deletions

View File

@ -1923,81 +1923,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return m_ScriptEngine.World.GetSimulatorVersion();
}
private Hashtable osdToHashtable(OSDMap map)
{
Hashtable result = new Hashtable();
foreach (KeyValuePair<string, OSD> item in map) {
result.Add(item.Key, osdToObject(item.Value));
}
return result;
}
private ArrayList osdToArray(OSDArray list)
{
ArrayList result = new ArrayList();
foreach ( OSD item in list ) {
result.Add(osdToObject(item));
}
return result;
}
private Object osdToObject(OSD decoded)
{
if ( decoded is OSDString ) {
return (string) decoded.AsString();
} else if ( decoded is OSDInteger ) {
return (int) decoded.AsInteger();
} else if ( decoded is OSDReal ) {
return (float) decoded.AsReal();
} else if ( decoded is OSDBoolean ) {
return (bool) decoded.AsBoolean();
} else if ( decoded is OSDMap ) {
return osdToHashtable((OSDMap) decoded);
} else if ( decoded is OSDArray ) {
return osdToArray((OSDArray) decoded);
} else {
return null;
}
}
public Object osParseJSONNew(string JSON)
{
CheckThreatLevel(ThreatLevel.None, "osParseJSONNew");
try
{
OSD decoded = OSDParser.DeserializeJson(JSON);
return osdToObject(decoded);
}
catch(Exception e)
{
OSSLError("osParseJSONNew: Problems decoding JSON string " + JSON + " : " + e.Message) ;
return null;
}
}
public Hashtable osParseJSON(string JSON)
{
CheckThreatLevel(ThreatLevel.None, "osParseJSON");
Object decoded = osParseJSONNew(JSON);
if ( decoded is Hashtable ) {
return (Hashtable) decoded;
} else if ( decoded is ArrayList ) {
ArrayList decoded_list = (ArrayList) decoded;
Hashtable fakearray = new Hashtable();
int i = 0;
for ( i = 0; i < decoded_list.Count ; i++ ) {
fakearray.Add(i, decoded_list[i]);
}
return fakearray;
} else {
OSSLError("osParseJSON: unable to parse JSON string " + JSON);
return null;
}
}
/// <summary>
/// Send a message to to object identified by the given UUID
/// </summary>

View File

@ -269,8 +269,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer osCheckODE();
string osGetPhysicsEngineType();
string osGetPhysicsEngineName();
Object osParseJSONNew(string JSON);
Hashtable osParseJSON(string JSON);
void osMessageObject(key objectUUID,string message);

View File

@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public partial class ScriptBaseClass
{
// SCRIPTS CONSTANTS
public static readonly LSLInteger OS_APIVERSION = 1;
public static readonly LSLInteger OS_APIVERSION = 2;
public static readonly LSLInteger TRUE = 1;
public static readonly LSLInteger FALSE = 0;

View File

@ -476,16 +476,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetSimulatorVersion();
}
public Hashtable osParseJSON(string JSON)
{
return m_OSSL_Functions.osParseJSON(JSON);
}
public Object osParseJSONNew(string JSON)
{
return m_OSSL_Functions.osParseJSONNew(JSON);
}
public void osMessageObject(key objectUUID,string message)
{
m_OSSL_Functions.osMessageObject(objectUUID,message);

View File

@ -1,4 +1,4 @@
a56cd39c-7cce-5185-6e57-d5284505356d
94172d61-5659-3578-82df-8eef2e48ef45
<llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer>
<key>controls</key>
<map>
@ -1513,7 +1513,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
</map>
<key>OS_APIVERSION</key><map>
<key>type</key><string>integer</string>
<key>value</key><string>1</string>
<key>value</key><string>2</string>
</map>
<key>OS_ATTACH_MSG_ALL</key><map>
<key>type</key><string>integer</string>
@ -6804,18 +6804,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map><key>pos2</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osParseJSON</key>
<map>
<key>arguments</key><array>
<map><key>JSON</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osParseJSONNew</key>
<map>
<key>arguments</key><array>
<map><key>JSON</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osPlaySound</key>
<map>
<key>arguments</key><array>
@ -6865,7 +6853,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>seconds</key><map><key>type</key><string>float</string></map></map>
<map><key>msg</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osRegionRestart</key>
@ -6873,6 +6860,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>seconds</key><map><key>type</key><string>float</string></map></map>
<map><key>msg</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osReplaceString</key>
@ -7208,21 +7196,10 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>value</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>count</key><map><key>type</key><string>integer</string></map></map>
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osStringIndexOf</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>value</key><map><key>type</key><string>string</string></map></map>
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osStringLastIndexOf</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
@ -7242,6 +7219,17 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osStringLastIndexOf</key>
<map>
<key>return</key><string>integer</string>
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>value</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>count</key><map><key>type</key><string>integer</string></map></map>
<map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osStringRemove</key>
<map>
<key>return</key><string>string</string>
@ -7275,7 +7263,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>length</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osStringSubString</key>
@ -7284,6 +7271,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map>
<map><key>start</key><map><key>type</key><string>integer</string></map></map>
<map><key>length</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osSunGetParam</key>
@ -7304,6 +7292,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map>
<key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
@ -7312,7 +7301,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map>
<key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
@ -7338,6 +7326,13 @@ a56cd39c-7cce-5185-6e57-d5284505356d
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map>
@ -7354,13 +7349,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTeleportOwner</key>
<map>
<key>arguments</key><array>
<map><key>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array>
</map>
<key>osTerrainFlush</key>
<map>
<key>arguments</key><undef/>

View File

@ -80,8 +80,6 @@
Allow_osGetNPCList = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRezzingObject = true
Allow_osNpcGetOwner = ${OSSL|osslNPC}
Allow_osParseJSON = true
Allow_osParseJSONNew = true
Allow_osSetSunParam = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportOwner = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osWindActiveModelPluginName = true