diff options
author | Master ScienceSim | 2010-10-20 16:17:54 -0700 |
---|---|---|
committer | Master ScienceSim | 2010-10-20 16:17:54 -0700 |
commit | b1c8d0588829dfa76f89460eeb8406d9c4fc479f (patch) | |
tree | 463cbb0bf2eab5c7e7f98ebdc0dc7113dea56688 /OpenSim/Services/Interfaces/IAvatarService.cs | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
download | opensim-SC-b1c8d0588829dfa76f89460eeb8406d9c4fc479f.zip opensim-SC-b1c8d0588829dfa76f89460eeb8406d9c4fc479f.tar.gz opensim-SC-b1c8d0588829dfa76f89460eeb8406d9c4fc479f.tar.bz2 opensim-SC-b1c8d0588829dfa76f89460eeb8406d9c4fc479f.tar.xz |
Major refactoring of appearance handling.
AvatarService -- add two new methods, GetAppearance and SetAppearance
to get around the lossy encoding in AvatarData. Preseve the old
functions to avoid changing the behavior for ROBUST services.
AvatarAppearance -- major refactor, moved the various encoding
methods used by AgentCircuitData, ClientAgentUpdate and
ScenePresence into one location. Changed initialization.
AvatarAttachments -- added a class specifically to handle
attachments in preparation for additional functionality
that will be needed for viewer 2.
AvatarFactory -- removed a number of unused or methods duplicated
in other locations. Moved in all appearance event handling from
ScenePresence. Required a change to IClientAPI that propogated
throughout all the IClientAPI implementations.
Diffstat (limited to 'OpenSim/Services/Interfaces/IAvatarService.cs')
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index de3bcf9..93b977b 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> |
@@ -217,23 +232,26 @@ namespace OpenSim.Services.Interfaces | |||
217 | foreach (KeyValuePair<string, string> _kvp in Data) | 232 | foreach (KeyValuePair<string, string> _kvp in Data) |
218 | if (_kvp.Key.StartsWith("_ap_")) | 233 | if (_kvp.Key.StartsWith("_ap_")) |
219 | attchs[_kvp.Key] = _kvp.Value; | 234 | attchs[_kvp.Key] = _kvp.Value; |
220 | Hashtable aaAttachs = new Hashtable(); | 235 | |
221 | foreach (KeyValuePair<string, string> _kvp in attchs) | 236 | foreach (KeyValuePair<string, string> _kvp in attchs) |
222 | { | 237 | { |
223 | string pointStr = _kvp.Key.Substring(4); | 238 | string pointStr = _kvp.Key.Substring(4); |
224 | int point = 0; | 239 | int point = 0; |
225 | if (!Int32.TryParse(pointStr, out point)) | 240 | if (!Int32.TryParse(pointStr, out point)) |
226 | continue; | 241 | continue; |
227 | Hashtable tmp = new Hashtable(); | 242 | |
228 | UUID uuid = UUID.Zero; | 243 | UUID uuid = UUID.Zero; |
229 | UUID.TryParse(_kvp.Value, out uuid); | 244 | UUID.TryParse(_kvp.Value, out uuid); |
230 | tmp["item"] = uuid; | 245 | |
231 | tmp["asset"] = UUID.Zero.ToString(); | 246 | appearance.SetAttachment(point,uuid,UUID.Zero); |
232 | aaAttachs[point] = tmp; | ||
233 | } | 247 | } |
234 | appearance.SetAttachments(aaAttachs); | ||
235 | } | 248 | } |
236 | catch { } | 249 | catch |
250 | { | ||
251 | // We really should report something here, returning null | ||
252 | // will at least break the wrapper | ||
253 | return null; | ||
254 | } | ||
237 | 255 | ||
238 | return appearance; | 256 | return appearance; |
239 | } | 257 | } |