diff options
author | Charles Krinke | 2009-06-29 18:07:30 +0000 |
---|---|---|
committer | Charles Krinke | 2009-06-29 18:07:30 +0000 |
commit | 7bb070be55d0efe3a272f170055bdf02ee41aa65 (patch) | |
tree | d24437108a7ae8fab611bb8b1706db967ac8f719 /OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |
parent | * Changing List to Dictionary in PacketQueue.Dequeue for great justice (and p... (diff) | |
download | opensim-SC_OLD-7bb070be55d0efe3a272f170055bdf02ee41aa65.zip opensim-SC_OLD-7bb070be55d0efe3a272f170055bdf02ee41aa65.tar.gz opensim-SC_OLD-7bb070be55d0efe3a272f170055bdf02ee41aa65.tar.bz2 opensim-SC_OLD-7bb070be55d0efe3a272f170055bdf02ee41aa65.tar.xz |
Thank you kindly, Snowdrop/Snowcrash for a patch that:
This patch makes the worn attachments accessible to MRM scripting
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 8fed89c..6fd36bf 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -26,15 +26,22 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | ||
30 | using System.Collections; | ||
31 | using System.Collections.Generic; | ||
32 | |||
29 | using OpenMetaverse; | 33 | using OpenMetaverse; |
30 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
31 | 35 | ||
36 | using log4net; | ||
37 | |||
32 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 38 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
33 | { | 39 | { |
34 | class SPAvatar : System.MarshalByRefObject, IAvatar | 40 | class SPAvatar : System.MarshalByRefObject, IAvatar |
35 | { | 41 | { |
36 | private readonly Scene m_rootScene; | 42 | private readonly Scene m_rootScene; |
37 | private readonly UUID m_ID; | 43 | private readonly UUID m_ID; |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
38 | 45 | ||
39 | public SPAvatar(Scene scene, UUID ID) | 46 | public SPAvatar(Scene scene, UUID ID) |
40 | { | 47 | { |
@@ -63,5 +70,26 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
63 | get { return GetSP().AbsolutePosition; } | 70 | get { return GetSP().AbsolutePosition; } |
64 | set { GetSP().TeleportWithMomentum(value); } | 71 | set { GetSP().TeleportWithMomentum(value); } |
65 | } | 72 | } |
73 | |||
74 | #region IAvatar implementation | ||
75 | public IAvatarAttachment[] Attachments | ||
76 | { | ||
77 | get { | ||
78 | List<IAvatarAttachment> attachments = new List<IAvatarAttachment>(); | ||
79 | |||
80 | Hashtable internalAttachments = GetSP().Appearance.GetAttachments(); | ||
81 | if(internalAttachments != null) | ||
82 | { | ||
83 | foreach(DictionaryEntry element in internalAttachments) | ||
84 | { | ||
85 | Hashtable attachInfo = (Hashtable)element.Value; | ||
86 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"]))); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | return attachments.ToArray(); | ||
91 | } | ||
92 | } | ||
93 | #endregion | ||
66 | } | 94 | } |
67 | } | 95 | } |