aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/IXAssetDataPlugin.cs47
-rw-r--r--OpenSim/Data/MySQL/MySQLXAssetData.cs27
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs16
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs26
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs8
-rw-r--r--OpenSim/Services/AssetService/XAssetService.cs2
-rw-r--r--OpenSim/Services/AssetService/XAssetServiceBase.cs94
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs2
11 files changed, 190 insertions, 55 deletions
diff --git a/OpenSim/Data/IXAssetDataPlugin.cs b/OpenSim/Data/IXAssetDataPlugin.cs
new file mode 100644
index 0000000..74ad6f4
--- /dev/null
+++ b/OpenSim/Data/IXAssetDataPlugin.cs
@@ -0,0 +1,47 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using OpenMetaverse;
30using OpenSim.Framework;
31
32namespace OpenSim.Data
33{
34 /// <summary>
35 /// This interface exists to distinguish between the normal IAssetDataPlugin and the one used by XAssetService
36 /// for now.
37 /// </summary>
38 public interface IXAssetDataPlugin : IPlugin
39 {
40 AssetBase GetAsset(UUID uuid);
41 void StoreAsset(AssetBase asset);
42 bool ExistsAsset(UUID uuid);
43 List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
44 void Initialise(string connect);
45 bool Delete(string id);
46 }
47} \ No newline at end of file
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 7b634e2..9a50373 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -41,7 +41,7 @@ using OpenSim.Data;
41 41
42namespace OpenSim.Data.MySQL 42namespace OpenSim.Data.MySQL
43{ 43{
44 public class MySQLXAssetData : AssetDataBase 44 public class MySQLXAssetData : IXAssetDataPlugin
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
@@ -61,7 +61,7 @@ namespace OpenSim.Data.MySQL
61 61
62 #region IPlugin Members 62 #region IPlugin Members
63 63
64 public override string Version { get { return "1.0.0.0"; } } 64 public string Version { get { return "1.0.0.0"; } }
65 65
66 /// <summary> 66 /// <summary>
67 /// <para>Initialises Asset interface</para> 67 /// <para>Initialises Asset interface</para>
@@ -74,7 +74,7 @@ namespace OpenSim.Data.MySQL
74 /// </para> 74 /// </para>
75 /// </summary> 75 /// </summary>
76 /// <param name="connect">connect string</param> 76 /// <param name="connect">connect string</param>
77 public override void Initialise(string connect) 77 public void Initialise(string connect)
78 { 78 {
79 m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************"); 79 m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
80 m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************"); 80 m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
@@ -96,17 +96,17 @@ namespace OpenSim.Data.MySQL
96 } 96 }
97 } 97 }
98 98
99 public override void Initialise() 99 public void Initialise()
100 { 100 {
101 throw new NotImplementedException(); 101 throw new NotImplementedException();
102 } 102 }
103 103
104 public override void Dispose() { } 104 public void Dispose() { }
105 105
106 /// <summary> 106 /// <summary>
107 /// The name of this DB provider 107 /// The name of this DB provider
108 /// </summary> 108 /// </summary>
109 override public string Name 109 public string Name
110 { 110 {
111 get { return "MySQL XAsset storage engine"; } 111 get { return "MySQL XAsset storage engine"; }
112 } 112 }
@@ -121,7 +121,7 @@ namespace OpenSim.Data.MySQL
121 /// <param name="assetID">Asset UUID to fetch</param> 121 /// <param name="assetID">Asset UUID to fetch</param>
122 /// <returns>Return the asset</returns> 122 /// <returns>Return the asset</returns>
123 /// <remarks>On failure : throw an exception and attempt to reconnect to database</remarks> 123 /// <remarks>On failure : throw an exception and attempt to reconnect to database</remarks>
124 override public AssetBase GetAsset(UUID assetID) 124 public AssetBase GetAsset(UUID assetID)
125 { 125 {
126// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID); 126// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID);
127 127
@@ -190,7 +190,7 @@ namespace OpenSim.Data.MySQL
190 /// </summary> 190 /// </summary>
191 /// <param name="asset">Asset UUID to create</param> 191 /// <param name="asset">Asset UUID to create</param>
192 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> 192 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
193 override public bool StoreAsset(AssetBase asset) 193 public void StoreAsset(AssetBase asset)
194 { 194 {
195 lock (m_dbLock) 195 lock (m_dbLock)
196 { 196 {
@@ -265,7 +265,7 @@ namespace OpenSim.Data.MySQL
265 265
266 transaction.Rollback(); 266 transaction.Rollback();
267 267
268 return false; 268 return;
269 } 269 }
270 270
271 if (!ExistsData(dbcon, transaction, hash)) 271 if (!ExistsData(dbcon, transaction, hash))
@@ -289,7 +289,7 @@ namespace OpenSim.Data.MySQL
289 289
290 transaction.Rollback(); 290 transaction.Rollback();
291 291
292 return false; 292 return;
293 } 293 }
294 } 294 }
295 295
@@ -297,7 +297,6 @@ namespace OpenSim.Data.MySQL
297 } 297 }
298 } 298 }
299 } 299 }
300 return true;
301 } 300 }
302 301
303// private void UpdateAccessTime(AssetBase asset) 302// private void UpdateAccessTime(AssetBase asset)
@@ -381,7 +380,7 @@ namespace OpenSim.Data.MySQL
381 /// </summary> 380 /// </summary>
382 /// <param name="uuid">The asset UUID</param> 381 /// <param name="uuid">The asset UUID</param>
383 /// <returns>true if it exists, false otherwise.</returns> 382 /// <returns>true if it exists, false otherwise.</returns>
384 override public bool ExistsAsset(UUID uuid) 383 public bool ExistsAsset(UUID uuid)
385 { 384 {
386// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid); 385// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
387 386
@@ -427,7 +426,7 @@ namespace OpenSim.Data.MySQL
427 /// <param name="start">The number of results to discard from the total data set.</param> 426 /// <param name="start">The number of results to discard from the total data set.</param>
428 /// <param name="count">The number of rows the returned list should contain.</param> 427 /// <param name="count">The number of rows the returned list should contain.</param>
429 /// <returns>A list of AssetMetadata objects.</returns> 428 /// <returns>A list of AssetMetadata objects.</returns>
430 public override List<AssetMetadata> FetchAssetMetadataSet(int start, int count) 429 public List<AssetMetadata> FetchAssetMetadataSet(int start, int count)
431 { 430 {
432 List<AssetMetadata> retList = new List<AssetMetadata>(count); 431 List<AssetMetadata> retList = new List<AssetMetadata>(count);
433 432
@@ -472,7 +471,7 @@ namespace OpenSim.Data.MySQL
472 return retList; 471 return retList;
473 } 472 }
474 473
475 public override bool Delete(string id) 474 public bool Delete(string id)
476 { 475 {
477// m_log.DebugFormat("[XASSETS DB]: Deleting asset {0}", id); 476// m_log.DebugFormat("[XASSETS DB]: Deleting asset {0}", id);
478 477
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
index c982db6..267fb9e 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
@@ -93,8 +93,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
93 93
94 scene.RegisterModuleInterface<IAuthorizationService>(this); 94 scene.RegisterModuleInterface<IAuthorizationService>(this);
95 m_Scene = scene; 95 m_Scene = scene;
96
97 scene.EventManager.OnLoginsEnabled += new EventManager.LoginsEnabled(OnLoginsEnabled);
98 } 96 }
99 97
100 public void RemoveRegion(Scene scene) 98 public void RemoveRegion(Scene scene)
@@ -106,16 +104,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
106 if (!m_Enabled) 104 if (!m_Enabled)
107 return; 105 return;
108 106
107 m_AuthorizationService = new AuthorizationService(m_AuthorizationConfig, m_Scene);
108
109 m_log.InfoFormat( 109 m_log.InfoFormat(
110 "[AUTHORIZATION CONNECTOR]: Enabled local authorization for region {0}", 110 "[AUTHORIZATION CONNECTOR]: Enabled local authorization for region {0}",
111 scene.RegionInfo.RegionName); 111 scene.RegionInfo.RegionName);
112 } 112 }
113 113
114 private void OnLoginsEnabled(string regionName)
115 {
116 m_AuthorizationService = new AuthorizationService(m_AuthorizationConfig, m_Scene);
117 }
118
119 public bool IsAuthorizedForRegion( 114 public bool IsAuthorizedForRegion(
120 string userID, string firstName, string lastName, string regionID, out string message) 115 string userID, string firstName, string lastName, string regionID, out string message)
121 { 116 {
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 605ee32..853491b 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -485,6 +485,13 @@ namespace OpenSim.Region.Framework.Scenes
485 public event RegionHeartbeatEnd OnRegionHeartbeatEnd; 485 public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
486 486
487 public delegate void LoginsEnabled(string regionName); 487 public delegate void LoginsEnabled(string regionName);
488
489 /// <summary>
490 /// This should only fire in all circumstances if the RegionReady module is active.
491 /// </summary>
492 /// <remarks>
493 /// TODO: Fire this even when the RegionReady module is not active.
494 /// </remarks>
488 public event LoginsEnabled OnLoginsEnabled; 495 public event LoginsEnabled OnLoginsEnabled;
489 496
490 public delegate void PrimsLoaded(Scene s); 497 public delegate void PrimsLoaded(Scene s);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 753effc..b50ccc4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1229,9 +1229,6 @@ namespace OpenSim.Region.Framework.Scenes
1229 while (!shuttingdown) 1229 while (!shuttingdown)
1230 Update(); 1230 Update();
1231 } 1231 }
1232 catch (ThreadAbortException)
1233 {
1234 }
1235 finally 1232 finally
1236 { 1233 {
1237 Monitor.Pulse(m_heartbeatLock); 1234 Monitor.Pulse(m_heartbeatLock);
@@ -1409,10 +1406,6 @@ namespace OpenSim.Region.Framework.Scenes
1409 } 1406 }
1410 } 1407 }
1411 } 1408 }
1412 catch (NotImplementedException)
1413 {
1414 throw;
1415 }
1416 catch (Exception e) 1409 catch (Exception e)
1417 { 1410 {
1418 m_log.ErrorFormat( 1411 m_log.ErrorFormat(
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index c5a76b2..bebc10c 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -63,17 +63,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
63 63
64 Thread testThread = new Thread(testClass.run); 64 Thread testThread = new Thread(testClass.run);
65 65
66 try 66 // Seems kind of redundant to start a thread and then join it, however.. We need to protect against
67 { 67 // A thread abort exception in the simulator code.
68 // Seems kind of redundant to start a thread and then join it, however.. We need to protect against 68 testThread.Start();
69 // A thread abort exception in the simulator code. 69 testThread.Join();
70 testThread.Start(); 70
71 testThread.Join();
72 }
73 catch (ThreadAbortException)
74 {
75
76 }
77 Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message); 71 Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message);
78 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 72 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
79 } 73 }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 254d578..6f37347 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -842,17 +842,23 @@ namespace OpenSim.Region.Physics.OdePlugin
842 mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage 842 mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage
843 843
844 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory 844 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
845 if (m_MeshToTriMeshMap.ContainsKey(mesh))
846 {
847 _triMeshData = m_MeshToTriMeshMap[mesh];
848 }
849 else
850 {
851 _triMeshData = d.GeomTriMeshDataCreate();
852 845
853 d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); 846 // We must lock here since m_MeshToTriMeshMap is static and multiple scene threads may call this method at
854 d.GeomTriMeshDataPreprocess(_triMeshData); 847 // the same time.
855 m_MeshToTriMeshMap[mesh] = _triMeshData; 848 lock (m_MeshToTriMeshMap)
849 {
850 if (m_MeshToTriMeshMap.ContainsKey(mesh))
851 {
852 _triMeshData = m_MeshToTriMeshMap[mesh];
853 }
854 else
855 {
856 _triMeshData = d.GeomTriMeshDataCreate();
857
858 d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride);
859 d.GeomTriMeshDataPreprocess(_triMeshData);
860 m_MeshToTriMeshMap[mesh] = _triMeshData;
861 }
856 } 862 }
857 863
858// _parent_scene.waitForSpaceUnlock(m_targetSpace); 864// _parent_scene.waitForSpaceUnlock(m_targetSpace);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index eb10975..1e0f01f 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -469,16 +469,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
469// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count); 469// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count);
470 470
471 SensorRepeat sr = AsyncCommandManager.GetSensorRepeatPlugin(this); 471 SensorRepeat sr = AsyncCommandManager.GetSensorRepeatPlugin(this);
472 sb.AppendFormat("Sensors : {0}\n", sr.SensorsCount); 472 sb.AppendFormat("Sensors : {0}\n", sr != null ? sr.SensorsCount : 0);
473 473
474 Dataserver ds = AsyncCommandManager.GetDataserverPlugin(this); 474 Dataserver ds = AsyncCommandManager.GetDataserverPlugin(this);
475 sb.AppendFormat("Dataserver requests : {0}\n", ds.DataserverRequestsCount); 475 sb.AppendFormat("Dataserver requests : {0}\n", ds != null ? ds.DataserverRequestsCount : 0);
476 476
477 Timer t = AsyncCommandManager.GetTimerPlugin(this); 477 Timer t = AsyncCommandManager.GetTimerPlugin(this);
478 sb.AppendFormat("Timers : {0}\n", t.TimersCount); 478 sb.AppendFormat("Timers : {0}\n", t != null ? t.TimersCount : 0);
479 479
480 Listener l = AsyncCommandManager.GetListenerPlugin(this); 480 Listener l = AsyncCommandManager.GetListenerPlugin(this);
481 sb.AppendFormat("Listeners : {0}\n", l.ListenerCount); 481 sb.AppendFormat("Listeners : {0}\n", l != null ? l.ListenerCount : 0);
482 482
483 return sb.ToString(); 483 return sb.ToString();
484 } 484 }
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs
index d161c58..05eb125 100644
--- a/OpenSim/Services/AssetService/XAssetService.cs
+++ b/OpenSim/Services/AssetService/XAssetService.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Services.AssetService
42 /// This will be developed into a de-duplicating asset service. 42 /// This will be developed into a de-duplicating asset service.
43 /// XXX: Currently it's a just a copy of the existing AssetService. so please don't attempt to use it. 43 /// XXX: Currently it's a just a copy of the existing AssetService. so please don't attempt to use it.
44 /// </summary> 44 /// </summary>
45 public class XAssetService : AssetServiceBase, IAssetService 45 public class XAssetService : XAssetServiceBase, IAssetService
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
diff --git a/OpenSim/Services/AssetService/XAssetServiceBase.cs b/OpenSim/Services/AssetService/XAssetServiceBase.cs
new file mode 100644
index 0000000..0c5c2c3
--- /dev/null
+++ b/OpenSim/Services/AssetService/XAssetServiceBase.cs
@@ -0,0 +1,94 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Reflection;
30using Nini.Config;
31using OpenSim.Framework;
32using OpenSim.Data;
33using OpenSim.Services.Interfaces;
34using OpenSim.Services.Base;
35
36namespace OpenSim.Services.AssetService
37{
38 public class XAssetServiceBase : ServiceBase
39 {
40 protected IXAssetDataPlugin m_Database = null;
41 protected IAssetLoader m_AssetLoader = null;
42
43 public XAssetServiceBase(IConfigSource config) : base(config)
44 {
45 string dllName = String.Empty;
46 string connString = String.Empty;
47
48 //
49 // Try reading the [AssetService] section first, if it exists
50 //
51 IConfig assetConfig = config.Configs["AssetService"];
52 if (assetConfig != null)
53 {
54 dllName = assetConfig.GetString("StorageProvider", dllName);
55 connString = assetConfig.GetString("ConnectionString", connString);
56 }
57
58 //
59 // Try reading the [DatabaseService] section, if it exists
60 //
61 IConfig dbConfig = config.Configs["DatabaseService"];
62 if (dbConfig != null)
63 {
64 if (dllName == String.Empty)
65 dllName = dbConfig.GetString("StorageProvider", String.Empty);
66 if (connString == String.Empty)
67 connString = dbConfig.GetString("ConnectionString", String.Empty);
68 }
69
70 //
71 // We tried, but this doesn't exist. We can't proceed.
72 //
73 if (dllName.Equals(String.Empty))
74 throw new Exception("No StorageProvider configured");
75
76 m_Database = LoadPlugin<IXAssetDataPlugin>(dllName);
77 if (m_Database == null)
78 throw new Exception("Could not find a storage interface in the given module");
79
80 m_Database.Initialise(connString);
81
82 string loaderName = assetConfig.GetString("DefaultAssetLoader",
83 String.Empty);
84
85 if (loaderName != String.Empty)
86 {
87 m_AssetLoader = LoadPlugin<IAssetLoader>(loaderName);
88
89 if (m_AssetLoader == null)
90 throw new Exception("Asset loader could not be loaded");
91 }
92 }
93 }
94} \ No newline at end of file
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 9d0aeef..95c2935 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -540,7 +540,7 @@ namespace OpenSim.Services.UserAccountService
540 else 540 else
541 { 541 {
542 m_log.DebugFormat( 542 m_log.DebugFormat(
543 "[USER ACCOUNT SERVICE]; Created user inventory for {0} {1}", firstName, lastName); 543 "[USER ACCOUNT SERVICE]: Created user inventory for {0} {1}", firstName, lastName);
544 } 544 }
545 545
546 if (m_CreateDefaultAvatarEntries) 546 if (m_CreateDefaultAvatarEntries)