aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs26
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs24
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs18
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs15
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs2
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs11
-rw-r--r--OpenSim/Services/AssetService/AssetServiceBase.cs15
-rw-r--r--OpenSim/Services/HypergridService/HGAssetService.cs4
-rw-r--r--OpenSim/Services/HypergridService/HGInventoryService.cs40
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs12
14 files changed, 125 insertions, 60 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index feab40e..a2d833b 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
448 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", 448 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
449 sp.Name, finalDestination.RegionName); 449 sp.Name, finalDestination.RegionName);
450 450
451 Fail(sp, finalDestination); 451 Fail(sp, finalDestination, logout);
452 return; 452 return;
453 } 453 }
454 454
@@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
480 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", 480 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.",
481 sp.Name, finalDestination.RegionName); 481 sp.Name, finalDestination.RegionName);
482 482
483 Fail(sp, finalDestination); 483 Fail(sp, finalDestination, logout);
484 return; 484 return;
485 } 485 }
486 486
@@ -531,7 +531,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
531 } 531 }
532 } 532 }
533 533
534 private void Fail(ScenePresence sp, GridRegion finalDestination) 534 protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
535 { 535 {
536 // Client never contacted destination. Let's restore everything back 536 // Client never contacted destination. Let's restore everything back
537 sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); 537 sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 5c7ca22..4a563f9 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
50 50
51 private bool m_Initialized = false; 51 private bool m_Initialized = false;
52 52
53 private bool m_RestrictInventoryAccessAbroad = false;
54
53 private GatekeeperServiceConnector m_GatekeeperConnector; 55 private GatekeeperServiceConnector m_GatekeeperConnector;
54 56
55 #region ISharedRegionModule 57 #region ISharedRegionModule
@@ -68,6 +70,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
68 if (name == Name) 70 if (name == Name)
69 { 71 {
70 InitialiseCommon(source); 72 InitialiseCommon(source);
73 IConfig transferConfig = source.Configs["HGEntityTransfer"];
74 if (transferConfig != null)
75 m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false);
76
71 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); 77 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
72 } 78 }
73 } 79 }
@@ -170,6 +176,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
170 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); 176 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
171 logout = success; // flag for later logout from this grid; this is an HG TP 177 logout = success; // flag for later logout from this grid; this is an HG TP
172 178
179 if (success && m_RestrictInventoryAccessAbroad)
180 {
181 // TODO tell the viewer to remove the root folder
182 }
183
173 return success; 184 return success;
174 } 185 }
175 else 186 else
@@ -288,6 +299,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
288 299
289 } 300 }
290 301
302 protected override void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
303 {
304 base.Fail(sp, finalDestination, logout);
305 if (logout && m_RestrictInventoryAccessAbroad)
306 {
307 // Restore the user's inventory, because we removed it earlier on
308 InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(sp.UUID);
309 if (root != null)
310 {
311 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring");
312 sp.ControllingClient.SendBulkUpdateInventory(root);
313 }
314 }
315 }
316
291 #endregion 317 #endregion
292 318
293 #region IUserAgentVerificationModule 319 #region IUserAgentVerificationModule
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 9159f0c..14e428e 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -1199,8 +1199,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1199 saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); 1199 saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
1200 saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", 1200 saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
1201 "Integer"); 1201 "Integer");
1202 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
1203 "Integer");
1204 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n" 1202 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n"
1205 + "= Example =\n" 1203 + "= Example =\n"
1206 + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n" 1204 + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n"
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6ac7846..fc1034d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2800,6 +2800,14 @@ namespace OpenSim.Region.Framework.Scenes
2800 // Cache the user's name 2800 // Cache the user's name
2801 CacheUserName(sp, aCircuit); 2801 CacheUserName(sp, aCircuit);
2802 2802
2803 // Let's send the Suitcase folder for incoming HG agents
2804 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
2805 {
2806 m_log.DebugFormat("[SCENE]: Sending root folder to viewer...");
2807 InventoryFolderBase suitcase = InventoryService.GetRootFolder(client.AgentId);
2808 client.SendBulkUpdateInventory(suitcase);
2809 }
2810
2803 EventManager.TriggerOnNewClient(client); 2811 EventManager.TriggerOnNewClient(client);
2804 if (vialogin) 2812 if (vialogin)
2805 { 2813 {
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 20708d9..b08d5db 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -426,6 +426,8 @@ public class BSCharacter : PhysicsActor
426 } 426 }
427 } 427 }
428 428
429 // Called by the scene when a collision with this object is reported
430 CollisionEventUpdate collisionCollection = null;
429 public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth) 431 public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth)
430 { 432 {
431 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); 433 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
@@ -443,10 +445,24 @@ public class BSCharacter : PhysicsActor
443 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; 445 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
444 _lastCollisionTime = nowTime; 446 _lastCollisionTime = nowTime;
445 447
446 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); 448 if (collisionCollection == null)
447 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); 449 collisionCollection = new CollisionEventUpdate();
448 CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); 450 collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
449 base.SendCollisionUpdate(args); 451 }
452
453 public void SendCollisions()
454 {
455 // if (collisionCollection != null)
456 // {
457 // base.SendCollisionUpdate(collisionCollection);
458 // collisionCollection = null;
459 // }
460 // Kludge to make a collision call even if there are no collisions.
461 // This causes the avatar animation to get updated.
462 if (collisionCollection == null)
463 collisionCollection = new CollisionEventUpdate();
464 base.SendCollisionUpdate(collisionCollection);
465 collisionCollection = null;
450 } 466 }
451 467
452} 468}
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index f122df9..248d1f2 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -1326,6 +1326,7 @@ public sealed class BSPrim : PhysicsActor
1326 } 1326 }
1327 1327
1328 // I've collided with something 1328 // I've collided with something
1329 CollisionEventUpdate collisionCollection = null;
1329 public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) 1330 public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
1330 { 1331 {
1331 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); 1332 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
@@ -1343,11 +1344,18 @@ public sealed class BSPrim : PhysicsActor
1343 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; 1344 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
1344 _lastCollisionTime = nowTime; 1345 _lastCollisionTime = nowTime;
1345 1346
1346 // create the event for the collision 1347 if (collisionCollection == null)
1347 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); 1348 collisionCollection = new CollisionEventUpdate();
1348 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); 1349 collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
1349 CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); 1350 }
1350 base.SendCollisionUpdate(args); 1351
1352 public void SendCollisions()
1353 {
1354 if (collisionCollection != null)
1355 {
1356 base.SendCollisionUpdate(collisionCollection);
1357 collisionCollection = null;
1358 }
1351 } 1359 }
1352} 1360}
1353} 1361}
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 581d540..94a0ccf 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -78,6 +78,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters
78 78
79 private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); 79 private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>();
80 private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>(); 80 private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>();
81 private HashSet<BSCharacter> m_avatarsWithCollisions = new HashSet<BSCharacter>();
82 private HashSet<BSPrim> m_primsWithCollisions = new HashSet<BSPrim>();
81 private List<BSPrim> m_vehicles = new List<BSPrim>(); 83 private List<BSPrim> m_vehicles = new List<BSPrim>();
82 private float[] m_heightMap; 84 private float[] m_heightMap;
83 private float m_waterLevel; 85 private float m_waterLevel;
@@ -435,6 +437,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters
435 } 437 }
436 } 438 }
437 439
440 // The SendCollision's batch up the collisions on the objects. Now push the collisions into the simulator.
441 foreach (BSPrim bsp in m_primsWithCollisions)
442 bsp.SendCollisions();
443 m_primsWithCollisions.Clear();
444 // foreach (BSCharacter bsc in m_avatarsWithCollisions)
445 // bsc.SendCollisions();
446 // This is a kludge to get avatar movement updated. ODE sends collisions even if there isn't any
447 foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars)
448 kvp.Value.SendCollisions();
449 m_avatarsWithCollisions.Clear();
450
438 // If any of the objects had updated properties, tell the object it has been changed by the physics engine 451 // If any of the objects had updated properties, tell the object it has been changed by the physics engine
439 if (updatedEntityCount > 0) 452 if (updatedEntityCount > 0)
440 { 453 {
@@ -485,11 +498,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters
485 BSPrim prim; 498 BSPrim prim;
486 if (m_prims.TryGetValue(localID, out prim)) { 499 if (m_prims.TryGetValue(localID, out prim)) {
487 prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); 500 prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
501 m_primsWithCollisions.Add(prim);
488 return; 502 return;
489 } 503 }
490 BSCharacter actor; 504 BSCharacter actor;
491 if (m_avatars.TryGetValue(localID, out actor)) { 505 if (m_avatars.TryGetValue(localID, out actor)) {
492 actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); 506 actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
507 m_avatarsWithCollisions.Add(actor);
493 return; 508 return;
494 } 509 }
495 return; 510 return;
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index 8b9e749..46b0c67 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Server.Handlers.Asset
59 if (assetService == String.Empty) 59 if (assetService == String.Empty)
60 throw new Exception("No LocalServiceModule in config file"); 60 throw new Exception("No LocalServiceModule in config file");
61 61
62 Object[] args = new Object[] { config }; 62 Object[] args = new Object[] { config, m_ConfigName };
63 m_AssetService = 63 m_AssetService =
64 ServerUtils.LoadPlugin<IAssetService>(assetService, args); 64 ServerUtils.LoadPlugin<IAssetService>(assetService, args);
65 65
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 9d6f964..040c840 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Server.Handlers.Asset
67 if (inventoryService == String.Empty) 67 if (inventoryService == String.Empty)
68 throw new Exception("No InventoryService in config file"); 68 throw new Exception("No InventoryService in config file");
69 69
70 Object[] args = new Object[] { config }; 70 Object[] args = new Object[] { config, m_ConfigName };
71 m_InventoryService = 71 m_InventoryService =
72 ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args); 72 ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args);
73 73
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index d4bfe8f..1427e84 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -46,7 +46,12 @@ namespace OpenSim.Services.AssetService
46 46
47 protected static AssetService m_RootInstance; 47 protected static AssetService m_RootInstance;
48 48
49 public AssetService(IConfigSource config) : base(config) 49 public AssetService(IConfigSource config)
50 : this(config, "AssetService")
51 {
52 }
53
54 public AssetService(IConfigSource config, string configName) : base(config, configName)
50 { 55 {
51 if (m_RootInstance == null) 56 if (m_RootInstance == null)
52 { 57 {
@@ -54,9 +59,9 @@ namespace OpenSim.Services.AssetService
54 59
55 if (m_AssetLoader != null) 60 if (m_AssetLoader != null)
56 { 61 {
57 IConfig assetConfig = config.Configs["AssetService"]; 62 IConfig assetConfig = config.Configs[m_ConfigName];
58 if (assetConfig == null) 63 if (assetConfig == null)
59 throw new Exception("No AssetService configuration"); 64 throw new Exception("No " + m_ConfigName + " configuration");
60 65
61 string loaderArgs = assetConfig.GetString("AssetLoaderArgs", 66 string loaderArgs = assetConfig.GetString("AssetLoaderArgs",
62 String.Empty); 67 String.Empty);
diff --git a/OpenSim/Services/AssetService/AssetServiceBase.cs b/OpenSim/Services/AssetService/AssetServiceBase.cs
index 86752f9..177c565 100644
--- a/OpenSim/Services/AssetService/AssetServiceBase.cs
+++ b/OpenSim/Services/AssetService/AssetServiceBase.cs
@@ -39,16 +39,25 @@ namespace OpenSim.Services.AssetService
39 { 39 {
40 protected IAssetDataPlugin m_Database = null; 40 protected IAssetDataPlugin m_Database = null;
41 protected IAssetLoader m_AssetLoader = null; 41 protected IAssetLoader m_AssetLoader = null;
42 protected string m_ConfigName = "AssetService";
42 43
43 public AssetServiceBase(IConfigSource config) : base(config) 44 public AssetServiceBase(IConfigSource config)
45 : this(config, "AssetService")
44 { 46 {
47 }
48
49 public AssetServiceBase(IConfigSource config, string configName) : base(config)
50 {
51 if (configName != string.Empty)
52 m_ConfigName = configName;
53
45 string dllName = String.Empty; 54 string dllName = String.Empty;
46 string connString = String.Empty; 55 string connString = String.Empty;
47 56
48 // 57 //
49 // Try reading the [AssetService] section first, if it exists 58 // Try reading the [AssetService] section, if it exists
50 // 59 //
51 IConfig assetConfig = config.Configs["AssetService"]; 60 IConfig assetConfig = config.Configs[m_ConfigName];
52 if (assetConfig != null) 61 if (assetConfig != null)
53 { 62 {
54 dllName = assetConfig.GetString("StorageProvider", dllName); 63 dllName = assetConfig.GetString("StorageProvider", dllName);
diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs
index 22e233a..db98166 100644
--- a/OpenSim/Services/HypergridService/HGAssetService.cs
+++ b/OpenSim/Services/HypergridService/HGAssetService.cs
@@ -58,10 +58,10 @@ namespace OpenSim.Services.HypergridService
58 58
59 private UserAccountCache m_Cache; 59 private UserAccountCache m_Cache;
60 60
61 public HGAssetService(IConfigSource config) : base(config) 61 public HGAssetService(IConfigSource config, string configName) : base(config, configName)
62 { 62 {
63 m_log.Debug("[HGAsset Service]: Starting"); 63 m_log.Debug("[HGAsset Service]: Starting");
64 IConfig assetConfig = config.Configs["HGAssetService"]; 64 IConfig assetConfig = config.Configs[configName];
65 if (assetConfig == null) 65 if (assetConfig == null)
66 throw new Exception("No HGAssetService configuration"); 66 throw new Exception("No HGAssetService configuration");
67 67
diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs
index 41d5a7a..a1287fd 100644
--- a/OpenSim/Services/HypergridService/HGInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGInventoryService.cs
@@ -60,36 +60,19 @@ namespace OpenSim.Services.HypergridService
60 60
61 private UserAccountCache m_Cache; 61 private UserAccountCache m_Cache;
62 62
63 public HGInventoryService(IConfigSource config) 63 public HGInventoryService(IConfigSource config, string configName)
64 : base(config) 64 : base(config, configName)
65 { 65 {
66 m_log.Debug("[HGInventory Service]: Starting"); 66 m_log.Debug("[HGInventory Service]: Starting");
67 67 if (configName != string.Empty)
68 string dllName = String.Empty; 68 m_ConfigName = configName;
69 string connString = String.Empty;
70 //string realm = "Inventory"; // OSG version doesn't use this
71
72 //
73 // Try reading the [DatabaseService] section, if it exists
74 //
75 IConfig dbConfig = config.Configs["DatabaseService"];
76 if (dbConfig != null)
77 {
78 if (dllName == String.Empty)
79 dllName = dbConfig.GetString("StorageProvider", String.Empty);
80 if (connString == String.Empty)
81 connString = dbConfig.GetString("ConnectionString", String.Empty);
82 }
83 69
84 // 70 //
85 // Try reading the [InventoryService] section, if it exists 71 // Try reading the [InventoryService] section, if it exists
86 // 72 //
87 IConfig invConfig = config.Configs["HGInventoryService"]; 73 IConfig invConfig = config.Configs[m_ConfigName];
88 if (invConfig != null) 74 if (invConfig != null)
89 { 75 {
90 dllName = invConfig.GetString("StorageProvider", dllName);
91 connString = invConfig.GetString("ConnectionString", connString);
92
93 // realm = authConfig.GetString("Realm", realm); 76 // realm = authConfig.GetString("Realm", realm);
94 string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty); 77 string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
95 if (userAccountsDll == string.Empty) 78 if (userAccountsDll == string.Empty)
@@ -108,17 +91,6 @@ namespace OpenSim.Services.HypergridService
108 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); 91 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
109 } 92 }
110 93
111 //
112 // We tried, but this doesn't exist. We can't proceed.
113 //
114 if (dllName == String.Empty)
115 throw new Exception("No StorageProvider configured");
116
117 m_Database = LoadPlugin<IXInventoryData>(dllName,
118 new Object[] {connString, String.Empty});
119 if (m_Database == null)
120 throw new Exception("Could not find a storage interface in the given module");
121
122 m_log.Debug("[HG INVENTORY SERVICE]: Starting..."); 94 m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
123 } 95 }
124 96
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 1648b51..8c57d17 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -46,9 +46,17 @@ namespace OpenSim.Services.InventoryService
46 46
47 protected IXInventoryData m_Database; 47 protected IXInventoryData m_Database;
48 protected bool m_AllowDelete = true; 48 protected bool m_AllowDelete = true;
49 protected string m_ConfigName = "InventoryService";
49 50
50 public XInventoryService(IConfigSource config) : base(config) 51 public XInventoryService(IConfigSource config)
52 : this(config, "InventoryService")
51 { 53 {
54 }
55 public XInventoryService(IConfigSource config, string configName) : base(config)
56 {
57 if (configName != string.Empty)
58 m_ConfigName = configName;
59
52 string dllName = String.Empty; 60 string dllName = String.Empty;
53 string connString = String.Empty; 61 string connString = String.Empty;
54 //string realm = "Inventory"; // OSG version doesn't use this 62 //string realm = "Inventory"; // OSG version doesn't use this
@@ -56,7 +64,7 @@ namespace OpenSim.Services.InventoryService
56 // 64 //
57 // Try reading the [InventoryService] section first, if it exists 65 // Try reading the [InventoryService] section first, if it exists
58 // 66 //
59 IConfig authConfig = config.Configs["InventoryService"]; 67 IConfig authConfig = config.Configs[m_ConfigName];
60 if (authConfig != null) 68 if (authConfig != null)
61 { 69 {
62 dllName = authConfig.GetString("StorageProvider", dllName); 70 dllName = authConfig.GetString("StorageProvider", dllName);