From b1c8d0588829dfa76f89460eeb8406d9c4fc479f Mon Sep 17 00:00:00 2001
From: Master ScienceSim
Date: Wed, 20 Oct 2010 16:17:54 -0700
Subject: 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.
---
OpenSim/Services/Interfaces/IAvatarService.cs | 32 +++++++++++++++++++++------
1 file changed, 25 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Services/Interfaces')
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
///
///
///
+ AvatarAppearance GetAppearance(UUID userID);
+
+ ///
+ /// Called by everyone who can change the avatar data (so, regions)
+ ///
+ ///
+ ///
+ ///
+ bool SetAppearance(UUID userID, AvatarAppearance appearance);
+
+ ///
+ /// Called by the login service
+ ///
+ ///
+ ///
AvatarData GetAvatar(UUID userID);
///
@@ -217,23 +232,26 @@ namespace OpenSim.Services.Interfaces
foreach (KeyValuePair _kvp in Data)
if (_kvp.Key.StartsWith("_ap_"))
attchs[_kvp.Key] = _kvp.Value;
- Hashtable aaAttachs = new Hashtable();
+
foreach (KeyValuePair _kvp in attchs)
{
string pointStr = _kvp.Key.Substring(4);
int point = 0;
if (!Int32.TryParse(pointStr, out point))
continue;
- Hashtable tmp = new Hashtable();
+
UUID uuid = UUID.Zero;
UUID.TryParse(_kvp.Value, out uuid);
- tmp["item"] = uuid;
- tmp["asset"] = UUID.Zero.ToString();
- aaAttachs[point] = tmp;
+
+ appearance.SetAttachment(point,uuid,UUID.Zero);
}
- appearance.SetAttachments(aaAttachs);
}
- catch { }
+ catch
+ {
+ // We really should report something here, returning null
+ // will at least break the wrapper
+ return null;
+ }
return appearance;
}
--
cgit v1.1
From 267f18925d06ca05e2a5ffbfbb63582783762439 Mon Sep 17 00:00:00 2001
From: Master ScienceSim
Date: Thu, 21 Oct 2010 16:48:58 -0700
Subject: First attempt to get multiple attachments working to support viewer2.
The attachment code appears to work correctly for 1.23 viewers so, in spite
of some big changes in the internal representation, there don't appear to be
regressions. That being said, I still can't get a viewer2 avatar to show
correctly.
---
OpenSim/Services/Interfaces/IAvatarService.cs | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Services/Interfaces')
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 93b977b..eaa6534 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -178,17 +178,11 @@ namespace OpenSim.Services.Interfaces
Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString();
// Attachments
- Hashtable attachs = appearance.GetAttachments();
- if (attachs != null)
- foreach (DictionaryEntry dentry in attachs)
- {
- if (dentry.Value != null)
- {
- Hashtable tab = (Hashtable)dentry.Value;
- if (tab.ContainsKey("item") && tab["item"] != null)
- Data["_ap_" + dentry.Key] = tab["item"].ToString();
- }
- }
+ List attachments = appearance.GetAttachments();
+ foreach (AvatarAttachment attach in attachments)
+ {
+ Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString();
+ }
}
public AvatarAppearance ToAvatarAppearance(UUID owner)
--
cgit v1.1