mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
some changes; let regions have own assets connector, make the services connector one be like ther older simpler one (as 0.8x). still not good
This commit is contained in:
@@ -562,6 +562,11 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||
return asset;
|
||||
}
|
||||
|
||||
public AssetBase Get(string id, string ForeignAssetService)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool Get(string id, out AssetBase asset)
|
||||
{
|
||||
asset = null;
|
||||
|
||||
@@ -33,7 +33,6 @@ using System.Reflection;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Services.Connectors;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
@@ -41,12 +40,10 @@ using OpenSim.Services.Interfaces;
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGAssetBroker")]
|
||||
public class HGAssetBroker : AssetServicesConnector, ISharedRegionModule, IAssetService
|
||||
public class HGAssetBroker : RegionBaseAssetServicesConnector, ISharedRegionModule, IAssetService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IAssetCache m_Cache = null;
|
||||
|
||||
private Scene m_aScene;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
@@ -70,7 +67,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
Initialise(config);
|
||||
}
|
||||
|
||||
public override void Initialise(IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig moduleConfig = source.Configs["Modules"];
|
||||
if (moduleConfig != null)
|
||||
@@ -78,17 +75,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
string name = moduleConfig.GetString("AssetServices", "");
|
||||
if (name == Name)
|
||||
{
|
||||
IConfig assetConfig = source.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
{
|
||||
m_log.Error("[HG ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
|
||||
return;
|
||||
}
|
||||
|
||||
IConfig hgConfig = source.Configs["HGAssetService"];
|
||||
m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null
|
||||
if(hgConfig != null)
|
||||
m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null
|
||||
|
||||
base.Initialise(source);
|
||||
baseInitialise(source);
|
||||
m_Enabled = true;
|
||||
m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");
|
||||
}
|
||||
@@ -128,8 +119,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
|
||||
if (!(m_Cache is ISharedRegionModule))
|
||||
m_Cache = null;
|
||||
else
|
||||
SetCache(m_Cache);
|
||||
}
|
||||
|
||||
if (m_Cache != null)
|
||||
|
||||
@@ -131,19 +131,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
m_Cache = null;
|
||||
}
|
||||
|
||||
if (m_Cache != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset connector with caching for region {0}",
|
||||
if (m_Cache == null)
|
||||
m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset connector with caching for region {0}",
|
||||
scene.RegionInfo.RegionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Short-circuit directly to storage layer. This ends up storing temporary and local assets.
|
||||
//
|
||||
scene.UnregisterModuleInterface<IAssetService>(this);
|
||||
scene.RegisterModuleInterface<IAssetService>(m_AssetService);
|
||||
}
|
||||
m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset connector without caching for region {0}",
|
||||
scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
public AssetBase Get(string id)
|
||||
@@ -168,6 +161,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
return asset;
|
||||
}
|
||||
|
||||
public AssetBase Get(string id, string ForeignAssetService)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public AssetBase GetCached(string id)
|
||||
{
|
||||
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,13 +40,11 @@ using OpenSim.Services.Interfaces;
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAssetServicesConnector")]
|
||||
public class RemoteAssetServicesConnector : AssetServicesConnector, ISharedRegionModule, IAssetService
|
||||
public class RemoteAssetServicesConnector : RegionBaseAssetServicesConnector, ISharedRegionModule, IAssetService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private IAssetCache m_Cache;
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
@@ -57,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
get { return "RemoteAssetServicesConnector"; }
|
||||
}
|
||||
|
||||
public override void Initialise(IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig moduleConfig = source.Configs["Modules"];
|
||||
if (moduleConfig != null)
|
||||
@@ -65,17 +63,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
string name = moduleConfig.GetString("AssetServices", "");
|
||||
if (name == Name)
|
||||
{
|
||||
IConfig assetConfig = source.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
{
|
||||
m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
|
||||
return;
|
||||
}
|
||||
|
||||
baseInitialise(source);
|
||||
m_Enabled = true;
|
||||
|
||||
base.Initialise(source);
|
||||
|
||||
m_log.Info("[ASSET CONNECTOR]: Remote assets enabled");
|
||||
}
|
||||
}
|
||||
@@ -115,17 +105,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
//
|
||||
if (!(m_Cache is ISharedRegionModule))
|
||||
m_Cache = null;
|
||||
else
|
||||
SetCache(m_Cache);
|
||||
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[ASSET CONNECTOR]: Enabled remote 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("[ASSET CONNECTOR]: Enabled remote assets with caching for region {0}", scene.RegionInfo.RegionName);
|
||||
else
|
||||
m_log.InfoFormat("[ASSET CONNECTOR]: Enabled remote assets without caching for region {0}", scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user