From fc773649720c062a72d1b8a098eb54bda9a84ca9 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 16 May 2008 00:04:46 +0000 Subject: appearance now survives logout. Tommorrow will involve moving the MSSQL and MYSQL mappers back in under datastores and looking at doing gid bits for this --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 3 +- .../Modules/AvatarFactory/AvatarFactoryModule.cs | 48 +++++++++------------- 2 files changed, 21 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region') 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 public void SetAppearance(byte[] texture, List visualParam) { m_appearance.SetAppearance(texture, visualParam); - m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); SetHeight(m_appearance.AvatarHeight); + m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); SendAppearanceToAllOtherAgents(); } @@ -1518,6 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes public void SetWearable(int wearableId, AvatarWearable wearable) { m_appearance.SetWearable(wearableId, wearable); + m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); } /// 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 { IClientAPI clientView = (IClientAPI)sender; CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); + AvatarAppearance avatAppearance = m_scene.CommsManager.UserService.GetUserAppearance(clientView.AgentId); if (profile != null) { if (profile.RootFolder != null) { - if (m_avatarsAppearance.ContainsKey(clientView.AgentId)) + + foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { - AvatarAppearance avatAppearance = null; - lock (m_avatarsAppearance) + if (wear.Type < 13) { - avatAppearance = m_avatarsAppearance[clientView.AgentId]; - } - - foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) - { - if (wear.Type < 13) + if (wear.ItemID == LLUUID.Zero) { - if (wear.ItemID == LLUUID.Zero) - { - avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero; - avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero; - - UpdateDatabase(clientView.AgentId, avatAppearance); - } - else + avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero; + avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero; + } + else + { + LLUUID assetId; + + InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); + + if (baseItem != null) { - LLUUID assetId; - - InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); - - if (baseItem != null) - { - assetId = baseItem.AssetID; - avatAppearance.Wearables[wear.Type].AssetID = assetId; - avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; - - UpdateDatabase(clientView.AgentId, avatAppearance); - } + assetId = baseItem.AssetID; + avatAppearance.Wearables[wear.Type].AssetID = assetId; + avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; } } } } + m_scene.CommsManager.UserService.UpdateUserAppearance(clientView.AgentId, avatAppearance); } } } -- cgit v1.1