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(); 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> /// <summary>
/// Send a message to to object identified by the given UUID /// Send a message to to object identified by the given UUID
/// </summary> /// </summary>

View File

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

View File

@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public partial class ScriptBaseClass public partial class ScriptBaseClass
{ {
// SCRIPTS CONSTANTS // 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 TRUE = 1;
public static readonly LSLInteger FALSE = 0; public static readonly LSLInteger FALSE = 0;

View File

@ -476,16 +476,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetSimulatorVersion(); 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) public void osMessageObject(key objectUUID,string message)
{ {
m_OSSL_Functions.osMessageObject(objectUUID,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> <llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer>
<key>controls</key> <key>controls</key>
<map> <map>
@ -1513,7 +1513,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
</map> </map>
<key>OS_APIVERSION</key><map> <key>OS_APIVERSION</key><map>
<key>type</key><string>integer</string> <key>type</key><string>integer</string>
<key>value</key><string>1</string> <key>value</key><string>2</string>
</map> </map>
<key>OS_ATTACH_MSG_ALL</key><map> <key>OS_ATTACH_MSG_ALL</key><map>
<key>type</key><string>integer</string> <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> <map><key>pos2</key><map><key>type</key><string>vector</string></map></map>
</array> </array>
</map> </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> <key>osPlaySound</key>
<map> <map>
<key>arguments</key><array> <key>arguments</key><array>
@ -6865,7 +6853,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>return</key><string>integer</string> <key>return</key><string>integer</string>
<key>arguments</key><array> <key>arguments</key><array>
<map><key>seconds</key><map><key>type</key><string>float</string></map></map> <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> </array>
</map> </map>
<key>osRegionRestart</key> <key>osRegionRestart</key>
@ -6873,6 +6860,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>return</key><string>integer</string> <key>return</key><string>integer</string>
<key>arguments</key><array> <key>arguments</key><array>
<map><key>seconds</key><map><key>type</key><string>float</string></map></map> <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> </array>
</map> </map>
<key>osReplaceString</key> <key>osReplaceString</key>
@ -7208,21 +7196,10 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array> <key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map> <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>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> <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array> </array>
</map> </map>
<key>osStringIndexOf</key> <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> <map>
<key>return</key><string>integer</string> <key>return</key><string>integer</string>
<key>arguments</key><array> <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> <map><key>ignorecase</key><map><key>type</key><string>integer</string></map></map>
</array> </array>
</map> </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> <key>osStringRemove</key>
<map> <map>
<key>return</key><string>string</string> <key>return</key><string>string</string>
@ -7275,7 +7263,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array> <key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map> <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>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> </array>
</map> </map>
<key>osStringSubString</key> <key>osStringSubString</key>
@ -7284,6 +7271,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<key>arguments</key><array> <key>arguments</key><array>
<map><key>src</key><map><key>type</key><string>string</string></map></map> <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>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> </array>
</map> </map>
<key>osSunGetParam</key> <key>osSunGetParam</key>
@ -7304,6 +7292,7 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map> <map>
<key>arguments</key><array> <key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map> <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>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map> <map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array> </array>
@ -7312,7 +7301,6 @@ a56cd39c-7cce-5185-6e57-d5284505356d
<map> <map>
<key>arguments</key><array> <key>arguments</key><array>
<map><key>agent</key><map><key>type</key><string>string</string></map></map> <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>position</key><map><key>type</key><string>vector</string></map></map>
<map><key>lookat</key><map><key>type</key><string>vector</string></map></map> <map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array> </array>
@ -7338,6 +7326,13 @@ a56cd39c-7cce-5185-6e57-d5284505356d
</array> </array>
</map> </map>
<key>osTeleportOwner</key> <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> <map>
<key>arguments</key><array> <key>arguments</key><array>
<map><key>regionName</key><map><key>type</key><string>string</string></map></map> <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> <map><key>lookat</key><map><key>type</key><string>vector</string></map></map>
</array> </array>
</map> </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> <key>osTerrainFlush</key>
<map> <map>
<key>arguments</key><undef/> <key>arguments</key><undef/>

View File

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