aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Data/UserDataBase.cs6
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs48
4 files changed, 34 insertions, 33 deletions
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs
index 7066f58..817ac3e 100644
--- a/OpenSim/Data/UserDataBase.cs
+++ b/OpenSim/Data/UserDataBase.cs
@@ -62,19 +62,19 @@ namespace OpenSim.Data
62 public AvatarAppearance GetUserAppearance(LLUUID user) { 62 public AvatarAppearance GetUserAppearance(LLUUID user) {
63 AvatarAppearance aa; 63 AvatarAppearance aa;
64 try { 64 try {
65 m_log.Info("[APPEARANCE] Found appearance for " + user.ToString());
66 aa = aplist[user]; 65 aa = aplist[user];
66 m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString());
67 } catch (System.Collections.Generic.KeyNotFoundException e) { 67 } catch (System.Collections.Generic.KeyNotFoundException e) {
68 m_log.Info("[APPEARANCE] Setting up default appearance for " + user.ToString());
69 aplist[user] = new AvatarAppearance(); 68 aplist[user] = new AvatarAppearance();
70 aplist[user].Owner = user; 69 aplist[user].Owner = user;
71 aa = aplist[user]; 70 aa = aplist[user];
71 m_log.Info("[APPEARANCE] Setting up default appearance for " + user.ToString() + aa.ToString());
72 } 72 }
73 return aa; 73 return aa;
74 } 74 }
75 public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { 75 public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) {
76 aplist[user] = appearance; 76 aplist[user] = appearance;
77 m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString()); 77 m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString() + appearance.ToString() );
78 } 78 }
79 public abstract void AddAttachment(LLUUID user, LLUUID item); 79 public abstract void AddAttachment(LLUUID user, LLUUID item);
80 public abstract void RemoveAttachment(LLUUID user, LLUUID item); 80 public abstract void RemoveAttachment(LLUUID user, LLUUID item);
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 42cd6f9..cf9ff58 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -293,6 +293,16 @@ namespace OpenSim.Framework
293 return textu; 293 return textu;
294 } 294 }
295 295
296 public override String ToString()
297 {
298 String s = "[Wearables] =>";
299 s += "Body Item: " + BodyItem.ToString() + ";";
300 s += "Skin Item: " + SkinItem.ToString() + ";";
301 s += "Shirt Item: " + ShirtItem.ToString() + ";";
302 s += "Pants Item: " + PantsItem.ToString() + ";";
303 return s;
304 }
305
296 protected AvatarAppearance(SerializationInfo info, StreamingContext context) 306 protected AvatarAppearance(SerializationInfo info, StreamingContext context)
297 { 307 {
298 //System.Console.WriteLine("AvatarAppearance Deserialize BGN"); 308 //System.Console.WriteLine("AvatarAppearance Deserialize BGN");
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index f8f96a0..28507cd 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1509,8 +1509,8 @@ namespace OpenSim.Region.Environment.Scenes
1509 public void SetAppearance(byte[] texture, List<byte> visualParam) 1509 public void SetAppearance(byte[] texture, List<byte> visualParam)
1510 { 1510 {
1511 m_appearance.SetAppearance(texture, visualParam); 1511 m_appearance.SetAppearance(texture, visualParam);
1512 m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
1513 SetHeight(m_appearance.AvatarHeight); 1512 SetHeight(m_appearance.AvatarHeight);
1513 m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
1514 1514
1515 SendAppearanceToAllOtherAgents(); 1515 SendAppearanceToAllOtherAgents();
1516 } 1516 }
@@ -1518,6 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
1518 public void SetWearable(int wearableId, AvatarWearable wearable) 1518 public void SetWearable(int wearableId, AvatarWearable wearable)
1519 { 1519 {
1520 m_appearance.SetWearable(wearableId, wearable); 1520 m_appearance.SetWearable(wearableId, wearable);
1521 m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
1521 } 1522 }
1522 1523
1523 /// <summary> 1524 /// <summary>
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index a1abe8b..4c933d6 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -274,47 +274,37 @@ namespace OpenSim.Region.Modules.AvatarFactory
274 { 274 {
275 IClientAPI clientView = (IClientAPI)sender; 275 IClientAPI clientView = (IClientAPI)sender;
276 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); 276 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
277 AvatarAppearance avatAppearance = m_scene.CommsManager.UserService.GetUserAppearance(clientView.AgentId);
277 if (profile != null) 278 if (profile != null)
278 { 279 {
279 if (profile.RootFolder != null) 280 if (profile.RootFolder != null)
280 { 281 {
281 if (m_avatarsAppearance.ContainsKey(clientView.AgentId)) 282
283 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
282 { 284 {
283 AvatarAppearance avatAppearance = null; 285 if (wear.Type < 13)
284 lock (m_avatarsAppearance)
285 { 286 {
286 avatAppearance = m_avatarsAppearance[clientView.AgentId]; 287 if (wear.ItemID == LLUUID.Zero)
287 }
288
289 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
290 {
291 if (wear.Type < 13)
292 { 288 {
293 if (wear.ItemID == LLUUID.Zero) 289 avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero;
294 { 290 avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero;
295 avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero; 291 }
296 avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero; 292 else
297 293 {
298 UpdateDatabase(clientView.AgentId, avatAppearance); 294 LLUUID assetId;
299 } 295
300 else 296 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID);
297
298 if (baseItem != null)
301 { 299 {
302 LLUUID assetId; 300 assetId = baseItem.AssetID;
303 301 avatAppearance.Wearables[wear.Type].AssetID = assetId;
304 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); 302 avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID;
305
306 if (baseItem != null)
307 {
308 assetId = baseItem.AssetID;
309 avatAppearance.Wearables[wear.Type].AssetID = assetId;
310 avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID;
311
312 UpdateDatabase(clientView.AgentId, avatAppearance);
313 }
314 } 303 }
315 } 304 }
316 } 305 }
317 } 306 }
307 m_scene.CommsManager.UserService.UpdateUserAppearance(clientView.AgentId, avatAppearance);
318 } 308 }
319 } 309 }
320 } 310 }