diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 91 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 6 | ||||
-rw-r--r-- | bin/ScriptSyntax.xml | 22 |
3 files changed, 114 insertions, 5 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; | |||
32 | using System.Diagnostics; | 32 | using System.Diagnostics; |
33 | using System.Drawing; | 33 | using System.Drawing; |
34 | using System.Drawing.Imaging; | 34 | using System.Drawing.Imaging; |
35 | using System.Globalization; | ||
35 | using System.Runtime.Remoting.Lifetime; | 36 | using System.Runtime.Remoting.Lifetime; |
36 | using System.Text; | 37 | using System.Text; |
37 | using System.Threading; | 38 | using System.Threading; |
@@ -67,6 +68,7 @@ using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | |||
67 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | 68 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; |
68 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 69 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
69 | using RegionFlags = OpenSim.Framework.RegionFlags; | 70 | using RegionFlags = OpenSim.Framework.RegionFlags; |
71 | using RegionInfo = OpenSim.Framework.RegionInfo; | ||
70 | 72 | ||
71 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 73 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
72 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; | 74 | using 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 |
diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index e2ab46e..411331b 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml | |||
@@ -1,4 +1,4 @@ | |||
1 | 7ddea7b6-2c1f-1bf6-d0b1-8e99955c9587 | 1 | 84b526ce-3ad0-46bb-7a8a-b37be2734c5b |
2 | <llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer> | 2 | <llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer> |
3 | <key>controls</key> | 3 | <key>controls</key> |
4 | <map> | 4 | <map> |
@@ -1371,6 +1371,14 @@ | |||
1371 | <key>type</key><string>string</string> | 1371 | <key>type</key><string>string</string> |
1372 | <key>value</key><string>00000000-0000-0000-0000-000000000000</string> | 1372 | <key>value</key><string>00000000-0000-0000-0000-000000000000</string> |
1373 | </map> | 1373 | </map> |
1374 | <key>OBJECT_ANIMATED_COUNT</key><map> | ||
1375 | <key>type</key><string>integer</string> | ||
1376 | <key>value</key><string>39</string> | ||
1377 | </map> | ||
1378 | <key>OBJECT_ANIMATED_SLOTS_AVAILABLE</key><map> | ||
1379 | <key>type</key><string>integer</string> | ||
1380 | <key>value</key><string>40</string> | ||
1381 | </map> | ||
1374 | <key>OBJECT_ATTACHED_POINT</key><map> | 1382 | <key>OBJECT_ATTACHED_POINT</key><map> |
1375 | <key>type</key><string>integer</string> | 1383 | <key>type</key><string>integer</string> |
1376 | <key>value</key><string>19</string> | 1384 | <key>value</key><string>19</string> |
@@ -1391,6 +1399,10 @@ | |||
1391 | <key>type</key><string>integer</string> | 1399 | <key>type</key><string>integer</string> |
1392 | <key>value</key><string>28</string> | 1400 | <key>value</key><string>28</string> |
1393 | </map> | 1401 | </map> |
1402 | <key>OBJECT_CREATION_TIME</key><map> | ||
1403 | <key>type</key><string>integer</string> | ||
1404 | <key>value</key><string>36</string> | ||
1405 | </map> | ||
1394 | <key>OBJECT_CREATOR</key><map> | 1406 | <key>OBJECT_CREATOR</key><map> |
1395 | <key>type</key><string>integer</string> | 1407 | <key>type</key><string>integer</string> |
1396 | <key>value</key><string>8</string> | 1408 | <key>value</key><string>8</string> |
@@ -1483,10 +1495,18 @@ | |||
1483 | <key>type</key><string>integer</string> | 1495 | <key>type</key><string>integer</string> |
1484 | <key>value</key><string>12</string> | 1496 | <key>value</key><string>12</string> |
1485 | </map> | 1497 | </map> |
1498 | <key>OBJECT_SELECT_COUNT</key><map> | ||
1499 | <key>type</key><string>integer</string> | ||
1500 | <key>value</key><string>37</string> | ||
1501 | </map> | ||
1486 | <key>OBJECT_SERVER_COST</key><map> | 1502 | <key>OBJECT_SERVER_COST</key><map> |
1487 | <key>type</key><string>integer</string> | 1503 | <key>type</key><string>integer</string> |
1488 | <key>value</key><string>14</string> | 1504 | <key>value</key><string>14</string> |
1489 | </map> | 1505 | </map> |
1506 | <key>OBJECT_SIT_COUNT</key><map> | ||
1507 | <key>type</key><string>integer</string> | ||
1508 | <key>value</key><string>38</string> | ||
1509 | </map> | ||
1490 | <key>OBJECT_STREAMING_COST</key><map> | 1510 | <key>OBJECT_STREAMING_COST</key><map> |
1491 | <key>type</key><string>integer</string> | 1511 | <key>type</key><string>integer</string> |
1492 | <key>value</key><string>15</string> | 1512 | <key>value</key><string>15</string> |