mirror of
https://github.com/opensim/opensim.git
synced 2026-06-20 20:47:33 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
effb5784c1 | ||
|
|
7130e30483 |
@@ -253,7 +253,7 @@ namespace OpenSim.Data.MySQL
|
||||
public override bool[] AssetsExist(UUID[] uuids)
|
||||
{
|
||||
if (uuids.Length == 0)
|
||||
return new bool[0];
|
||||
return [];
|
||||
|
||||
HashSet<UUID> exist = new HashSet<UUID>();
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ namespace OpenSim.Data.MySQL
|
||||
public bool[] AssetsExist(UUID[] uuids)
|
||||
{
|
||||
if (uuids.Length == 0)
|
||||
return new bool[0];
|
||||
return [];
|
||||
|
||||
HashSet<UUID> exists = new HashSet<UUID>();
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace OpenSim.Data.PGSQL
|
||||
public override bool[] AssetsExist(UUID[] uuids)
|
||||
{
|
||||
if (uuids.Length == 0)
|
||||
return new bool[0];
|
||||
return [];
|
||||
|
||||
HashSet<UUID> exist = new HashSet<UUID>();
|
||||
|
||||
|
||||
@@ -147,7 +147,8 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
|
||||
if (AssetsExist(new[] { asset.FullID })[0])
|
||||
bool[] assetsExist = AssetsExist([ asset.FullID ]);
|
||||
if (assetsExist.Length > 0 && assetsExist[0])
|
||||
{
|
||||
//LogAssetLoad(asset);
|
||||
|
||||
@@ -218,7 +219,7 @@ namespace OpenSim.Data.SQLite
|
||||
public override bool[] AssetsExist(UUID[] uuids)
|
||||
{
|
||||
if (uuids.Length == 0)
|
||||
return new bool[0];
|
||||
return [];
|
||||
|
||||
HashSet<UUID> exist = new HashSet<UUID>();
|
||||
|
||||
|
||||
@@ -314,8 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
public string Store(AssetBase asset)
|
||||
{
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
m_Cache?.Cache(asset);
|
||||
|
||||
if (asset.Local)
|
||||
{
|
||||
|
||||
@@ -512,7 +512,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
return m_localConnector.AssetsExist(ids);
|
||||
else if (m_HGConnector != null)
|
||||
return m_HGConnector.AssetsExist(ids);
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
|
||||
public string Store(AssetBase asset)
|
||||
@@ -524,12 +524,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
return null;
|
||||
|
||||
id = StoreForeign(asset);
|
||||
if (m_Cache != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(id) && !id.Equals(UUID.ZeroString))
|
||||
m_Cache.Cache(asset);
|
||||
if (!string.IsNullOrEmpty(id) && !id.Equals(UUID.ZeroString))
|
||||
{
|
||||
m_Cache?.Cache(asset);
|
||||
return id;
|
||||
}
|
||||
return id;
|
||||
else
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
if (m_Cache != null)
|
||||
@@ -541,10 +542,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
id = StoreLocal(asset);
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return string.Empty;
|
||||
|
||||
return id;
|
||||
return string.IsNullOrEmpty(id) || id.Equals(UUID.ZeroString) ? string.Empty : id;
|
||||
}
|
||||
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
@@ -451,7 +451,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||
assetStrings[k], existChecks[k] ? "yes" : "no");
|
||||
|
||||
sb.Append(cdt.ToString());
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -168,15 +168,13 @@ namespace OpenSim.Services.AssetService
|
||||
|
||||
public virtual string Store(AssetBase asset)
|
||||
{
|
||||
bool exists = m_Database.AssetsExist(new[] { asset.FullID })[0];
|
||||
if (!exists)
|
||||
bool[] assetsexist = m_Database.AssetsExist([ asset.FullID ] );
|
||||
if (assetsexist.Length == 0 || !assetsexist[0])
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
|
||||
if (!m_Database.StoreAsset(asset))
|
||||
{
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
// else
|
||||
// {
|
||||
|
||||
@@ -187,9 +187,8 @@ namespace OpenSim.Services.AssetService
|
||||
|
||||
public virtual string Store(AssetBase asset)
|
||||
{
|
||||
bool exists = m_Database.AssetsExist(new[] { asset.FullID })[0];
|
||||
if (!exists)
|
||||
{
|
||||
bool[] assetsexist = m_Database.AssetsExist([ asset.FullID ] );
|
||||
if (assetsexist.Length == 0 || !assetsexist[0]) {
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
|
||||
m_Database.StoreAsset(asset);
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace OpenSim.Services.Connectors
|
||||
string newID;
|
||||
try
|
||||
{
|
||||
newID = SynchronousRestObjectRequester.MakeRequest<AssetBase, string>("POST", uri, asset, 10000, m_Auth);
|
||||
newID = SynchronousRestObjectRequester.MakeRequest<AssetBase, string>("POST", uri, asset, 30000, m_Auth);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user