Mantis#2692: Thanks Diva, for a patch that fixes a bug in HyperGrid.

0.6.1-post-fixes
Homer Horwitz 2008-11-25 19:08:52 +00:00
parent b0e55577ff
commit 4acddb6797
3 changed files with 19 additions and 7 deletions

View File

@ -66,6 +66,20 @@ namespace OpenSim.Framework
return ret; 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) public static string ServerURI(string uri)
{ {
IPAddress ipaddr1 = null; IPAddress ipaddr1 = null;

View File

@ -81,15 +81,13 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
return null; return null;
} }
private bool IsHomeUser(UUID userID) private bool IsLocalUser(UUID userID)
{ {
CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
if (uinfo != null) if (uinfo != null)
{ {
//if ((uinfo.UserProfile.UserAssetURI == null) || (uinfo.UserProfile.UserAssetURI == "") || if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile))
// uinfo.UserProfile.UserAssetURI.Equals(m_scene.CommsManager.NetworkServersInfo.AssetURL))
if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile.UserAssetURI))
{ {
m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
return true; return true;
@ -285,7 +283,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
public void Get(UUID itemID, UUID ownerID) 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 // Get the item from the remote asset server onto the local AssetCache
// and place an entry in m_assetMap // and place an entry in m_assetMap
@ -328,7 +326,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
public void Post(UUID itemID, UUID ownerID) 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 // Post the item from the local AssetCache ontp the remote asset server
// and place an entry in m_assetMap // and place an entry in m_assetMap

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID);
if (uinfo != null) if (uinfo != null)
{ {
isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile.UserAssetURI); isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile);
realHandle = m_hg.FindRegionHandle(regionHandle); realHandle = m_hg.FindRegionHandle(regionHandle);
Console.WriteLine("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); Console.WriteLine("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
} }