Fix bug in persisting saved appearances for npcs

Assets have to be marked non-local as well as non-temporary to persist.  This is now done.
Hopefully addresses http://opensimulator.org/mantis/view.php?id=5660
This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-30 01:58:32 +01:00
parent 18037d41c4
commit be357f8fee
8 changed files with 168 additions and 24 deletions

View File

@@ -129,15 +129,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
m_Cache = null;
}
m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName);
m_log.DebugFormat(
"[LOCAL ASSET SERVICES CONNECTOR]: Enabled connector for region {0}", scene.RegionInfo.RegionName);
if (m_Cache != null)
{
m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName);
m_log.DebugFormat(
"[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}",
scene.RegionInfo.RegionName);
}
else
{
// Short-circuit directly to storage layer
// Short-circuit directly to storage layer. This ends up storing temporary and local assets.
//
scene.UnregisterModuleInterface<IAssetService>(this);
scene.RegisterModuleInterface<IAssetService>(m_AssetService);
@@ -246,9 +249,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
m_Cache.Cache(asset);
if (asset.Temporary || asset.Local)
{
// m_log.DebugFormat(
// "[LOCAL ASSET SERVICE CONNECTOR]: Returning asset {0} {1} without querying database since status Temporary = {2}, Local = {3}",
// asset.Name, asset.ID, asset.Temporary, asset.Local);
return asset.ID;
return m_AssetService.Store(asset);
}
else
{
// m_log.DebugFormat(
// "[LOCAL ASSET SERVICE CONNECTOR]: Passing {0} {1} on to asset service for storage, status Temporary = {2}, Local = {3}",
// asset.Name, asset.ID, asset.Temporary, asset.Local);
return m_AssetService.Store(asset);
}
}
public bool UpdateContent(string id, byte[] data)