diff options
author | Mike Mazur | 2009-02-23 04:39:08 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-23 04:39:08 +0000 |
commit | dba8c90611abf50b706bc3ba54bc455ee142dae3 (patch) | |
tree | 052878bcc0cd4a23af2e0ad60f8b37f248bc5c2d | |
parent | Prevent avatar from walking along z-axis (diff) | |
download | opensim-SC-dba8c90611abf50b706bc3ba54bc455ee142dae3.zip opensim-SC-dba8c90611abf50b706bc3ba54bc455ee142dae3.tar.gz opensim-SC-dba8c90611abf50b706bc3ba54bc455ee142dae3.tar.bz2 opensim-SC-dba8c90611abf50b706bc3ba54bc455ee142dae3.tar.xz |
Load default assets when AssetInventory starts.
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs | 1 | ||||
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs | 14 | ||||
-rw-r--r-- | bin/AssetInventoryServer.ini.example | 4 | ||||
-rw-r--r-- | prebuild.xml | 1 |
4 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs index d0f4250..79b6c73 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryConfig.cs | |||
@@ -71,6 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
71 | { | 71 | { |
72 | IConfig config = result.AddConfig("Config"); | 72 | IConfig config = result.AddConfig("Config"); |
73 | config.Set("listen_port", 8003); | 73 | config.Set("listen_port", 8003); |
74 | config.Set("assetset_location", String.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); | ||
74 | } | 75 | } |
75 | 76 | ||
76 | { | 77 | { |
diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs index 74e6ea4..2687af6 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs | |||
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Servers; | 32 | using OpenSim.Framework.Servers; |
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.AssetLoader.Filesystem; | ||
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using log4net; | 36 | using log4net; |
36 | 37 | ||
@@ -96,6 +97,8 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
96 | return false; | 97 | return false; |
97 | } | 98 | } |
98 | 99 | ||
100 | LoadDefaultAssets(); | ||
101 | |||
99 | AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", | 102 | AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", |
100 | "authentication_provider", false) as IAuthenticationProvider; | 103 | "authentication_provider", false) as IAuthenticationProvider; |
101 | m_backends.Add(AuthenticationProvider); | 104 | m_backends.Add(AuthenticationProvider); |
@@ -197,5 +200,16 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
197 | 200 | ||
198 | return loader.Plugins; | 201 | return loader.Plugins; |
199 | } | 202 | } |
203 | |||
204 | private void LoadDefaultAssets() | ||
205 | { | ||
206 | AssetLoaderFileSystem assetLoader = new AssetLoaderFileSystem(); | ||
207 | assetLoader.ForEachDefaultXmlAsset(ConfigFile.Configs["Config"].GetString("assetset_location"), StoreAsset); | ||
208 | } | ||
209 | |||
210 | private void StoreAsset(AssetBase asset) | ||
211 | { | ||
212 | StorageProvider.TryCreateAsset(asset); | ||
213 | } | ||
200 | } | 214 | } |
201 | } | 215 | } |
diff --git a/bin/AssetInventoryServer.ini.example b/bin/AssetInventoryServer.ini.example index bba4668..20e7ba6 100644 --- a/bin/AssetInventoryServer.ini.example +++ b/bin/AssetInventoryServer.ini.example | |||
@@ -3,6 +3,10 @@ | |||
3 | ; The port number for the asset server to listen on. | 3 | ; The port number for the asset server to listen on. |
4 | listen_port = 8003 | 4 | listen_port = 8003 |
5 | 5 | ||
6 | ; Points to an XML file which describes assets to load on startup. | ||
7 | ; This is "./assets/AssetSets.xml" by default and can be changed below. | ||
8 | ;assetset_location = ./assets/AssetSets.xml | ||
9 | |||
6 | [Plugins] | 10 | [Plugins] |
7 | 11 | ||
8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
diff --git a/prebuild.xml b/prebuild.xml index bcaae4f..6905abb 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -768,6 +768,7 @@ | |||
768 | <Reference name="OpenSim.Framework"/> | 768 | <Reference name="OpenSim.Framework"/> |
769 | <Reference name="OpenSim.Framework.Servers"/> | 769 | <Reference name="OpenSim.Framework.Servers"/> |
770 | <Reference name="OpenSim.Framework.Console"/> | 770 | <Reference name="OpenSim.Framework.Console"/> |
771 | <Reference name="OpenSim.Framework.AssetLoader.Filesystem"/> | ||
771 | <Reference name="Nini.dll" /> | 772 | <Reference name="Nini.dll" /> |
772 | <Reference name="log4net"/> | 773 | <Reference name="log4net"/> |
773 | 774 | ||