Some refactoring

afrisby
MW 2007-12-03 10:36:32 +00:00
parent 9f5e1efc2d
commit 285fa3fe9e
1 changed files with 9 additions and 7 deletions

View File

@ -74,6 +74,9 @@ namespace OpenSim.Region.Environment.Modules
public void AvatarIsWearing(Object sender, AvatarWearingArgs e) public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
{ {
IClientAPI clientView = (IClientAPI)sender; IClientAPI clientView = (IClientAPI)sender;
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
if (profile != null)
{
//Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs
// then store assetid and itemId and wearable type in a database // then store assetid and itemId and wearable type in a database
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
@ -81,9 +84,7 @@ namespace OpenSim.Region.Environment.Modules
if (wear.Type < 13) if (wear.Type < 13)
{ {
LLUUID assetId; LLUUID assetId;
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
if (profile != null)
{
InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID);
if (baseItem != null) if (baseItem != null)
{ {
@ -96,6 +97,7 @@ namespace OpenSim.Region.Environment.Modules
avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; avWearing.IsWearing[wear.Type].ItemID = wear.ItemID;
} }
} }
} }
} }
} }