diff options
author | Jeff Ames | 2009-07-01 23:37:09 +0000 |
---|---|---|
committer | Jeff Ames | 2009-07-01 23:37:09 +0000 |
commit | 1d01d6d919ec55e59d5c9b20a978aa6b802bd45d (patch) | |
tree | 8a76a2c91c3c6ea1b34d5564cb6e8bc5efed0883 /OpenSim/Region/OptionalModules/Scripting/Minimodule | |
parent | Add copyright headers. (diff) | |
download | opensim-SC_OLD-1d01d6d919ec55e59d5c9b20a978aa6b802bd45d.zip opensim-SC_OLD-1d01d6d919ec55e59d5c9b20a978aa6b802bd45d.tar.gz opensim-SC_OLD-1d01d6d919ec55e59d5c9b20a978aa6b802bd45d.tar.bz2 opensim-SC_OLD-1d01d6d919ec55e59d5c9b20a978aa6b802bd45d.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule')
9 files changed, 320 insertions, 320 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs index 3345988..849e3ca 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs | |||
@@ -34,28 +34,28 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
34 | { | 34 | { |
35 | public interface IAvatarAttachment | 35 | public interface IAvatarAttachment |
36 | { | 36 | { |
37 | //// <value> | 37 | //// <value> |
38 | /// Describes where on the avatar the attachment is located | 38 | /// Describes where on the avatar the attachment is located |
39 | /// </value> | 39 | /// </value> |
40 | int Location { get ; } | 40 | int Location { get ; } |
41 | 41 | ||
42 | //// <value> | 42 | //// <value> |
43 | /// Accessor to the rez'ed asset, representing the attachment | 43 | /// Accessor to the rez'ed asset, representing the attachment |
44 | /// </value> | 44 | /// </value> |
45 | IObject Asset { get; } | 45 | IObject Asset { get; } |
46 | } | 46 | } |
47 | 47 | ||
48 | public interface IAvatar : IEntity | 48 | public interface IAvatar : IEntity |
49 | { | 49 | { |
50 | //// <value> | 50 | //// <value> |
51 | /// Array of worn attachments, empty but not null, if no attachments are worn | 51 | /// Array of worn attachments, empty but not null, if no attachments are worn |
52 | /// </value> | 52 | /// </value> |
53 | 53 | ||
54 | IAvatarAttachment[] Attachments { get; } | 54 | IAvatarAttachment[] Attachments { get; } |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Request to open an url clientside | 57 | /// Request to open an url clientside |
58 | /// </summary> | 58 | /// </summary> |
59 | void LoadUrl(IObject sender, string message, string url); | 59 | void LoadUrl(IObject sender, string message, string url); |
60 | } | 60 | } |
61 | } | 61 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IInventoryItem.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IInventoryItem.cs index 50f98a2..208ddb0 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IInventoryItem.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IInventoryItem.cs | |||
@@ -30,14 +30,14 @@ using OpenMetaverse; | |||
30 | 30 | ||
31 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 31 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
32 | { | 32 | { |
33 | 33 | ||
34 | /// <summary> | 34 | /// <summary> |
35 | /// This implements the methods needed to operate on individual inventory items. | 35 | /// This implements the methods needed to operate on individual inventory items. |
36 | /// </summary> | 36 | /// </summary> |
37 | public interface IInventoryItem | 37 | public interface IInventoryItem |
38 | { | 38 | { |
39 | int Type { get; } | 39 | int Type { get; } |
40 | UUID AssetID { get; } | 40 | UUID AssetID { get; } |
41 | T RetreiveAsset<T>() where T : OpenMetaverse.Asset, new(); | 41 | T RetreiveAsset<T>() where T : OpenMetaverse.Asset, new(); |
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 1be3b71..f45df48 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | |||
@@ -179,10 +179,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
179 | /// <param name="msg">The message to send to the user</param> | 179 | /// <param name="msg">The message to send to the user</param> |
180 | void Say(string msg); | 180 | void Say(string msg); |
181 | 181 | ||
182 | //// <value> | 182 | //// <value> |
183 | /// Grants access to the objects inventory | 183 | /// Grants access to the objects inventory |
184 | /// </value> | 184 | /// </value> |
185 | IObjectInventory Inventory { get; } | 185 | IObjectInventory Inventory { get; } |
186 | } | 186 | } |
187 | 187 | ||
188 | public enum PhysicsMaterial | 188 | public enum PhysicsMaterial |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs index dc0b94a..b9c0065 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs | |||
@@ -35,62 +35,62 @@ using OpenMetaverse; | |||
35 | 35 | ||
36 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 36 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
37 | { | 37 | { |
38 | public class InventoryItem : IInventoryItem | 38 | public class InventoryItem : IInventoryItem |
39 | { | 39 | { |
40 | TaskInventoryItem m_privateItem; | 40 | TaskInventoryItem m_privateItem; |
41 | Scene m_rootSceene; | 41 | Scene m_rootSceene; |
42 | 42 | ||
43 | public InventoryItem(Scene rootScene, TaskInventoryItem internalItem) | 43 | public InventoryItem(Scene rootScene, TaskInventoryItem internalItem) |
44 | { | 44 | { |
45 | m_rootSceene = rootScene; | 45 | m_rootSceene = rootScene; |
46 | m_privateItem = internalItem; | 46 | m_privateItem = internalItem; |
47 | } | 47 | } |
48 | 48 | ||
49 | // Marked internal, to prevent scripts from accessing the internal type | 49 | // Marked internal, to prevent scripts from accessing the internal type |
50 | internal TaskInventoryItem ToTaskInventoryItem() | 50 | internal TaskInventoryItem ToTaskInventoryItem() |
51 | { | 51 | { |
52 | return m_privateItem; | 52 | return m_privateItem; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// This will attempt to convert from an IInventoryItem to an InventoryItem object | 56 | /// This will attempt to convert from an IInventoryItem to an InventoryItem object |
57 | /// </summary> | 57 | /// </summary> |
58 | /// <description> | 58 | /// <description> |
59 | /// In order for this to work the object which implements IInventoryItem must inherit from InventoryItem, otherwise | 59 | /// In order for this to work the object which implements IInventoryItem must inherit from InventoryItem, otherwise |
60 | /// an exception is thrown. | 60 | /// an exception is thrown. |
61 | /// </description> | 61 | /// </description> |
62 | /// <param name="i"> | 62 | /// <param name="i"> |
63 | /// The interface to upcast <see cref="IInventoryItem"/> | 63 | /// The interface to upcast <see cref="IInventoryItem"/> |
64 | /// </param> | 64 | /// </param> |
65 | /// <returns> | 65 | /// <returns> |
66 | /// The object backing the interface implementation <see cref="InventoryItem"/> | 66 | /// The object backing the interface implementation <see cref="InventoryItem"/> |
67 | /// </returns> | 67 | /// </returns> |
68 | internal static InventoryItem FromInterface(IInventoryItem i) | 68 | internal static InventoryItem FromInterface(IInventoryItem i) |
69 | { | 69 | { |
70 | if(typeof(InventoryItem).IsAssignableFrom(i.GetType())) | 70 | if (typeof(InventoryItem).IsAssignableFrom(i.GetType())) |
71 | { | 71 | { |
72 | return (InventoryItem)i; | 72 | return (InventoryItem)i; |
73 | } | 73 | } |
74 | else | 74 | else |
75 | { | 75 | { |
76 | throw new ApplicationException("[MRM] There is no legal conversion from IInventoryItem to InventoryItem"); | 76 | throw new ApplicationException("[MRM] There is no legal conversion from IInventoryItem to InventoryItem"); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | public int Type { get { return m_privateItem.Type; } } | 80 | public int Type { get { return m_privateItem.Type; } } |
81 | public UUID AssetID { get { return m_privateItem.AssetID; } } | 81 | public UUID AssetID { get { return m_privateItem.AssetID; } } |
82 | 82 | ||
83 | public T RetreiveAsset<T>() where T : OpenMetaverse.Asset, new() | 83 | public T RetreiveAsset<T>() where T : OpenMetaverse.Asset, new() |
84 | { | 84 | { |
85 | AssetBase a = m_rootSceene.AssetService.Get(AssetID.ToString()); | 85 | AssetBase a = m_rootSceene.AssetService.Get(AssetID.ToString()); |
86 | T result = new T(); | 86 | T result = new T(); |
87 | 87 | ||
88 | if((sbyte)result.AssetType != a.Type) | 88 | if ((sbyte)result.AssetType != a.Type) |
89 | throw new ApplicationException("[MRM] The supplied asset class does not match the found asset"); | 89 | throw new ApplicationException("[MRM] The supplied asset class does not match the found asset"); |
90 | 90 | ||
91 | result.AssetData = a.Data; | 91 | result.AssetData = a.Data; |
92 | result.Decode(); | 92 | result.Decode(); |
93 | return result; | 93 | return result; |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } | 96 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectInventory.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectInventory.cs index 126250a..bb85d06 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectInventory.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectInventory.cs | |||
@@ -32,11 +32,11 @@ using OpenMetaverse; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | 33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// This implements the methods neccesary to operate on the inventory of an object | 36 | /// This implements the methods neccesary to operate on the inventory of an object |
37 | /// </summary> | 37 | /// </summary> |
38 | public interface IObjectInventory : IDictionary<UUID, IInventoryItem> | 38 | public interface IObjectInventory : IDictionary<UUID, IInventoryItem> |
39 | { | 39 | { |
40 | IInventoryItem this[string name] { get; } | 40 | IInventoryItem this[string name] { get; } |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 689c70e1d..bc26389 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -301,12 +301,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
301 | get { return this; } | 301 | get { return this; } |
302 | } | 302 | } |
303 | 303 | ||
304 | public IObjectInventory Inventory | 304 | public IObjectInventory Inventory |
305 | { | 305 | { |
306 | get { return new SOPObjectInventory(m_rootScene, GetSOP().TaskInventory); } | 306 | get { return new SOPObjectInventory(m_rootScene, GetSOP().TaskInventory); } |
307 | } | 307 | } |
308 | 308 | ||
309 | #region Public Functions | 309 | #region Public Functions |
310 | 310 | ||
311 | public void Say(string msg) | 311 | public void Say(string msg) |
312 | { | 312 | { |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs index cae49a3..d20f4a4 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs | |||
@@ -35,181 +35,181 @@ using OpenMetaverse; | |||
35 | 35 | ||
36 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | 36 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object |
37 | { | 37 | { |
38 | public class SOPObjectInventory : IObjectInventory | 38 | public class SOPObjectInventory : IObjectInventory |
39 | { | 39 | { |
40 | TaskInventoryDictionary m_privateInventory; /// OpenSim's task inventory | 40 | TaskInventoryDictionary m_privateInventory; /// OpenSim's task inventory |
41 | Dictionary<UUID, IInventoryItem> m_publicInventory; /// MRM's inventory | 41 | Dictionary<UUID, IInventoryItem> m_publicInventory; /// MRM's inventory |
42 | Scene m_rootScene; | 42 | Scene m_rootScene; |
43 | 43 | ||
44 | public SOPObjectInventory(Scene rootScene, TaskInventoryDictionary taskInventory) | 44 | public SOPObjectInventory(Scene rootScene, TaskInventoryDictionary taskInventory) |
45 | { | 45 | { |
46 | m_rootScene = rootScene; | 46 | m_rootScene = rootScene; |
47 | m_privateInventory = taskInventory; | 47 | m_privateInventory = taskInventory; |
48 | m_publicInventory = new Dictionary<UUID, IInventoryItem>(); | 48 | m_publicInventory = new Dictionary<UUID, IInventoryItem>(); |
49 | } | 49 | } |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Fully populate the public dictionary with the contents of the private dictionary | 52 | /// Fully populate the public dictionary with the contents of the private dictionary |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <description> | 54 | /// <description> |
55 | /// This will only convert those items which hasn't already been converted. ensuring that | 55 | /// This will only convert those items which hasn't already been converted. ensuring that |
56 | /// no items are converted twice, and that any references already in use are maintained. | 56 | /// no items are converted twice, and that any references already in use are maintained. |
57 | /// </description> | 57 | /// </description> |
58 | private void SynchronizeDictionaries() | 58 | private void SynchronizeDictionaries() |
59 | { | 59 | { |
60 | foreach(TaskInventoryItem privateItem in m_privateInventory.Values) | 60 | foreach (TaskInventoryItem privateItem in m_privateInventory.Values) |
61 | if(!m_publicInventory.ContainsKey(privateItem.ItemID)) | 61 | if (!m_publicInventory.ContainsKey(privateItem.ItemID)) |
62 | m_publicInventory.Add(privateItem.ItemID, new InventoryItem(m_rootScene, privateItem)); | 62 | m_publicInventory.Add(privateItem.ItemID, new InventoryItem(m_rootScene, privateItem)); |
63 | } | 63 | } |
64 | 64 | ||
65 | #region IDictionary<UUID, IInventoryItem> implementation | 65 | #region IDictionary<UUID, IInventoryItem> implementation |
66 | public void Add (UUID key, IInventoryItem value) | 66 | public void Add (UUID key, IInventoryItem value) |
67 | { | 67 | { |
68 | m_publicInventory.Add(key, value); | 68 | m_publicInventory.Add(key, value); |
69 | m_privateInventory.Add(key, InventoryItem.FromInterface(value).ToTaskInventoryItem()); | 69 | m_privateInventory.Add(key, InventoryItem.FromInterface(value).ToTaskInventoryItem()); |
70 | } | 70 | } |
71 | 71 | ||
72 | public bool ContainsKey (UUID key) | 72 | public bool ContainsKey (UUID key) |
73 | { | 73 | { |
74 | return m_privateInventory.ContainsKey(key); | 74 | return m_privateInventory.ContainsKey(key); |
75 | } | 75 | } |
76 | 76 | ||
77 | public bool Remove (UUID key) | 77 | public bool Remove (UUID key) |
78 | { | 78 | { |
79 | m_publicInventory.Remove(key); | 79 | m_publicInventory.Remove(key); |
80 | return m_privateInventory.Remove(key); | 80 | return m_privateInventory.Remove(key); |
81 | } | 81 | } |
82 | 82 | ||
83 | public bool TryGetValue (UUID key, out IInventoryItem value) | 83 | public bool TryGetValue (UUID key, out IInventoryItem value) |
84 | { | 84 | { |
85 | value = null; | 85 | value = null; |
86 | 86 | ||
87 | bool result = false; | 87 | bool result = false; |
88 | if(!m_publicInventory.TryGetValue(key, out value)) | 88 | if (!m_publicInventory.TryGetValue(key, out value)) |
89 | { | 89 | { |
90 | // wasn't found in the public inventory | 90 | // wasn't found in the public inventory |
91 | TaskInventoryItem privateItem; | 91 | TaskInventoryItem privateItem; |
92 | 92 | ||
93 | result = m_privateInventory.TryGetValue(key, out privateItem); | 93 | result = m_privateInventory.TryGetValue(key, out privateItem); |
94 | if(result) | 94 | if (result) |
95 | { | 95 | { |
96 | value = new InventoryItem(m_rootScene, privateItem); | 96 | value = new InventoryItem(m_rootScene, privateItem); |
97 | m_publicInventory.Add(key, value); // add item, so we don't convert again | 97 | m_publicInventory.Add(key, value); // add item, so we don't convert again |
98 | } | 98 | } |
99 | } else | 99 | } else |
100 | return true; | 100 | return true; |
101 | 101 | ||
102 | return result; | 102 | return result; |
103 | } | 103 | } |
104 | 104 | ||
105 | public ICollection<UUID> Keys { | 105 | public ICollection<UUID> Keys { |
106 | get { | 106 | get { |
107 | return m_privateInventory.Keys; | 107 | return m_privateInventory.Keys; |
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | public ICollection<IInventoryItem> Values { | 111 | public ICollection<IInventoryItem> Values { |
112 | get { | 112 | get { |
113 | SynchronizeDictionaries(); | 113 | SynchronizeDictionaries(); |
114 | return m_publicInventory.Values; | 114 | return m_publicInventory.Values; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | #endregion | 117 | #endregion |
118 | 118 | ||
119 | #region IEnumerable<KeyValuePair<UUID, IInventoryItem>> implementation | 119 | #region IEnumerable<KeyValuePair<UUID, IInventoryItem>> implementation |
120 | public IEnumerator<KeyValuePair<UUID, IInventoryItem>> GetEnumerator () | 120 | public IEnumerator<KeyValuePair<UUID, IInventoryItem>> GetEnumerator () |
121 | { | 121 | { |
122 | SynchronizeDictionaries(); | 122 | SynchronizeDictionaries(); |
123 | return m_publicInventory.GetEnumerator(); | 123 | return m_publicInventory.GetEnumerator(); |
124 | } | 124 | } |
125 | 125 | ||
126 | #endregion | 126 | #endregion |
127 | 127 | ||
128 | #region IEnumerable implementation | 128 | #region IEnumerable implementation |
129 | IEnumerator IEnumerable.GetEnumerator () | 129 | IEnumerator IEnumerable.GetEnumerator () |
130 | { | 130 | { |
131 | SynchronizeDictionaries(); | 131 | SynchronizeDictionaries(); |
132 | return m_publicInventory.GetEnumerator(); | 132 | return m_publicInventory.GetEnumerator(); |
133 | } | 133 | } |
134 | 134 | ||
135 | #endregion | 135 | #endregion |
136 | 136 | ||
137 | #region ICollection<KeyValuePair<UUID, IInventoryItem>> implementation | 137 | #region ICollection<KeyValuePair<UUID, IInventoryItem>> implementation |
138 | public void Add (KeyValuePair<UUID, IInventoryItem> item) | 138 | public void Add (KeyValuePair<UUID, IInventoryItem> item) |
139 | { | 139 | { |
140 | Add(item.Key, item.Value); | 140 | Add(item.Key, item.Value); |
141 | } | 141 | } |
142 | 142 | ||
143 | public void Clear () | 143 | public void Clear () |
144 | { | 144 | { |
145 | m_publicInventory.Clear(); | 145 | m_publicInventory.Clear(); |
146 | m_privateInventory.Clear(); | 146 | m_privateInventory.Clear(); |
147 | } | 147 | } |
148 | 148 | ||
149 | public bool Contains (KeyValuePair<UUID, IInventoryItem> item) | 149 | public bool Contains (KeyValuePair<UUID, IInventoryItem> item) |
150 | { | 150 | { |
151 | return m_privateInventory.ContainsKey(item.Key); | 151 | return m_privateInventory.ContainsKey(item.Key); |
152 | } | 152 | } |
153 | 153 | ||
154 | public void CopyTo (KeyValuePair<UUID, IInventoryItem>[] array, int arrayIndex) | 154 | public void CopyTo (KeyValuePair<UUID, IInventoryItem>[] array, int arrayIndex) |
155 | { | 155 | { |
156 | throw new NotImplementedException(); | 156 | throw new NotImplementedException(); |
157 | } | 157 | } |
158 | 158 | ||
159 | public bool Remove (KeyValuePair<UUID, IInventoryItem> item) | 159 | public bool Remove (KeyValuePair<UUID, IInventoryItem> item) |
160 | { | 160 | { |
161 | return Remove(item.Key); | 161 | return Remove(item.Key); |
162 | } | 162 | } |
163 | 163 | ||
164 | public int Count { | 164 | public int Count { |
165 | get { | 165 | get { |
166 | return m_privateInventory.Count; | 166 | return m_privateInventory.Count; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | public bool IsReadOnly { | 170 | public bool IsReadOnly { |
171 | get { | 171 | get { |
172 | return false; | 172 | return false; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | #endregion | 175 | #endregion |
176 | 176 | ||
177 | #region Explicit implementations | 177 | #region Explicit implementations |
178 | IInventoryItem System.Collections.Generic.IDictionary<UUID, IInventoryItem>.this[UUID key] | 178 | IInventoryItem System.Collections.Generic.IDictionary<UUID, IInventoryItem>.this[UUID key] |
179 | { | 179 | { |
180 | get { | 180 | get { |
181 | IInventoryItem result; | 181 | IInventoryItem result; |
182 | if(TryGetValue(key, out result)) | 182 | if (TryGetValue(key, out result)) |
183 | return result; | 183 | return result; |
184 | else | 184 | else |
185 | throw new KeyNotFoundException("[MRM] The requrested item ID could not be found"); | 185 | throw new KeyNotFoundException("[MRM] The requrested item ID could not be found"); |
186 | } | 186 | } |
187 | set { | 187 | set { |
188 | m_publicInventory[key] = value; | 188 | m_publicInventory[key] = value; |
189 | m_privateInventory[key] = InventoryItem.FromInterface(value).ToTaskInventoryItem(); | 189 | m_privateInventory[key] = InventoryItem.FromInterface(value).ToTaskInventoryItem(); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<UUID, IInventoryItem>>.CopyTo(System.Collections.Generic.KeyValuePair<UUID,IInventoryItem>[] array, int offset) | 193 | void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<UUID, IInventoryItem>>.CopyTo(System.Collections.Generic.KeyValuePair<UUID,IInventoryItem>[] array, int offset) |
194 | { | 194 | { |
195 | throw new NotImplementedException(); | 195 | throw new NotImplementedException(); |
196 | } | 196 | } |
197 | #endregion | 197 | #endregion |
198 | 198 | ||
199 | public IInventoryItem this[string name] | 199 | public IInventoryItem this[string name] |
200 | { | 200 | { |
201 | get { | 201 | get { |
202 | foreach(TaskInventoryItem i in m_privateInventory.Values) | 202 | foreach (TaskInventoryItem i in m_privateInventory.Values) |
203 | if(i.Name == name) | 203 | if (i.Name == name) |
204 | { | 204 | { |
205 | if(!m_publicInventory.ContainsKey(i.ItemID)) | 205 | if (!m_publicInventory.ContainsKey(i.ItemID)) |
206 | m_publicInventory.Add(i.ItemID, new InventoryItem(m_rootScene, i)); | 206 | m_publicInventory.Add(i.ItemID, new InventoryItem(m_rootScene, i)); |
207 | 207 | ||
208 | return m_publicInventory[i.ItemID]; | 208 | return m_publicInventory[i.ItemID]; |
209 | } | 209 | } |
210 | throw new KeyNotFoundException(); | 210 | throw new KeyNotFoundException(); |
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | } | 214 | } |
215 | } | 215 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index a71d1e5..8a38f01 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -71,33 +71,33 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
71 | get { return GetSP().AbsolutePosition; } | 71 | get { return GetSP().AbsolutePosition; } |
72 | set { GetSP().TeleportWithMomentum(value); } | 72 | set { GetSP().TeleportWithMomentum(value); } |
73 | } | 73 | } |
74 | 74 | ||
75 | #region IAvatar implementation | 75 | #region IAvatar implementation |
76 | public IAvatarAttachment[] Attachments | 76 | public IAvatarAttachment[] Attachments |
77 | { | 77 | { |
78 | get { | 78 | get { |
79 | List<IAvatarAttachment> attachments = new List<IAvatarAttachment>(); | 79 | List<IAvatarAttachment> attachments = new List<IAvatarAttachment>(); |
80 | 80 | ||
81 | Hashtable internalAttachments = GetSP().Appearance.GetAttachments(); | 81 | Hashtable internalAttachments = GetSP().Appearance.GetAttachments(); |
82 | if(internalAttachments != null) | 82 | if (internalAttachments != null) |
83 | { | 83 | { |
84 | foreach(DictionaryEntry element in internalAttachments) | 84 | foreach (DictionaryEntry element in internalAttachments) |
85 | { | 85 | { |
86 | Hashtable attachInfo = (Hashtable)element.Value; | 86 | Hashtable attachInfo = (Hashtable)element.Value; |
87 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"]))); | 87 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"]))); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | return attachments.ToArray(); | 91 | return attachments.ToArray(); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | public void LoadUrl(IObject sender, string message, string url) | 95 | public void LoadUrl(IObject sender, string message, string url) |
96 | { | 96 | { |
97 | IDialogModule dm = m_rootScene.RequestModuleInterface<IDialogModule>(); | 97 | IDialogModule dm = m_rootScene.RequestModuleInterface<IDialogModule>(); |
98 | if(dm != null) | 98 | if (dm != null) |
99 | dm.SendUrlToUser(GetSP().UUID, sender.Name, sender.GlobalID, GetSP().UUID, false, message, url); | 99 | dm.SendUrlToUser(GetSP().UUID, sender.Name, sender.GlobalID, GetSP().UUID, false, message, url); |
100 | } | 100 | } |
101 | #endregion | 101 | #endregion |
102 | } | 102 | } |
103 | } | 103 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs index 4d6e4b6..971119f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs | |||
@@ -33,30 +33,30 @@ using OpenSim.Region.Framework.Scenes; | |||
33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
34 | { | 34 | { |
35 | public class SPAvatarAttachment : IAvatarAttachment | 35 | public class SPAvatarAttachment : IAvatarAttachment |
36 | { | 36 | { |
37 | private readonly Scene m_rootScene; | 37 | private readonly Scene m_rootScene; |
38 | private readonly IAvatar m_parent; | 38 | private readonly IAvatar m_parent; |
39 | private readonly int m_location; | 39 | private readonly int m_location; |
40 | private readonly UUID m_itemId; | 40 | private readonly UUID m_itemId; |
41 | private readonly UUID m_assetId; | 41 | private readonly UUID m_assetId; |
42 | 42 | ||
43 | public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId) | 43 | public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId) |
44 | { | 44 | { |
45 | m_rootScene = rootScene; | 45 | m_rootScene = rootScene; |
46 | m_parent = self; | 46 | m_parent = self; |
47 | m_location = location; | 47 | m_location = location; |
48 | m_itemId = itemId; | 48 | m_itemId = itemId; |
49 | m_assetId = assetId; | 49 | m_assetId = assetId; |
50 | } | 50 | } |
51 | 51 | ||
52 | public int Location { get { return m_location; } } | 52 | public int Location { get { return m_location; } } |
53 | 53 | ||
54 | public IObject Asset | 54 | public IObject Asset |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId); | 58 | return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } | 61 | } |
62 | } | 62 | } |