a few changes on ServiceURLs. Add some extra checks on AssetServiceURI
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user