diff options
Diffstat (limited to 'OpenSim/Services/Interfaces/IAvatarService.cs')
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index de3bcf9..eaa6534 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs | |||
@@ -42,6 +42,21 @@ namespace OpenSim.Services.Interfaces | |||
42 | /// </summary> | 42 | /// </summary> |
43 | /// <param name="userID"></param> | 43 | /// <param name="userID"></param> |
44 | /// <returns></returns> | 44 | /// <returns></returns> |
45 | AvatarAppearance GetAppearance(UUID userID); | ||
46 | |||
47 | /// <summary> | ||
48 | /// Called by everyone who can change the avatar data (so, regions) | ||
49 | /// </summary> | ||
50 | /// <param name="userID"></param> | ||
51 | /// <param name="appearance"></param> | ||
52 | /// <returns></returns> | ||
53 | bool SetAppearance(UUID userID, AvatarAppearance appearance); | ||
54 | |||
55 | /// <summary> | ||
56 | /// Called by the login service | ||
57 | /// </summary> | ||
58 | /// <param name="userID"></param> | ||
59 | /// <returns></returns> | ||
45 | AvatarData GetAvatar(UUID userID); | 60 | AvatarData GetAvatar(UUID userID); |
46 | 61 | ||
47 | /// <summary> | 62 | /// <summary> |
@@ -163,17 +178,11 @@ namespace OpenSim.Services.Interfaces | |||
163 | Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString(); | 178 | Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString(); |
164 | 179 | ||
165 | // Attachments | 180 | // Attachments |
166 | Hashtable attachs = appearance.GetAttachments(); | 181 | List<AvatarAttachment> attachments = appearance.GetAttachments(); |
167 | if (attachs != null) | 182 | foreach (AvatarAttachment attach in attachments) |
168 | foreach (DictionaryEntry dentry in attachs) | 183 | { |
169 | { | 184 | Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString(); |
170 | if (dentry.Value != null) | 185 | } |
171 | { | ||
172 | Hashtable tab = (Hashtable)dentry.Value; | ||
173 | if (tab.ContainsKey("item") && tab["item"] != null) | ||
174 | Data["_ap_" + dentry.Key] = tab["item"].ToString(); | ||
175 | } | ||
176 | } | ||
177 | } | 186 | } |
178 | 187 | ||
179 | public AvatarAppearance ToAvatarAppearance(UUID owner) | 188 | public AvatarAppearance ToAvatarAppearance(UUID owner) |
@@ -217,23 +226,26 @@ namespace OpenSim.Services.Interfaces | |||
217 | foreach (KeyValuePair<string, string> _kvp in Data) | 226 | foreach (KeyValuePair<string, string> _kvp in Data) |
218 | if (_kvp.Key.StartsWith("_ap_")) | 227 | if (_kvp.Key.StartsWith("_ap_")) |
219 | attchs[_kvp.Key] = _kvp.Value; | 228 | attchs[_kvp.Key] = _kvp.Value; |
220 | Hashtable aaAttachs = new Hashtable(); | 229 | |
221 | foreach (KeyValuePair<string, string> _kvp in attchs) | 230 | foreach (KeyValuePair<string, string> _kvp in attchs) |
222 | { | 231 | { |
223 | string pointStr = _kvp.Key.Substring(4); | 232 | string pointStr = _kvp.Key.Substring(4); |
224 | int point = 0; | 233 | int point = 0; |
225 | if (!Int32.TryParse(pointStr, out point)) | 234 | if (!Int32.TryParse(pointStr, out point)) |
226 | continue; | 235 | continue; |
227 | Hashtable tmp = new Hashtable(); | 236 | |
228 | UUID uuid = UUID.Zero; | 237 | UUID uuid = UUID.Zero; |
229 | UUID.TryParse(_kvp.Value, out uuid); | 238 | UUID.TryParse(_kvp.Value, out uuid); |
230 | tmp["item"] = uuid; | 239 | |
231 | tmp["asset"] = UUID.Zero.ToString(); | 240 | appearance.SetAttachment(point,uuid,UUID.Zero); |
232 | aaAttachs[point] = tmp; | ||
233 | } | 241 | } |
234 | appearance.SetAttachments(aaAttachs); | ||
235 | } | 242 | } |
236 | catch { } | 243 | catch |
244 | { | ||
245 | // We really should report something here, returning null | ||
246 | // will at least break the wrapper | ||
247 | return null; | ||
248 | } | ||
237 | 249 | ||
238 | return appearance; | 250 | return appearance; |
239 | } | 251 | } |