diff options
Diffstat (limited to 'OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs')
-rw-r--r-- | OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs b/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs index ea4824b..17d2680 100644 --- a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs +++ b/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs | |||
@@ -31,6 +31,7 @@ using System.Threading; | |||
31 | using Db4objects.Db4o; | 31 | using Db4objects.Db4o; |
32 | using Db4objects.Db4o.Query; | 32 | using Db4objects.Db4o.Query; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using Nini.Config; | ||
34 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
35 | using OpenSim.Framework.Interfaces; | 36 | using OpenSim.Framework.Interfaces; |
36 | using OpenSim.Framework.Types; | 37 | using OpenSim.Framework.Types; |
@@ -345,7 +346,7 @@ namespace OpenSim.Region.GridInterfaces.Local | |||
345 | db.Set(store); | 346 | db.Set(store); |
346 | db.Commit(); | 347 | db.Commit(); |
347 | 348 | ||
348 | Image = new AssetBase(); | 349 | /*Image = new AssetBase(); |
349 | Image.FullID = new LLUUID("00000000-0000-2222-3333-000000000001"); | 350 | Image.FullID = new LLUUID("00000000-0000-2222-3333-000000000001"); |
350 | Image.Name = "WelcomeNote"; | 351 | Image.Name = "WelcomeNote"; |
351 | Image.Type = 7; | 352 | Image.Type = 7; |
@@ -357,7 +358,35 @@ namespace OpenSim.Region.GridInterfaces.Local | |||
357 | store.UUID = Image.FullID; | 358 | store.UUID = Image.FullID; |
358 | db.Set(store); | 359 | db.Set(store); |
359 | db.Commit(); | 360 | db.Commit(); |
360 | 361 | */ | |
362 | |||
363 | string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml"); | ||
364 | XmlConfigSource source = new XmlConfigSource(filePath); | ||
365 | ReadAssetDetails(source); | ||
366 | } | ||
367 | |||
368 | protected void ReadAssetDetails(IConfigSource source) | ||
369 | { | ||
370 | AssetBase newAsset = null; | ||
371 | for (int i = 0; i < source.Configs.Count; i++) | ||
372 | { | ||
373 | newAsset = new AssetBase(); | ||
374 | newAsset.FullID = new LLUUID(source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated())); | ||
375 | newAsset.Name = source.Configs[i].GetString("name", ""); | ||
376 | newAsset.Type =(sbyte) source.Configs[i].GetInt("assetType", 0); | ||
377 | newAsset.InvType =(sbyte) source.Configs[i].GetInt("inventoryType", 0); | ||
378 | string fileName = source.Configs[i].GetString("fileName", ""); | ||
379 | if (fileName != "") | ||
380 | { | ||
381 | this.LoadAsset(newAsset, false, fileName); | ||
382 | AssetStorage store = new AssetStorage(); | ||
383 | store.Data = newAsset.Data; | ||
384 | store.Name = newAsset.Name; | ||
385 | store.UUID = newAsset.FullID; | ||
386 | db.Set(store); | ||
387 | db.Commit(); | ||
388 | } | ||
389 | } | ||
361 | } | 390 | } |
362 | 391 | ||
363 | private void LoadAsset(AssetBase info, bool image, string filename) | 392 | private void LoadAsset(AssetBase info, bool image, string filename) |