diff --git a/OpenSim/Framework/HGNetworkServersInfo.cs b/OpenSim/Framework/HGNetworkServersInfo.cs index b9bc07a917..85fbe35b3b 100644 --- a/OpenSim/Framework/HGNetworkServersInfo.cs +++ b/OpenSim/Framework/HGNetworkServersInfo.cs @@ -66,6 +66,20 @@ namespace OpenSim.Framework return ret; } + public bool IsLocalUser(UserProfileData userData) + { + if (userData != null) + { + if (userData is ForeignUserProfileData) + return IsLocalUser(((ForeignUserProfileData)userData).UserServerURI); + else + return true; + } + else + // Something fishy; ignore it + return true; + } + public static string ServerURI(string uri) { IPAddress ipaddr1 = null; diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs index 889c77eefa..928b7c8fcc 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs @@ -81,15 +81,13 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid return null; } - private bool IsHomeUser(UUID userID) + private bool IsLocalUser(UUID userID) { CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); if (uinfo != null) { - //if ((uinfo.UserProfile.UserAssetURI == null) || (uinfo.UserProfile.UserAssetURI == "") || - // uinfo.UserProfile.UserAssetURI.Equals(m_scene.CommsManager.NetworkServersInfo.AssetURL)) - if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile.UserAssetURI)) + if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile)) { m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); return true; @@ -285,7 +283,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid public void Get(UUID itemID, UUID ownerID) { - if (!IsInAssetMap(itemID) && !IsHomeUser(ownerID)) + if (!IsInAssetMap(itemID) && !IsLocalUser(ownerID)) { // Get the item from the remote asset server onto the local AssetCache // and place an entry in m_assetMap @@ -328,7 +326,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid public void Post(UUID itemID, UUID ownerID) { - if (!IsHomeUser(ownerID)) + if (!IsLocalUser(ownerID)) { // Post the item from the local AssetCache ontp the remote asset server // and place an entry in m_assetMap diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index 9eb331a07c..9dd2426b61 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); if (uinfo != null) { - isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile.UserAssetURI); + isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); realHandle = m_hg.FindRegionHandle(regionHandle); Console.WriteLine("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); }