From 1c220e173c37d835542983898dc01b004112b4a9 Mon Sep 17 00:00:00 2001 From: Rob Smart Date: Fri, 9 Oct 2009 16:13:55 +0100 Subject: Adding a hair item to the default wearables, fixes newly created avatars appearing as a cloud --- OpenSim/Framework/AvatarAppearance.cs | 4 ++++ OpenSim/Framework/AvatarWearable.cs | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 3f4214e..56fcc15 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -66,6 +66,8 @@ namespace OpenSim.Framework private static UUID SHIRT_ITEM = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); private static UUID PANTS_ASSET = new UUID("00000000-38f9-1111-024e-222222111120"); private static UUID PANTS_ITEM = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); + private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); + private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); public readonly static int VISUALPARAM_COUNT = 218; @@ -238,6 +240,8 @@ namespace OpenSim.Framework m_wearables[BODY].ItemID = BODY_ITEM; m_wearables[SKIN].AssetID = SKIN_ASSET; m_wearables[SKIN].ItemID = SKIN_ITEM; + m_wearables[HAIR].AssetID = HAIR_ASSET; + m_wearables[HAIR].ItemID = HAIR_ITEM; m_wearables[SHIRT].AssetID = SHIRT_ASSET; m_wearables[SHIRT].ItemID = SHIRT_ITEM; m_wearables[PANTS].AssetID = PANTS_ASSET; diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 4a5253c..87d9e61 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -60,6 +60,10 @@ namespace OpenSim.Framework // Body defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + + // Hair + defaultWearables[2].ItemID = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); + defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); // Skin defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); -- cgit v1.1 From c146f2c8c4eb60d063196972d5c0dd2ec550b27e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 9 Oct 2009 13:49:55 -0700 Subject: Use the cache, Luke! --- .../Communications/CommunicationsManager.cs | 33 ++++++---------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2410f31..9c02842 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -210,34 +210,17 @@ namespace OpenSim.Framework.Communications private string[] doUUIDNameRequest(UUID uuid) { string[] returnstring = new string[0]; - bool doLookup = false; + CachedUserInfo uinfo = UserProfileCacheService.GetUserDetails(uuid); - lock (m_nameRequestCache) + if ((uinfo != null) && (uinfo.UserProfile != null)) { - if (m_nameRequestCache.ContainsKey(uuid)) - { - returnstring = m_nameRequestCache[uuid]; - } - else - { - // we don't want to lock the dictionary while we're doing the lookup - doLookup = true; - } - } - - if (doLookup) { - UserProfileData profileData = m_userService.GetUserProfile(uuid); - if (profileData != null) + returnstring = new string[2]; + returnstring[0] = uinfo.UserProfile.FirstName; + returnstring[1] = uinfo.UserProfile.SurName; + lock (m_nameRequestCache) { - returnstring = new string[2]; - // UUID profileId = profileData.ID; - returnstring[0] = profileData.FirstName; - returnstring[1] = profileData.SurName; - lock (m_nameRequestCache) - { - if (!m_nameRequestCache.ContainsKey(uuid)) - m_nameRequestCache.Add(uuid, returnstring); - } + if (!m_nameRequestCache.ContainsKey(uuid)) + m_nameRequestCache.Add(uuid, returnstring); } } -- cgit v1.1 From f29bd8036dac4e3129b937cceda9606d496a20b7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 9 Oct 2009 14:36:08 -0700 Subject: A slight improvement on name fetching -- using the local name cache, since it exists. --- OpenSim/Framework/Communications/CommunicationsManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 9c02842..4bf9018 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -209,6 +209,12 @@ namespace OpenSim.Framework.Communications private string[] doUUIDNameRequest(UUID uuid) { + lock (m_nameRequestCache) + { + if (m_nameRequestCache.ContainsKey(uuid)) + return m_nameRequestCache[uuid]; + } + string[] returnstring = new string[0]; CachedUserInfo uinfo = UserProfileCacheService.GetUserDetails(uuid); -- cgit v1.1