diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
4 files changed, 71 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 693992a..94fd940 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -31,6 +31,7 @@ using System.Collections.Generic; | |||
31 | using System.Threading; | 31 | using System.Threading; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Monitoring; | ||
34 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.ScriptEngine.Interfaces; | 36 | using OpenSim.Region.ScriptEngine.Interfaces; |
36 | using OpenSim.Region.ScriptEngine.Shared; | 37 | using OpenSim.Region.ScriptEngine.Shared; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cd72dc2..ce1c364 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6885,22 +6885,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6885 | if (folderID == UUID.Zero) | 6885 | if (folderID == UUID.Zero) |
6886 | return; | 6886 | return; |
6887 | 6887 | ||
6888 | byte[] bucket = new byte[1]; | ||
6889 | bucket[0] = (byte)AssetType.Folder; | ||
6890 | //byte[] objBytes = folderID.GetBytes(); | ||
6891 | //Array.Copy(objBytes, 0, bucket, 1, 16); | ||
6892 | |||
6893 | GridInstantMessage msg = new GridInstantMessage(World, | ||
6894 | m_host.OwnerID, m_host.Name, destID, | ||
6895 | (byte)InstantMessageDialog.TaskInventoryOffered, | ||
6896 | false, category+". "+m_host.Name+" is located at "+ | ||
6897 | World.RegionInfo.RegionName+" "+ | ||
6898 | m_host.AbsolutePosition.ToString(), | ||
6899 | folderID, true, m_host.AbsolutePosition, | ||
6900 | bucket); | ||
6901 | |||
6902 | if (m_TransferModule != null) | 6888 | if (m_TransferModule != null) |
6889 | { | ||
6890 | byte[] bucket = new byte[] { (byte)AssetType.Folder }; | ||
6891 | |||
6892 | GridInstantMessage msg = new GridInstantMessage(World, | ||
6893 | m_host.UUID, m_host.Name + ", an object owned by " + | ||
6894 | resolveName(m_host.OwnerID) + ",", destID, | ||
6895 | (byte)InstantMessageDialog.TaskInventoryOffered, | ||
6896 | false, category + "\n" + m_host.Name + " is located at " + | ||
6897 | World.RegionInfo.RegionName + " " + | ||
6898 | m_host.AbsolutePosition.ToString(), | ||
6899 | folderID, true, m_host.AbsolutePosition, | ||
6900 | bucket); | ||
6901 | |||
6903 | m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); | 6902 | m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); |
6903 | } | ||
6904 | } | 6904 | } |
6905 | 6905 | ||
6906 | public void llSetVehicleType(int type) | 6906 | public void llSetVehicleType(int type) |
@@ -11847,7 +11847,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11847 | break; | 11847 | break; |
11848 | case ScriptBaseClass.OBJECT_ROT: | 11848 | case ScriptBaseClass.OBJECT_ROT: |
11849 | { | 11849 | { |
11850 | Quaternion rot = Quaternion.Identity; | 11850 | Quaternion rot = Quaternion.Identity; |
11851 | 11851 | ||
11852 | if (obj.ParentGroup.RootPart == obj) | 11852 | if (obj.ParentGroup.RootPart == obj) |
11853 | rot = obj.ParentGroup.GroupRotation; | 11853 | rot = obj.ParentGroup.GroupRotation; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 4bd3dff..7844c75 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |||
@@ -200,24 +200,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
200 | for (int i = 0; i < result.Length; i++) | 200 | for (int i = 0; i < result.Length; i++) |
201 | { | 201 | { |
202 | if (result[i] is string) | 202 | if (result[i] is string) |
203 | { | ||
203 | llist[i] = new LSL_String((string)result[i]); | 204 | llist[i] = new LSL_String((string)result[i]); |
205 | } | ||
204 | else if (result[i] is int) | 206 | else if (result[i] is int) |
207 | { | ||
205 | llist[i] = new LSL_Integer((int)result[i]); | 208 | llist[i] = new LSL_Integer((int)result[i]); |
209 | } | ||
206 | else if (result[i] is float) | 210 | else if (result[i] is float) |
211 | { | ||
207 | llist[i] = new LSL_Float((float)result[i]); | 212 | llist[i] = new LSL_Float((float)result[i]); |
213 | } | ||
214 | else if (result[i] is UUID) | ||
215 | { | ||
216 | llist[i] = new LSL_Key(result[i].ToString()); | ||
217 | } | ||
208 | else if (result[i] is OpenMetaverse.Vector3) | 218 | else if (result[i] is OpenMetaverse.Vector3) |
209 | { | 219 | { |
210 | OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i]; | 220 | OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i]; |
211 | llist[i] = new LSL_Vector(vresult.X,vresult.Y,vresult.Z); | 221 | llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z); |
212 | } | 222 | } |
213 | else if (result[i] is OpenMetaverse.Quaternion) | 223 | else if (result[i] is OpenMetaverse.Quaternion) |
214 | { | 224 | { |
215 | OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i]; | 225 | OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i]; |
216 | llist[i] = new LSL_Rotation(qresult.X,qresult.Y,qresult.Z,qresult.W); | 226 | llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W); |
217 | } | 227 | } |
218 | else | 228 | else |
219 | { | 229 | { |
220 | MODError(String.Format("unknown list element returned by {0}",fname)); | 230 | MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name)); |
221 | } | 231 | } |
222 | } | 232 | } |
223 | 233 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 29d0342..1181c10 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3290,8 +3290,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3290 | ((LSL_Api)m_LSL_Api).llSay(0, string.Format("Unable to attach, item '{0}' is not an object.", itemName)); | 3290 | ((LSL_Api)m_LSL_Api).llSay(0, string.Format("Unable to attach, item '{0}' is not an object.", itemName)); |
3291 | 3291 | ||
3292 | throw new Exception(String.Format("The inventory item '{0}' is not an object", itemName)); | 3292 | throw new Exception(String.Format("The inventory item '{0}' is not an object", itemName)); |
3293 | |||
3294 | return; | ||
3295 | } | 3293 | } |
3296 | 3294 | ||
3297 | ScenePresence sp = World.GetScenePresence(avatarId); | 3295 | ScenePresence sp = World.GetScenePresence(avatarId); |
@@ -3322,5 +3320,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3322 | InitLSL(); | 3320 | InitLSL(); |
3323 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); | 3321 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); |
3324 | } | 3322 | } |
3323 | |||
3324 | /// <summary> | ||
3325 | /// Checks if thing is a UUID. | ||
3326 | /// </summary> | ||
3327 | /// <param name="thing"></param> | ||
3328 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> | ||
3329 | public LSL_Integer osIsUUID(string thing) | ||
3330 | { | ||
3331 | CheckThreatLevel(ThreatLevel.None, "osIsUUID"); | ||
3332 | m_host.AddScriptLPS(1); | ||
3333 | |||
3334 | UUID test; | ||
3335 | return UUID.TryParse(thing, out test) ? 1 : 0; | ||
3336 | } | ||
3337 | |||
3338 | /// <summary> | ||
3339 | /// Wraps to Math.Min() | ||
3340 | /// </summary> | ||
3341 | /// <param name="a"></param> | ||
3342 | /// <param name="b"></param> | ||
3343 | /// <returns></returns> | ||
3344 | public LSL_Float osMin(double a, double b) | ||
3345 | { | ||
3346 | CheckThreatLevel(ThreatLevel.None, "osMin"); | ||
3347 | m_host.AddScriptLPS(1); | ||
3348 | |||
3349 | return Math.Min(a, b); | ||
3350 | } | ||
3351 | |||
3352 | /// <summary> | ||
3353 | /// Wraps to Math.max() | ||
3354 | /// </summary> | ||
3355 | /// <param name="a"></param> | ||
3356 | /// <param name="b"></param> | ||
3357 | /// <returns></returns> | ||
3358 | public LSL_Float osMax(double a, double b) | ||
3359 | { | ||
3360 | CheckThreatLevel(ThreatLevel.None, "osMax"); | ||
3361 | m_host.AddScriptLPS(1); | ||
3362 | |||
3363 | return Math.Max(a, b); | ||
3364 | } | ||
3325 | } | 3365 | } |
3326 | } | 3366 | } |