diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs
index d0f42503fa..79b6c73505 100644
--- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs
+++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs
@@ -71,6 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer
{
IConfig config = result.AddConfig("Config");
config.Set("listen_port", 8003);
+ config.Set("assetset_location", String.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar));
}
{
diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs
index 74e6ea4609..2687af6022 100644
--- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs
+++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs
@@ -31,6 +31,7 @@ using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Console;
+using OpenSim.Framework.AssetLoader.Filesystem;
using Nini.Config;
using log4net;
@@ -96,6 +97,8 @@ namespace OpenSim.Grid.AssetInventoryServer
return false;
}
+ LoadDefaultAssets();
+
AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider",
"authentication_provider", false) as IAuthenticationProvider;
m_backends.Add(AuthenticationProvider);
@@ -197,5 +200,16 @@ namespace OpenSim.Grid.AssetInventoryServer
return loader.Plugins;
}
+
+ private void LoadDefaultAssets()
+ {
+ AssetLoaderFileSystem assetLoader = new AssetLoaderFileSystem();
+ assetLoader.ForEachDefaultXmlAsset(ConfigFile.Configs["Config"].GetString("assetset_location"), StoreAsset);
+ }
+
+ private void StoreAsset(AssetBase asset)
+ {
+ StorageProvider.TryCreateAsset(asset);
+ }
}
}
diff --git a/bin/AssetInventoryServer.ini.example b/bin/AssetInventoryServer.ini.example
index bba4668c24..20e7ba654b 100644
--- a/bin/AssetInventoryServer.ini.example
+++ b/bin/AssetInventoryServer.ini.example
@@ -3,6 +3,10 @@
; The port number for the asset server to listen on.
listen_port = 8003
+; Points to an XML file which describes assets to load on startup.
+; This is "./assets/AssetSets.xml" by default and can be changed below.
+;assetset_location = ./assets/AssetSets.xml
+
[Plugins]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/prebuild.xml b/prebuild.xml
index bcaae4f170..6905abbf22 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -768,6 +768,7 @@
+