diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/AvatarService/AvatarService.cs | 11 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 117 |
2 files changed, 72 insertions, 56 deletions
diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index a8ad413..53ca7c8 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs | |||
@@ -51,8 +51,6 @@ namespace OpenSim.Services.AvatarService | |||
51 | m_log.Debug("[AVATAR SERVICE]: Starting avatar service"); | 51 | m_log.Debug("[AVATAR SERVICE]: Starting avatar service"); |
52 | } | 52 | } |
53 | 53 | ||
54 | // Get|SetAppearance should preserve existing semantics | ||
55 | // until AvatarData can be removed completely | ||
56 | public AvatarAppearance GetAppearance(UUID principalID) | 54 | public AvatarAppearance GetAppearance(UUID principalID) |
57 | { | 55 | { |
58 | AvatarData avatar = GetAvatar(principalID); | 56 | AvatarData avatar = GetAvatar(principalID); |
@@ -68,12 +66,15 @@ namespace OpenSim.Services.AvatarService | |||
68 | public AvatarData GetAvatar(UUID principalID) | 66 | public AvatarData GetAvatar(UUID principalID) |
69 | { | 67 | { |
70 | AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString()); | 68 | AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString()); |
71 | if (av.Length == 0) | ||
72 | return null; | ||
73 | |||
74 | AvatarData ret = new AvatarData(); | 69 | AvatarData ret = new AvatarData(); |
75 | ret.Data = new Dictionary<string,string>(); | 70 | ret.Data = new Dictionary<string,string>(); |
76 | 71 | ||
72 | if (av.Length == 0) | ||
73 | { | ||
74 | ret.AvatarType = 1; // SL avatar | ||
75 | return ret; | ||
76 | } | ||
77 | |||
77 | foreach (AvatarBaseData b in av) | 78 | foreach (AvatarBaseData b in av) |
78 | { | 79 | { |
79 | if (b.Data["Name"] == "AvatarType") | 80 | if (b.Data["Name"] == "AvatarType") |
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index a029fbc..186871a 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs | |||
@@ -190,60 +190,75 @@ namespace OpenSim.Services.Interfaces | |||
190 | AvatarAppearance appearance = new AvatarAppearance(owner); | 190 | AvatarAppearance appearance = new AvatarAppearance(owner); |
191 | try | 191 | try |
192 | { | 192 | { |
193 | appearance.Serial = Int32.Parse(Data["Serial"]); | 193 | if (Data.ContainsKey("Serial")) |
194 | appearance.Serial = Int32.Parse(Data["Serial"]); | ||
194 | 195 | ||
195 | // Wearables | 196 | // Wearables |
196 | appearance.Wearables[AvatarWearable.BODY].Wear( | 197 | if (Data.ContainsKey("BodyItem")) |
197 | UUID.Parse(Data["BodyItem"]), | 198 | appearance.Wearables[AvatarWearable.BODY].Wear( |
198 | UUID.Parse(Data["BodyAsset"])); | 199 | UUID.Parse(Data["BodyItem"]), |
200 | UUID.Parse(Data["BodyAsset"])); | ||
201 | |||
202 | if (Data.ContainsKey("SkinItem")) | ||
203 | appearance.Wearables[AvatarWearable.SKIN].Wear( | ||
204 | UUID.Parse(Data["SkinItem"]), | ||
205 | UUID.Parse(Data["SkinAsset"])); | ||
206 | |||
207 | if (Data.ContainsKey("HairItem")) | ||
208 | appearance.Wearables[AvatarWearable.HAIR].Wear( | ||
209 | UUID.Parse(Data["HairItem"]), | ||
210 | UUID.Parse(Data["HairAsset"])); | ||
211 | |||
212 | if (Data.ContainsKey("EyesItem")) | ||
213 | appearance.Wearables[AvatarWearable.EYES].Wear( | ||
214 | UUID.Parse(Data["EyesItem"]), | ||
215 | UUID.Parse(Data["EyesAsset"])); | ||
216 | |||
217 | if (Data.ContainsKey("ShirtItem")) | ||
218 | appearance.Wearables[AvatarWearable.SHIRT].Wear( | ||
219 | UUID.Parse(Data["ShirtItem"]), | ||
220 | UUID.Parse(Data["ShirtAsset"])); | ||
221 | |||
222 | if (Data.ContainsKey("PantsItem")) | ||
223 | appearance.Wearables[AvatarWearable.PANTS].Wear( | ||
224 | UUID.Parse(Data["PantsItem"]), | ||
225 | UUID.Parse(Data["PantsAsset"])); | ||
226 | |||
227 | if (Data.ContainsKey("ShoesItem")) | ||
228 | appearance.Wearables[AvatarWearable.SHOES].Wear( | ||
229 | UUID.Parse(Data["ShoesItem"]), | ||
230 | UUID.Parse(Data["ShoesAsset"])); | ||
231 | |||
232 | if (Data.ContainsKey("SocksItem")) | ||
233 | appearance.Wearables[AvatarWearable.SOCKS].Wear( | ||
234 | UUID.Parse(Data["SocksItem"]), | ||
235 | UUID.Parse(Data["SocksAsset"])); | ||
236 | |||
237 | if (Data.ContainsKey("JacketItem")) | ||
238 | appearance.Wearables[AvatarWearable.JACKET].Wear( | ||
239 | UUID.Parse(Data["JacketItem"]), | ||
240 | UUID.Parse(Data["JacketAsset"])); | ||
241 | |||
242 | if (Data.ContainsKey("GlovesItem")) | ||
243 | appearance.Wearables[AvatarWearable.GLOVES].Wear( | ||
244 | UUID.Parse(Data["GlovesItem"]), | ||
245 | UUID.Parse(Data["GlovesAsset"])); | ||
246 | |||
247 | if (Data.ContainsKey("UnderShirtItem")) | ||
248 | appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( | ||
249 | UUID.Parse(Data["UnderShirtItem"]), | ||
250 | UUID.Parse(Data["UnderShirtAsset"])); | ||
251 | |||
252 | if (Data.ContainsKey("UnderPantsItem")) | ||
253 | appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( | ||
254 | UUID.Parse(Data["UnderPantsItem"]), | ||
255 | UUID.Parse(Data["UnderPantsAsset"])); | ||
256 | |||
257 | if (Data.ContainsKey("SkirtItem")) | ||
258 | appearance.Wearables[AvatarWearable.SKIRT].Wear( | ||
259 | UUID.Parse(Data["SkirtItem"]), | ||
260 | UUID.Parse(Data["SkirtAsset"])); | ||
199 | 261 | ||
200 | appearance.Wearables[AvatarWearable.SKIN].Wear( | ||
201 | UUID.Parse(Data["SkinItem"]), | ||
202 | UUID.Parse(Data["SkinAsset"])); | ||
203 | |||
204 | appearance.Wearables[AvatarWearable.HAIR].Wear( | ||
205 | UUID.Parse(Data["HairItem"]), | ||
206 | UUID.Parse(Data["HairAsset"])); | ||
207 | |||
208 | appearance.Wearables[AvatarWearable.EYES].Wear( | ||
209 | UUID.Parse(Data["EyesItem"]), | ||
210 | UUID.Parse(Data["EyesAsset"])); | ||
211 | |||
212 | appearance.Wearables[AvatarWearable.SHIRT].Wear( | ||
213 | UUID.Parse(Data["ShirtItem"]), | ||
214 | UUID.Parse(Data["ShirtAsset"])); | ||
215 | |||
216 | appearance.Wearables[AvatarWearable.PANTS].Wear( | ||
217 | UUID.Parse(Data["PantsItem"]), | ||
218 | UUID.Parse(Data["PantsAsset"])); | ||
219 | |||
220 | appearance.Wearables[AvatarWearable.SHOES].Wear( | ||
221 | UUID.Parse(Data["ShoesItem"]), | ||
222 | UUID.Parse(Data["ShoesAsset"])); | ||
223 | |||
224 | appearance.Wearables[AvatarWearable.SOCKS].Wear( | ||
225 | UUID.Parse(Data["SocksItem"]), | ||
226 | UUID.Parse(Data["SocksAsset"])); | ||
227 | |||
228 | appearance.Wearables[AvatarWearable.JACKET].Wear( | ||
229 | UUID.Parse(Data["JacketItem"]), | ||
230 | UUID.Parse(Data["JacketAsset"])); | ||
231 | |||
232 | appearance.Wearables[AvatarWearable.GLOVES].Wear( | ||
233 | UUID.Parse(Data["GlovesItem"]), | ||
234 | UUID.Parse(Data["GlovesAsset"])); | ||
235 | |||
236 | appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( | ||
237 | UUID.Parse(Data["UnderShirtItem"]), | ||
238 | UUID.Parse(Data["UnderShirtAsset"])); | ||
239 | |||
240 | appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( | ||
241 | UUID.Parse(Data["UnderPantsItem"]), | ||
242 | UUID.Parse(Data["UnderPantsAsset"])); | ||
243 | |||
244 | appearance.Wearables[AvatarWearable.SKIRT].Wear( | ||
245 | UUID.Parse(Data["SkirtItem"]), | ||
246 | UUID.Parse(Data["SkirtAsset"])); | ||
247 | 262 | ||
248 | // Attachments | 263 | // Attachments |
249 | Dictionary<string, string> attchs = new Dictionary<string, string>(); | 264 | Dictionary<string, string> attchs = new Dictionary<string, string>(); |