aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2019-10-19 18:00:45 +0100
committerUbitUmarov2019-10-19 18:00:45 +0100
commitab335b5926a91a6b527da80812fb2bf210639f8c (patch)
tree6ef12758cb4af169b7b286344a38f0fefaad257e /OpenSim/Region
parentsame for osSetDynamicTextureURLBlendFace(). thx djphil (diff)
downloadopensim-SC-ab335b5926a91a6b527da80812fb2bf210639f8c.zip
opensim-SC-ab335b5926a91a6b527da80812fb2bf210639f8c.tar.gz
opensim-SC-ab335b5926a91a6b527da80812fb2bf210639f8c.tar.bz2
opensim-SC-ab335b5926a91a6b527da80812fb2bf210639f8c.tar.xz
add a few lsl constants
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs91
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs6
2 files changed, 93 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b260062..302c431 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -32,6 +32,7 @@ using System.Collections.Specialized;
32using System.Diagnostics; 32using System.Diagnostics;
33using System.Drawing; 33using System.Drawing;
34using System.Drawing.Imaging; 34using System.Drawing.Imaging;
35using System.Globalization;
35using System.Runtime.Remoting.Lifetime; 36using System.Runtime.Remoting.Lifetime;
36using System.Text; 37using System.Text;
37using System.Threading; 38using System.Threading;
@@ -67,6 +68,7 @@ using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
67using PrimType = OpenSim.Region.Framework.Scenes.PrimType; 68using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
68using AssetLandmark = OpenSim.Framework.AssetLandmark; 69using AssetLandmark = OpenSim.Framework.AssetLandmark;
69using RegionFlags = OpenSim.Framework.RegionFlags; 70using RegionFlags = OpenSim.Framework.RegionFlags;
71using RegionInfo = OpenSim.Framework.RegionInfo;
70 72
71using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; 73using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
72using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; 74using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
@@ -14364,9 +14366,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14364 if (!UUID.TryParse(id, out key)) 14366 if (!UUID.TryParse(id, out key))
14365 return ret; 14367 return ret;
14366 14368
14369 int count = 0;
14367 ScenePresence av = World.GetScenePresence(key); 14370 ScenePresence av = World.GetScenePresence(key);
14368 if (av != null) 14371 if (av != null)
14369 { 14372 {
14373 List<SceneObjectGroup> Attachments = null;
14374 int? nAnimated = null;
14370 foreach (object o in args.Data) 14375 foreach (object o in args.Data)
14371 { 14376 {
14372 switch (int.Parse(o.ToString())) 14377 switch (int.Parse(o.ToString()))
@@ -14494,13 +14499,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14494 ret.Add(new LSL_Vector(Vector3.Zero)); 14499 ret.Add(new LSL_Vector(Vector3.Zero));
14495 break; 14500 break;
14496 case ScriptBaseClass.OBJECT_PRIM_COUNT: 14501 case ScriptBaseClass.OBJECT_PRIM_COUNT:
14497 List<SceneObjectGroup> Attachments = av.GetAttachments(); 14502 if (Attachments == null)
14498 int count = 0; 14503 Attachments = av.GetAttachments();
14504 count = 0;
14499 try 14505 try
14500 { 14506 {
14501 foreach (SceneObjectGroup Attachment in Attachments) 14507 foreach (SceneObjectGroup Attachment in Attachments)
14502 count += Attachment.PrimCount; 14508 count += Attachment.PrimCount;
14503 } catch { }; 14509 }
14510 catch { };
14504 ret.Add(new LSL_Integer(count)); 14511 ret.Add(new LSL_Integer(count));
14505 break; 14512 break;
14506 case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: 14513 case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT:
@@ -14527,6 +14534,63 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14527 case ScriptBaseClass.OBJECT_TEMP_ATTACHED: 14534 case ScriptBaseClass.OBJECT_TEMP_ATTACHED:
14528 ret.Add(new LSL_Integer(0)); 14535 ret.Add(new LSL_Integer(0));
14529 break; 14536 break;
14537 case ScriptBaseClass.OBJECT_CREATION_TIME:
14538 ret.Add(new LSL_String(""));
14539 break;
14540 case ScriptBaseClass.OBJECT_SELECT_COUNT:
14541 ret.Add(new LSL_String(""));
14542 break;
14543 case ScriptBaseClass.OBJECT_SIT_COUNT:
14544 ret.Add(new LSL_String(""));
14545 break;
14546 case ScriptBaseClass.OBJECT_ANIMATED_COUNT:
14547 count = 0;
14548 if (nAnimated.HasValue)
14549 count = nAnimated.Value;
14550 else
14551 {
14552 if (Attachments == null)
14553 Attachments = av.GetAttachments();
14554 try
14555 {
14556 for(int i = 0; i < Attachments.Count;++i)
14557 {
14558 if(Attachments[i].RootPart.Shape.MeshFlagEntry)
14559 ++count;
14560 }
14561 }
14562 catch { };
14563 nAnimated = count;
14564 }
14565 ret.Add(new LSL_Integer(count));
14566 break;
14567
14568 case ScriptBaseClass.OBJECT_ANIMATED_SLOTS_AVAILABLE:
14569 count = 0;
14570 if (nAnimated.HasValue)
14571 count = nAnimated.Value;
14572 else
14573 {
14574 if (Attachments == null)
14575 Attachments = av.GetAttachments();
14576 count = 0;
14577 try
14578 {
14579 for (int i = 0; i < Attachments.Count; ++i)
14580 {
14581 if (Attachments[i].RootPart.Shape.MeshFlagEntry)
14582 ++count;
14583 }
14584 }
14585 catch { };
14586 nAnimated = count;
14587 }
14588 count = 2 - count; // for now hardcoded max (simulator features, viewers settings, etc)
14589 if(count < 0)
14590 count = 0;
14591 ret.Add(new LSL_Integer(count));
14592 break;
14593
14530 default: 14594 default:
14531 // Invalid or unhandled constant. 14595 // Invalid or unhandled constant.
14532 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); 14596 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL));
@@ -14710,7 +14774,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14710 case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: 14774 case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT:
14711 SceneObjectPart[] parts = obj.ParentGroup.Parts; 14775 SceneObjectPart[] parts = obj.ParentGroup.Parts;
14712 int nparts = parts.Count(); 14776 int nparts = parts.Count();
14713 int count = 0; 14777 count = 0;
14714 for(int i = 0; i < nparts; i++) 14778 for(int i = 0; i < nparts; i++)
14715 count += parts[i].Inventory.Count; 14779 count += parts[i].Inventory.Count;
14716 ret.Add(new LSL_Integer(count)); 14780 ret.Add(new LSL_Integer(count));
@@ -14731,6 +14795,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14731 ret.Add(new LSL_Integer(0)); 14795 ret.Add(new LSL_Integer(0));
14732 } 14796 }
14733 break; 14797 break;
14798 case ScriptBaseClass.OBJECT_CREATION_TIME:
14799 DateTime date = Util.ToDateTime(m_host.ParentGroup.RootPart.CreationDate);
14800 ret.Add(new LSL_String(date.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture)));
14801 break;
14802 case ScriptBaseClass.OBJECT_SELECT_COUNT:
14803 ret.Add(new LSL_Integer(0));
14804 break;
14805 case ScriptBaseClass.OBJECT_SIT_COUNT:
14806 ret.Add(new LSL_Integer(m_host.ParentGroup.GetSittingAvatarsCount()));
14807 break;
14808 case ScriptBaseClass.OBJECT_ANIMATED_COUNT:
14809 if(m_host.ParentGroup.RootPart.Shape.MeshFlagEntry)
14810 ret.Add(new LSL_Integer(1));
14811 else
14812 ret.Add(new LSL_Integer(0));
14813 break;
14814 case ScriptBaseClass.OBJECT_ANIMATED_SLOTS_AVAILABLE:
14815 ret.Add(new LSL_Integer(0));
14816 break;
14734 default: 14817 default:
14735 // Invalid or unhandled constant. 14818 // Invalid or unhandled constant.
14736 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); 14819 ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL));
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index f7acafe..3d17d98 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -664,6 +664,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
664 public const int OBJECT_GROUP_TAG = 33; 664 public const int OBJECT_GROUP_TAG = 33;
665 public const int OBJECT_TEMP_ATTACHED = 34; 665 public const int OBJECT_TEMP_ATTACHED = 34;
666 public const int OBJECT_ATTACHED_SLOTS_AVAILABLE = 35; 666 public const int OBJECT_ATTACHED_SLOTS_AVAILABLE = 35;
667 public const int OBJECT_CREATION_TIME = 36;
668 public const int OBJECT_SELECT_COUNT = 37;
669 public const int OBJECT_SIT_COUNT = 38;
670 public const int OBJECT_ANIMATED_COUNT = 39;
671 public const int OBJECT_ANIMATED_SLOTS_AVAILABLE = 40;
672
667 673
668 // Pathfinding types 674 // Pathfinding types
669 //ApiDesc not supported 675 //ApiDesc not supported