From 6ce364892b899469ecac48c76838747106a84c93 Mon Sep 17 00:00:00 2001 From: Christopher Latza Date: Wed, 10 Jun 2020 01:54:17 +0200 Subject: [PATCH] add os commands to patchfind --- .../Shared/Api/Implementation/OSSL_Api.cs | 54 +++ .../Shared/Api/Interface/IOSSL_Api.cs | 4 + .../Shared/Api/Runtime/OSSL_Stub.cs | 10 + bin/inventory/4Creative/4CreativeFolders.xml | 50 ++ bin/inventory/4Creative/4CreativeItems.xml | 436 ++++++++++++++++++ 5 files changed, 554 insertions(+) create mode 100644 bin/inventory/4Creative/4CreativeFolders.xml create mode 100644 bin/inventory/4Creative/4CreativeItems.xml diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5e6271c8a7..008640fe31 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -42,6 +42,7 @@ using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Drawing; using System.Reflection; using System.Runtime.Remoting.Lifetime; using System.Text; @@ -756,6 +757,59 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api dm.SendAlertToUser(sp.ControllingClient, msg + "\n", false); } + + private bool checkIsPositionBlockedByObjekts(LSL_Vector _source) + { + List _objects = World.GetSceneObjectGroups().FindAll(X => X.IsPhantom != true && (int)X.AbsolutePosition.X == (int)_source.x && (int)X.AbsolutePosition.Y == (int)_source.y && (int)X.AbsolutePosition.Z <= (m_host.AbsolutePosition.Z + 30)); + + if (_objects.Count != 0) + return true; + + return false; + } + + public LSL_List osGetPathfindingPath(LSL_Vector _source, LSL_Vector _target) + { + LSL_List _returnList = new LSL_List(); + Bitmap _map = new Bitmap((int)World.RegionInfo.RegionSizeX, (int)World.RegionInfo.RegionSizeY); + + for (int X = 0; X <= World.RegionInfo.RegionSizeX; X++) + { + for (int Y = 0; Y <= World.RegionInfo.RegionSizeY; Y++) + { + float baseheight = (float)World.Heightmap[X, Y]; + + if (baseheight <= World.RegionInfo.RegionSettings.WaterHeight) + _map.SetPixel(X, Y, Color.Red); + + if (checkIsPositionBlockedByObjekts(new LSL_Vector(X, Y, 0)) == true) + _map.SetPixel(X, Y, Color.Yellow); + } + } + + _map.Save("debug.png"); + return _returnList; + } + + public LSL_List osGetObjectIDListByName(LSL_List _nameList) + { + LSL_List _returnList = new LSL_List(); + + foreach (object o in _nameList.Data) + { + if (o.ToString().Length != 0) + { + foreach (SceneObjectGroup _objectGroup in World.GetSceneObjectGroups()) + { + if (_objectGroup.Name.Equals(o.ToString())) + _returnList.Add(_objectGroup.GroupID); + } + } + } + + return _returnList; + } + public void osSetRot(UUID target, Quaternion rotation) { // if enabled It can be used to destroy diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 9b4a9ca12d..a8d205fcfb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -134,6 +134,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float osTerrainGetHeight(int x, int y); // Deprecated LSL_Integer osSetTerrainHeight(int x, int y, double val); LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated + + LSL_List osGetPathfindingPath(vector _source, vector _target); + LSL_List osGetObjectIDListByName(LSL_List _nameList); + //ApiDesc Send terrain to all agents void osTerrainFlush(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index ba5158a2ff..61d80fe4d1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -205,6 +205,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osTerrainSetHeight(x, y, val); } + public LSL_List osGetPathfindingPath(vector _source, vector _target) + { + return m_OSSL_Functions.osGetPathfindingPath(_source, _target); + } + + public LSL_List osGetObjectIDListByName(LSL_List _nameList) + { + return m_OSSL_Functions.osGetObjectIDListByName(_nameList); + } + public void osTerrainFlush() { m_OSSL_Functions.osTerrainFlush(); diff --git a/bin/inventory/4Creative/4CreativeFolders.xml b/bin/inventory/4Creative/4CreativeFolders.xml new file mode 100644 index 0000000000..cc85b34e9c --- /dev/null +++ b/bin/inventory/4Creative/4CreativeFolders.xml @@ -0,0 +1,50 @@ + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
diff --git a/bin/inventory/4Creative/4CreativeItems.xml b/bin/inventory/4Creative/4CreativeItems.xml new file mode 100644 index 0000000000..42ad006219 --- /dev/null +++ b/bin/inventory/4Creative/4CreativeItems.xml @@ -0,0 +1,436 @@ + + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ + +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+
-- 2.27.0.windows.1