mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
Merge branch 'master' into presence-refactor
This commit is contained in:
@@ -38,12 +38,9 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
{
|
||||
public class LocalAssetServicesConnector :
|
||||
ISharedRegionModule, IAssetService
|
||||
public class LocalAssetServicesConnector : ISharedRegionModule, IAssetService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IImprovedAssetCache m_Cache = null;
|
||||
|
||||
@@ -72,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
IConfig assetConfig = source.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
{
|
||||
m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
|
||||
m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: AssetService missing from OpenSim.ini");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,22 +78,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[ASSET CONNECTOR]: No LocalServiceModule named in section AssetService");
|
||||
m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService");
|
||||
return;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_AssetService =
|
||||
ServerUtils.LoadPlugin<IAssetService>(serviceDll,
|
||||
args);
|
||||
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args);
|
||||
|
||||
if (m_AssetService == null)
|
||||
{
|
||||
m_log.Error("[ASSET CONNECTOR]: Can't load asset service");
|
||||
m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: Can't load asset service");
|
||||
return;
|
||||
}
|
||||
m_Enabled = true;
|
||||
m_log.Info("[ASSET CONNECTOR]: Local asset connector enabled");
|
||||
m_log.Info("[LOCAL ASSET SERVICES CONNECTOR]: Local asset connector enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,11 +129,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
m_Cache = null;
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[ASSET CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName);
|
||||
m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName);
|
||||
|
||||
if (m_Cache != null)
|
||||
{
|
||||
m_log.InfoFormat("[ASSET CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName);
|
||||
m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -151,6 +146,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
public AssetBase Get(string id)
|
||||
{
|
||||
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Synchronously requesting asset {0}", id);
|
||||
|
||||
AssetBase asset = null;
|
||||
if (m_Cache != null)
|
||||
asset = m_Cache.Get(id);
|
||||
@@ -160,7 +157,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
asset = m_AssetService.Get(id);
|
||||
if ((m_Cache != null) && (asset != null))
|
||||
m_Cache.Cache(asset);
|
||||
|
||||
// if (null == asset)
|
||||
// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not synchronously find asset with id {0}", id);
|
||||
}
|
||||
|
||||
return asset;
|
||||
}
|
||||
|
||||
@@ -204,15 +205,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
public bool Get(string id, Object sender, AssetRetrieved handler)
|
||||
{
|
||||
AssetBase asset = null;
|
||||
|
||||
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id);
|
||||
|
||||
if (m_Cache != null)
|
||||
m_Cache.Get(id);
|
||||
|
||||
if (asset != null)
|
||||
{
|
||||
Util.FireAndForget(delegate { handler(id, sender, asset); });
|
||||
return true;
|
||||
AssetBase asset = m_Cache.Get(id);
|
||||
|
||||
if (asset != null)
|
||||
{
|
||||
Util.FireAndForget(delegate { handler(id, sender, asset); });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a)
|
||||
@@ -220,6 +223,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
if ((a != null) && (m_Cache != null))
|
||||
m_Cache.Cache(a);
|
||||
|
||||
// if (null == a)
|
||||
// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);
|
||||
|
||||
Util.FireAndForget(delegate { handler(assetID, s, a); });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
IConfig inventoryConfig = source.Configs["InventoryService"];
|
||||
if (inventoryConfig == null)
|
||||
{
|
||||
m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
|
||||
m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: InventoryService missing from OpenSim.ini");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,18 +81,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[INVENTORY CONNECTOR]: No LocalServiceModule named in section InventoryService");
|
||||
m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: No LocalServiceModule named in section InventoryService");
|
||||
return;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_log.DebugFormat("[INVENTORY CONNECTOR]: Service dll = {0}", serviceDll);
|
||||
m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Service dll = {0}", serviceDll);
|
||||
|
||||
m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(serviceDll, args);
|
||||
|
||||
if (m_InventoryService == null)
|
||||
{
|
||||
m_log.Error("[INVENTORY CONNECTOR]: Can't load inventory service");
|
||||
m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service");
|
||||
//return;
|
||||
throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
Init(source);
|
||||
|
||||
m_Enabled = true;
|
||||
m_log.Info("[INVENTORY CONNECTOR]: Local inventory connector enabled");
|
||||
m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName);
|
||||
// "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName);
|
||||
|
||||
scene.RegisterModuleInterface<IInventoryService>(this);
|
||||
m_cache.AddRegion(scene);
|
||||
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
return;
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY CONNECTOR]: Enabled local invnetory for region {0}", scene.RegionInfo.RegionName);
|
||||
"[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
#region IInventoryService
|
||||
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
return folders;
|
||||
}
|
||||
}
|
||||
m_log.WarnFormat("[INVENTORY CONNECTOR]: System folders for {0} not found", userID);
|
||||
m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID);
|
||||
return new Dictionary<AssetType, InventoryFolderBase>();
|
||||
}
|
||||
|
||||
@@ -309,7 +309,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
public override InventoryItemBase GetItem(InventoryItemBase item)
|
||||
{
|
||||
return m_InventoryService.GetItem(item);
|
||||
// m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID);
|
||||
|
||||
item = m_InventoryService.GetItem(item);
|
||||
|
||||
if (null == item)
|
||||
m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}");
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
public override InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
||||
|
||||
Reference in New Issue
Block a user