a few changes on ServiceURLs. Add some extra checks on AssetServiceURI

This commit is contained in:
UbitUmarov
2025-11-29 22:49:07 +00:00
parent 257d4dbe0a
commit 139f51e01b
3 changed files with 23 additions and 7 deletions

View File

@@ -372,7 +372,7 @@ namespace OpenSim.Framework
OSDMap urls = (OSDMap)tmpOSD;
foreach (KeyValuePair<String, OSD> kvp in urls)
{
ServiceURLs[kvp.Key] = kvp.Value;
ServiceURLs[kvp.Key] = kvp.Value.AsString();
//System.Console.WriteLine("XXX " + kvp.Key + "=" + ServiceURLs[kvp.Key]);
}
}

View File

@@ -195,11 +195,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
// The act of gathering UUIDs downloads some assets from the remote server
// but not all...
HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL);
if(string.IsNullOrEmpty(userAssetURL))
{
m_log.Debug($"[HG ASSET MAPPER]: Problems getting item asset {assetID}. Asset server unknown");
return;
}
HGUuidGatherer uuidGatherer = new(m_scene.AssetService, userAssetURL);
uuidGatherer.AddForInspection(assetID);
uuidGatherer.GatherAll();
m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", uuidGatherer.GatheredUuids.Count);
m_log.Debug($"[HG ASSET MAPPER]: Preparing to get {uuidGatherer.GatheredUuids.Count} assets");
bool success = true;
foreach (UUID uuid in uuidGatherer.GatheredUuids.Keys)
{
@@ -211,9 +217,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// maybe all pieces got here...
if (!success)
m_log.DebugFormat("[HG ASSET MAPPER]: Problems getting item {0} from asset server {1}", assetID, userAssetURL);
m_log.Debug($"[HG ASSET MAPPER]: Problems getting item asset {assetID} from asset server {userAssetURL}");
else
m_log.DebugFormat("[HG ASSET MAPPER]: Successfully got item {0} from asset server {1}", assetID, userAssetURL);
m_log.Debug($"[HG ASSET MAPPER]: Successfully got item asset {assetID} from asset server {userAssetURL}");
}
public void Post(UUID assetID, UUID ownerID, string userAssetURL)
@@ -234,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// Check which assets already exist in the destination server
string url = userAssetURL;
if (!url.EndsWith("/") && !url.EndsWith("="))
if (!url.EndsWith('/') && !url.EndsWith('='))
url = url + "/";
string[] remoteAssetIDs = new string[uuidGatherer.GatheredUuids.Count];

View File

@@ -405,6 +405,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
assetServerURL = UserManagementModule.GetUserServerURL(userID, "AssetServerURI");
assetServerURL = assetServerURL.Trim('/');
}
if(assetServerURL.Length == 0)
{
m_log.Debug($"[HGScene]: user {userID} asset server returned empty url");
return false;
}
return true;
}
}
@@ -417,7 +422,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
else
{
m_log.DebugFormat("[HGScene]: user {0} has foreign assets {1}", userID, assetServerURL);
if(assetServerURL.Length == 0)
{
m_log.Debug($"[HGScene]: user {userID} asset server returned empty url");
return false;
}
m_log.Debug($"[HGScene]: user {userID} has foreign assets {assetServerURL}");
return true;
}
}