aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs
diff options
context:
space:
mode:
authorMaster ScienceSim2010-10-20 16:17:54 -0700
committerMaster ScienceSim2010-10-20 16:17:54 -0700
commitb1c8d0588829dfa76f89460eeb8406d9c4fc479f (patch)
tree463cbb0bf2eab5c7e7f98ebdc0dc7113dea56688 /OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs
parentMerge branch 'master' of /var/git/opensim/ (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Framework/AvatarAttachment.cs (renamed from OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs)50
1 files changed, 45 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs b/OpenSim/Framework/AvatarAttachment.cs
index c967f30..c68d78d 100644
--- a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Framework/AvatarAttachment.cs
@@ -25,14 +25,54 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using OpenMetaverse; 29using OpenMetaverse;
29using OpenSim.Framework; 30using OpenMetaverse.StructuredData;
30 31
31namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Framework
32{ 33{
33 public interface IAvatarFactory 34 public class AvatarAttachment
34 { 35 {
35 bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance); 36 public int AttachPoint;
36 void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance); 37 public UUID ItemID;
38 public UUID AssetID;
39
40 public AvatarAttachment(AvatarAttachment attach)
41 {
42 AttachPoint = attach.AttachPoint;
43 ItemID = attach.ItemID;
44 AssetID = attach.AssetID;
45 }
46
47 public AvatarAttachment(int point, UUID item, UUID asset)
48 {
49 AttachPoint = point;
50 ItemID = item;
51 AssetID = asset;
52 }
53
54 public AvatarAttachment(OSDMap args)
55 {
56 Unpack(args);
57 }
58
59 public OSDMap Pack()
60 {
61 OSDMap attachdata = new OSDMap();
62 attachdata["point"] = OSD.FromInteger(AttachPoint);
63 attachdata["item"] = OSD.FromUUID(ItemID);
64 attachdata["asset"] = OSD.FromUUID(AssetID);
65
66 return attachdata;
67 }
68
69
70 public void Unpack(OSDMap args)
71 {
72 if (args["point"] != null)
73 AttachPoint = args["point"].AsInteger();
74 ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero;
75 AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero;
76 }
37 } 77 }
38} 78}