diff options
author | Melanie | 2010-10-21 17:09:42 +0100 |
---|---|---|
committer | Melanie | 2010-10-21 17:09:42 +0100 |
commit | 08e14d653e826b72300215dba8816abcc6a9e6ec (patch) | |
tree | 44aadaad5d7c3bde10b1ec6452e1e507d4df047e /OpenSim/Framework/AvatarWearable.cs | |
parent | Make SImStatsReporter pick ObjectCapacity striaght out of region info (diff) | |
parent | Major refactoring of appearance handling. (diff) | |
download | opensim-SC_OLD-08e14d653e826b72300215dba8816abcc6a9e6ec.zip opensim-SC_OLD-08e14d653e826b72300215dba8816abcc6a9e6ec.tar.gz opensim-SC_OLD-08e14d653e826b72300215dba8816abcc6a9e6ec.tar.bz2 opensim-SC_OLD-08e14d653e826b72300215dba8816abcc6a9e6ec.tar.xz |
Merge branch 'dev-appearance' of git://github.com/cmickeyb/opensim into dev-appearance
Diffstat (limited to 'OpenSim/Framework/AvatarWearable.cs')
-rw-r--r-- | OpenSim/Framework/AvatarWearable.cs | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 30c5172..87098bf 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs | |||
@@ -26,14 +26,32 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Runtime.Serialization; | ||
30 | using System.Security.Permissions; | ||
31 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenMetaverse.StructuredData; | ||
32 | 31 | ||
33 | namespace OpenSim.Framework | 32 | namespace OpenSim.Framework |
34 | { | 33 | { |
35 | public class AvatarWearable | 34 | public class AvatarWearable |
36 | { | 35 | { |
36 | // these are guessed at by the list here - | ||
37 | // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll | ||
38 | // correct them over time for when were are wrong. | ||
39 | public static readonly int BODY = 0; | ||
40 | public static readonly int SKIN = 1; | ||
41 | public static readonly int HAIR = 2; | ||
42 | public static readonly int EYES = 3; | ||
43 | public static readonly int SHIRT = 4; | ||
44 | public static readonly int PANTS = 5; | ||
45 | public static readonly int SHOES = 6; | ||
46 | public static readonly int SOCKS = 7; | ||
47 | public static readonly int JACKET = 8; | ||
48 | public static readonly int GLOVES = 9; | ||
49 | public static readonly int UNDERSHIRT = 10; | ||
50 | public static readonly int UNDERPANTS = 11; | ||
51 | public static readonly int SKIRT = 12; | ||
52 | |||
53 | public static readonly int MAX_WEARABLES = 13; | ||
54 | |||
37 | public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); | 55 | public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); |
38 | public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 56 | public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); |
39 | 57 | ||
@@ -62,12 +80,32 @@ namespace OpenSim.Framework | |||
62 | ItemID = itemId; | 80 | ItemID = itemId; |
63 | } | 81 | } |
64 | 82 | ||
83 | public AvatarWearable(OSDMap args) | ||
84 | { | ||
85 | Unpack(args); | ||
86 | } | ||
87 | |||
88 | public OSDMap Pack() | ||
89 | { | ||
90 | OSDMap weardata = new OSDMap(); | ||
91 | weardata["item"] = OSD.FromUUID(ItemID); | ||
92 | weardata["asset"] = OSD.FromUUID(AssetID); | ||
93 | |||
94 | return weardata; | ||
95 | } | ||
96 | |||
97 | public void Unpack(OSDMap args) | ||
98 | { | ||
99 | ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero; | ||
100 | AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero; | ||
101 | } | ||
102 | |||
65 | public static AvatarWearable[] DefaultWearables | 103 | public static AvatarWearable[] DefaultWearables |
66 | { | 104 | { |
67 | get | 105 | get |
68 | { | 106 | { |
69 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these | 107 | AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 13 of these |
70 | for (int i = 0; i < 13; i++) | 108 | for (int i = 0; i < MAX_WEARABLES; i++) |
71 | { | 109 | { |
72 | defaultWearables[i] = new AvatarWearable(); | 110 | defaultWearables[i] = new AvatarWearable(); |
73 | } | 111 | } |