mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
WARNING: LOTS OF CONFIGURATION CHANGES AFFECTING PRIMARILY HG CONFIGS. Added capability to preserve creator information on HG asset transfers. Added a new HGAssetService that is intended to be the one outside the firewall. It processes and filters the assets that go out of the grid. Also fixed the normal AssetService to do special things for the main instance (console commands, etc). Moved HGInventoryService to OpenSim.Services.HypergridService. Changed the way the login service gets the ServiceURL configs.
This commit is contained in:
@@ -43,44 +43,51 @@ namespace OpenSim.Services.AssetService
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected static AssetService m_RootInstance;
|
||||
|
||||
public AssetService(IConfigSource config) : base(config)
|
||||
{
|
||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||
"show digest",
|
||||
"show digest <ID>",
|
||||
"Show asset digest", HandleShowDigest);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||
"delete asset",
|
||||
"delete asset <ID>",
|
||||
"Delete asset from database", HandleDeleteAsset);
|
||||
|
||||
if (m_AssetLoader != null)
|
||||
if (m_RootInstance == null)
|
||||
{
|
||||
IConfig assetConfig = config.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
throw new Exception("No AssetService configuration");
|
||||
m_RootInstance = this;
|
||||
|
||||
string loaderArgs = assetConfig.GetString("AssetLoaderArgs",
|
||||
String.Empty);
|
||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||
"show digest",
|
||||
"show digest <ID>",
|
||||
"Show asset digest", HandleShowDigest);
|
||||
|
||||
bool assetLoaderEnabled = assetConfig.GetBoolean("AssetLoaderEnabled", true);
|
||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||
"delete asset",
|
||||
"delete asset <ID>",
|
||||
"Delete asset from database", HandleDeleteAsset);
|
||||
|
||||
if (assetLoaderEnabled)
|
||||
if (m_AssetLoader != null)
|
||||
{
|
||||
m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
||||
m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs,
|
||||
delegate(AssetBase a)
|
||||
{
|
||||
Store(a);
|
||||
});
|
||||
IConfig assetConfig = config.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
throw new Exception("No AssetService configuration");
|
||||
|
||||
string loaderArgs = assetConfig.GetString("AssetLoaderArgs",
|
||||
String.Empty);
|
||||
|
||||
bool assetLoaderEnabled = assetConfig.GetBoolean("AssetLoaderEnabled", true);
|
||||
|
||||
if (assetLoaderEnabled)
|
||||
{
|
||||
m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
||||
m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs,
|
||||
delegate(AssetBase a)
|
||||
{
|
||||
Store(a);
|
||||
});
|
||||
}
|
||||
|
||||
m_log.Info("[ASSET SERVICE]: Local asset service enabled");
|
||||
}
|
||||
|
||||
m_log.Info("[ASSET SERVICE]: Local asset service enabled");
|
||||
}
|
||||
}
|
||||
|
||||
public AssetBase Get(string id)
|
||||
public virtual AssetBase Get(string id)
|
||||
{
|
||||
UUID assetID;
|
||||
|
||||
@@ -93,12 +100,12 @@ namespace OpenSim.Services.AssetService
|
||||
return m_Database.GetAsset(assetID);
|
||||
}
|
||||
|
||||
public AssetBase GetCached(string id)
|
||||
public virtual AssetBase GetCached(string id)
|
||||
{
|
||||
return Get(id);
|
||||
}
|
||||
|
||||
public AssetMetadata GetMetadata(string id)
|
||||
public virtual AssetMetadata GetMetadata(string id)
|
||||
{
|
||||
UUID assetID;
|
||||
|
||||
@@ -112,7 +119,7 @@ namespace OpenSim.Services.AssetService
|
||||
return null;
|
||||
}
|
||||
|
||||
public byte[] GetData(string id)
|
||||
public virtual byte[] GetData(string id)
|
||||
{
|
||||
UUID assetID;
|
||||
|
||||
@@ -123,7 +130,7 @@ namespace OpenSim.Services.AssetService
|
||||
return asset.Data;
|
||||
}
|
||||
|
||||
public bool Get(string id, Object sender, AssetRetrieved handler)
|
||||
public virtual bool Get(string id, Object sender, AssetRetrieved handler)
|
||||
{
|
||||
//m_log.DebugFormat("[AssetService]: Get asset async {0}", id);
|
||||
|
||||
@@ -141,7 +148,7 @@ namespace OpenSim.Services.AssetService
|
||||
return true;
|
||||
}
|
||||
|
||||
public string Store(AssetBase asset)
|
||||
public virtual string Store(AssetBase asset)
|
||||
{
|
||||
//m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID);
|
||||
m_Database.StoreAsset(asset);
|
||||
@@ -154,7 +161,7 @@ namespace OpenSim.Services.AssetService
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Delete(string id)
|
||||
public virtual bool Delete(string id)
|
||||
{
|
||||
m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id);
|
||||
UUID assetID;
|
||||
|
||||
Reference in New Issue
Block a user