From 177048a65120c5b15e731802921a31b71a078e6f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 30 Apr 2010 22:35:07 +0200 Subject: Fix linking issue introduced in my earlier commit --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6ebfd31..9117224 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1967,8 +1967,17 @@ namespace OpenSim.Region.Framework.Scenes List children = new List(); SceneObjectPart root = GetSceneObjectPart(parentPrimId); - if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) + if (root == null) + { + m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId); + return; + } + + if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) + { + m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); return; + } foreach (uint localID in childPrimIds) { @@ -1987,7 +1996,16 @@ namespace OpenSim.Region.Framework.Scenes // Must be all one owner // if (owners.Count > 1) + { + m_log.DebugFormat("[LINK]: Refusing link. Too many owners"); + return; + } + + if (children.Count == 0) + { + m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children"); return; + } m_sceneGraph.LinkObjects(root, children); } -- cgit v1.1 From d0accc073272af838bc4ba44a71d41b19aa05906 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 30 Apr 2010 23:32:58 +0200 Subject: Allow retrieval if admin users in scope mode --- .../Services/UserAccountService/UserAccountService.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 7b38aa6..35e2826 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -104,6 +104,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "FirstName", "LastName" }, new string[] { scopeID.ToString(), firstName, lastName }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "FirstName", "LastName" }, + new string[] { UUID.Zero.ToString(), firstName, lastName }); + } } else { @@ -172,6 +178,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "Email" }, new string[] { scopeID.ToString(), email }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "Email" }, + new string[] { UUID.Zero.ToString(), email }); + } } else { @@ -195,6 +207,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "PrincipalID" }, new string[] { scopeID.ToString(), principalID.ToString() }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "PrincipalID" }, + new string[] { UUID.Zero.ToString(), principalID.ToString() }); + } } else { -- cgit v1.1 From f3662e3d15073aa7da22c3faf34afd6cb0e19dc9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 30 Apr 2010 22:22:03 +0100 Subject: minor: eliminate more debug Console.WriteLines, convert one to logging instead --- OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 2 +- OpenSim/Data/SQLiteLegacy/SQLiteAuthenticationData.cs | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index 086ac0a..a1412ff 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs @@ -29,6 +29,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Data; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenSim.Framework; using Mono.Data.Sqlite; @@ -37,6 +39,8 @@ namespace OpenSim.Data.SQLite { public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private string m_Realm; private List m_ColumnNames; private int m_LastExpire; @@ -157,7 +161,7 @@ namespace OpenSim.Data.SQLite } catch (Exception e) { - Console.WriteLine(e.ToString()); + m_log.Error("[SQLITE]: Exception storing authentication data", e); //CloseCommand(cmd); return false; } diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 3c70aef..9b8e2fa 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -59,7 +59,7 @@ namespace OpenSim.Data.SQLite if (!m_initialized) { m_Connection = new SqliteConnection(connectionString); - Console.WriteLine(string.Format("OPENING CONNECTION FOR {0} USING {1}", storeName, connectionString)); + //Console.WriteLine(string.Format("OPENING CONNECTION FOR {0} USING {1}", storeName, connectionString)); m_Connection.Open(); if (storeName != String.Empty) diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteAuthenticationData.cs index c64830a..760221d 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteAuthenticationData.cs @@ -29,6 +29,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Data; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenSim.Framework; using Mono.Data.SqliteClient; @@ -37,6 +39,8 @@ namespace OpenSim.Data.SQLiteLegacy { public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private string m_Realm; private List m_ColumnNames; private int m_LastExpire; @@ -162,7 +166,7 @@ namespace OpenSim.Data.SQLiteLegacy } catch (Exception e) { - Console.WriteLine(e.ToString()); + m_log.Error("[SQLITE]: Exception storing authentication data", e); CloseCommand(cmd); return false; } -- cgit v1.1 From 648999dd3bb59fa6cd784338223d2f693ea09f08 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 30 Apr 2010 22:36:26 +0100 Subject: add operation to "nant distbin" to copy StandaloneCommon.ini.example -> StandaloneCommon.ini --- .nant/local.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nant/local.include b/.nant/local.include index 2591aba..b78b3ef 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -7,8 +7,8 @@ + - -- cgit v1.1 From bd49985afa0a30cf9338730807a42eff3d508bee Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 2 May 2010 10:31:35 -0700 Subject: Switched everything to XInventory by default. The old Inventory is still there for now, in case bugs pop up with XInventory. --- .../Data/SQLite/Resources/001_XInventoryStore.sql | 38 +++++++ .../Data/SQLite/Resources/002_XInventoryStore.sql | 9 ++ OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 2 +- .../Inventory/LocalInventoryServiceConnector.cs | 111 ++++++--------------- bin/Robust.HG.ini.example | 9 +- bin/Robust.ini.example | 9 +- bin/config-include/Grid.ini | 2 +- bin/config-include/GridHypergrid.ini | 3 +- bin/config-include/Standalone.ini | 6 +- bin/config-include/StandaloneHypergrid.ini | 9 +- bin/config-include/storage/SQLiteStandalone.ini | 6 ++ 11 files changed, 99 insertions(+), 105 deletions(-) create mode 100644 OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql create mode 100644 OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql diff --git a/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql new file mode 100644 index 0000000..7e21996 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql @@ -0,0 +1,38 @@ +BEGIN TRANSACTION; + +CREATE TABLE inventoryfolders( + folderName varchar(255), + type integer, + version integer, + folderID varchar(255) primary key, + agentID varchar(255) not null default '00000000-0000-0000-0000-000000000000', + parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000'); + +CREATE TABLE inventoryitems( + assetID varchar(255), + assetType integer, + inventoryName varchar(255), + inventoryDescription varchar(255), + inventoryNextPermissions integer, + inventoryCurrentPermissions integer, + invType integer, + creatorID varchar(255), + inventoryBasePermissions integer, + inventoryEveryOnePermissions integer, + salePrice integer default 99, + saleType integer default 0, + creationDate integer default 2000, + groupID varchar(255) default '00000000-0000-0000-0000-000000000000', + groupOwned integer default 0, + flags integer default 0, + inventoryID varchar(255) primary key, + parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000', + avatarID varchar(255) not null default '00000000-0000-0000-0000-000000000000', + inventoryGroupPermissions integer not null default 0); + +create index inventoryfolders_agentid on inventoryfolders(agentID); +create index inventoryfolders_parentid on inventoryfolders(parentFolderID); +create index inventoryitems_parentfolderid on inventoryitems(parentFolderID); +create index inventoryitems_avatarid on inventoryitems(avatarID); + +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql new file mode 100644 index 0000000..545d233 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql @@ -0,0 +1,9 @@ +BEGIN TRANSACTION; + +ATTACH 'inventoryStore.db' AS old; + +INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders; + +INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems; + +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index be1d041..6064538 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -49,7 +49,7 @@ namespace OpenSim.Data.SQLite public SQLiteXInventoryData(string conn, string realm) { m_Folders = new SQLiteGenericTableHandler( - conn, "inventoryfolders", "InventoryStore"); + conn, "inventoryfolders", "XInventoryStore"); m_Items = new SqliteItemHandler( conn, "inventoryitems", String.Empty); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index a2f26d5..22bd04c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -41,7 +41,7 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { - public class LocalInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService + public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService { private static readonly ILog m_log = LogManager.GetLogger( @@ -50,7 +50,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private IInventoryService m_InventoryService; private bool m_Enabled = false; - private bool m_Initialized = false; public Type ReplaceableInterface { @@ -93,23 +92,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (m_InventoryService == null) { m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service"); - //return; throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); } - //List plugins - // = DataPluginFactory.LoadDataPlugins( - // configSettings.StandaloneInventoryPlugin, - // configSettings.StandaloneInventorySource); - - //foreach (IInventoryDataPlugin plugin in plugins) - //{ - // // Using the OSP wrapper plugin for database plugins should be made configurable at some point - // m_InventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); - //} - - Init(source); - m_Enabled = true; m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled"); } @@ -128,99 +113,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if (!m_Enabled) return; - - if (!m_Initialized) - { - m_Initialized = true; - } - -// m_log.DebugFormat( -// "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); - m_cache.AddRegion(scene); } public void RemoveRegion(Scene scene) { if (!m_Enabled) return; - - m_cache.RemoveRegion(scene); } public void RegionLoaded(Scene scene) { if (!m_Enabled) return; - - m_log.InfoFormat( - "[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName); } #region IInventoryService - public override bool CreateUserInventory(UUID user) + public bool CreateUserInventory(UUID user) { return m_InventoryService.CreateUserInventory(user); } - public override List GetInventorySkeleton(UUID userId) + public List GetInventorySkeleton(UUID userId) { return m_InventoryService.GetInventorySkeleton(userId); } - public override InventoryCollection GetUserInventory(UUID id) + public InventoryCollection GetUserInventory(UUID id) { return m_InventoryService.GetUserInventory(id); } - public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) + public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) { m_InventoryService.GetUserInventory(userID, callback); } - // Inherited. See base - //public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - //{ - // return m_InventoryService.GetFolderForType(userID, type); - //} - - public override Dictionary GetSystemFolders(UUID userID) + public InventoryFolderBase GetRootFolder(UUID userID) { - InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); - if (root != null) - { - InventoryCollection content = GetFolderContent(userID, root.ID); - if (content != null) - { - Dictionary folders = new Dictionary(); - foreach (InventoryFolderBase folder in content.Folders) - { - if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) - { - //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); - folders[(AssetType)folder.Type] = folder; - } - } - // Put the root folder there, as type Folder - folders[AssetType.Folder] = root; - //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); + return m_InventoryService.GetRootFolder(userID); + } - return folders; - } - } - m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID); - return new Dictionary(); + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + return m_InventoryService.GetFolderForType(userID, type); } - public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) { return m_InventoryService.GetFolderContent(userID, folderID); } - - public override List GetFolderItems(UUID userID, UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return m_InventoryService.GetFolderItems(userID, folderID); } @@ -230,7 +176,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully added - public override bool AddFolder(InventoryFolderBase folder) + public bool AddFolder(InventoryFolderBase folder) { return m_InventoryService.AddFolder(folder); } @@ -240,7 +186,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully updated - public override bool UpdateFolder(InventoryFolderBase folder) + public bool UpdateFolder(InventoryFolderBase folder) { return m_InventoryService.UpdateFolder(folder); } @@ -250,12 +196,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// A folder containing the details of the new location /// true if the folder was successfully moved - public override bool MoveFolder(InventoryFolderBase folder) + public bool MoveFolder(InventoryFolderBase folder) { return m_InventoryService.MoveFolder(folder); } - public override bool DeleteFolders(UUID ownerID, List folderIDs) + public bool DeleteFolders(UUID ownerID, List folderIDs) { return m_InventoryService.DeleteFolders(ownerID, folderIDs); } @@ -265,18 +211,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully purged - public override bool PurgeFolder(InventoryFolderBase folder) + public bool PurgeFolder(InventoryFolderBase folder) { return m_InventoryService.PurgeFolder(folder); } /// - /// Add a new item to the user's inventory, plain - /// Called by base class AddItem + /// Add a new item to the user's inventory /// /// /// true if the item was successfully added - protected override bool AddItemPlain(InventoryItemBase item) + public bool AddItem(InventoryItemBase item) { return m_InventoryService.AddItem(item); } @@ -286,13 +231,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the item was successfully updated - public override bool UpdateItem(InventoryItemBase item) + public bool UpdateItem(InventoryItemBase item) { return m_InventoryService.UpdateItem(item); } - public override bool MoveItems(UUID ownerID, List items) + public bool MoveItems(UUID ownerID, List items) { return m_InventoryService.MoveItems(ownerID, items); } @@ -302,12 +247,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the item was successfully deleted - public override bool DeleteItems(UUID ownerID, List itemIDs) + public bool DeleteItems(UUID ownerID, List itemIDs) { return m_InventoryService.DeleteItems(ownerID, itemIDs); } - public override InventoryItemBase GetItem(InventoryItemBase item) + public InventoryItemBase GetItem(InventoryItemBase item) { // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); @@ -322,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return item; } - public override InventoryFolderBase GetFolder(InventoryFolderBase folder) + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return m_InventoryService.GetFolder(folder); } @@ -332,17 +277,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// - public override bool HasInventoryForUser(UUID userID) + public bool HasInventoryForUser(UUID userID) { return m_InventoryService.HasInventoryForUser(userID); } - public override List GetActiveGestures(UUID userId) + public List GetActiveGestures(UUID userId) { return m_InventoryService.GetActiveGestures(userId); } - public override int GetAssetPermissions(UUID userID, UUID assetID) + public int GetAssetPermissions(UUID userID, UUID assetID) { return m_InventoryService.GetAssetPermissions(userID, assetID); } diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 5e3f9a7..489b66f 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -11,7 +11,7 @@ ;; [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:InventoryServiceInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryServiceInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none if specified above @@ -44,8 +44,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; * the function of the legacy inventory server ; * [InventoryService] - LocalServiceModule = "OpenSim.Services.InventoryService.dll:InventoryService" - SessionAuthentication = "false" + LocalServiceModule = "OpenSim.Services.InventoryService.dll:XInventoryService" ; * This is the new style grid service. ; * "Realm" is the table that is used for user lookup. @@ -92,7 +91,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" [PresenceService] ; for the server connector @@ -116,7 +115,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; for the service UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 9bedac6..cfc08bc 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -11,7 +11,7 @@ ; * [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:InventoryServiceInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none if specified above @@ -45,8 +45,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; * the function of the legacy inventory server ; * [InventoryService] - LocalServiceModule = "OpenSim.Services.InventoryService.dll:InventoryService" - SessionAuthentication = "false" + LocalServiceModule = "OpenSim.Services.InventoryService.dll:XInventoryService" ; * This is the new style grid service. ; * "Realm" is the table that is used for user lookup. @@ -94,7 +93,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" [PresenceService] ; for the server connector @@ -118,7 +117,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; for the service UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" diff --git a/bin/config-include/Grid.ini b/bin/config-include/Grid.ini index 9dff325..4767cbc 100644 --- a/bin/config-include/Grid.ini +++ b/bin/config-include/Grid.ini @@ -9,7 +9,7 @@ [Modules] AssetServices = "RemoteAssetServicesConnector" - InventoryServices = "RemoteInventoryServicesConnector" + InventoryServices = "RemoteXInventoryServicesConnector" GridServices = "RemoteGridServicesConnector" AvatarServices = "RemoteAvatarServicesConnector" NeighbourServices = "RemoteNeighbourServicesConnector" diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini index b567817..051a87e 100644 --- a/bin/config-include/GridHypergrid.ini +++ b/bin/config-include/GridHypergrid.ini @@ -30,8 +30,7 @@ HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" [InventoryService] - LocalGridInventoryService = "OpenSim.Region.CoreModules.dll:RemoteInventoryServicesConnector" - HypergridInventoryService = "OpenSim.Services.Connectors.dll:HGInventoryServiceConnector" + LocalGridInventoryService = "OpenSim.Region.CoreModules.dll:RemoteXInventoryServicesConnector" [GridService] ; RemoteGridServicesConnector instantiates a LocalGridServicesConnector, diff --git a/bin/config-include/Standalone.ini b/bin/config-include/Standalone.ini index 92c2154..027b4ea 100644 --- a/bin/config-include/Standalone.ini +++ b/bin/config-include/Standalone.ini @@ -24,7 +24,7 @@ LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" [InventoryService] - LocalServiceModule = "OpenSim.Services.InventoryService.dll:InventoryService" + LocalServiceModule = "OpenSim.Services.InventoryService.dll:XInventoryService" [LibraryService] LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService" @@ -56,7 +56,7 @@ AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" [GridUserService] LocalServiceModule = "OpenSim.Services.UserAccountService.dll:GridUserService" @@ -71,7 +71,7 @@ LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService" UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 1d8e2ef..35e6f20 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -33,11 +33,10 @@ HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" [InventoryService] - LocalServiceModule = "OpenSim.Services.InventoryService.dll:InventoryService" + LocalServiceModule = "OpenSim.Services.InventoryService.dll:XInventoryService" ; For HGInventoryBroker - LocalGridInventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" - HypergridInventoryService = "OpenSim.Services.Connectors.dll:HGInventoryServiceConnector" + LocalGridInventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" [AvatarService] LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService" @@ -74,7 +73,7 @@ AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" [FriendsService] LocalServiceModule = "OpenSim.Services.FriendsService.dll" @@ -88,7 +87,7 @@ UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" - InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" diff --git a/bin/config-include/storage/SQLiteStandalone.ini b/bin/config-include/storage/SQLiteStandalone.ini index 1ce0357..ed88a8a 100644 --- a/bin/config-include/storage/SQLiteStandalone.ini +++ b/bin/config-include/storage/SQLiteStandalone.ini @@ -3,6 +3,11 @@ [DatabaseService] StorageProvider = "OpenSim.Data.SQLite.dll" +[InventoryService] + ;ConnectionString = "URI=file:inventory.db,version=3" + ; if you have a legacy inventory store use the connection string below + ConnectionString = "URI=file:inventory.db,version=3,UseUTF16Encoding=True" + [AvatarService] ConnectionString = "URI=file:avatars.db,version=3" @@ -14,3 +19,4 @@ [FriendsService] ConnectionString = "URI=file:friends.db,version=3" + -- cgit v1.1 From 052580ef44e733138cd4dbf6cfe30acc476d90fc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 2 May 2010 10:32:47 -0700 Subject: Deleted HGInventoryBroker, so that the new one can take its name. --- .../Inventory/HGInventoryBroker.cs | 540 --------------------- 1 file changed, 540 deletions(-) delete mode 100644 OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs deleted file mode 100644 index 54508cc..0000000 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using log4net; -using Nini.Config; -using System; -using System.Collections.Generic; -using System.Reflection; -using OpenSim.Framework; - -using OpenSim.Server.Base; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Services.Interfaces; -using OpenSim.Services.Connectors; -using OpenMetaverse; - -namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory -{ - public class HGInventoryBroker : BaseInventoryConnector, INonSharedRegionModule, IInventoryService - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - private static bool m_Initialized = false; - private static bool m_Enabled = false; - - private static IInventoryService m_GridService; - private static ISessionAuthInventoryService m_HGService; - - private Scene m_Scene; - private IUserAccountService m_UserAccountService; - - public Type ReplaceableInterface - { - get { return null; } - } - - public string Name - { - get { return "HGInventoryBroker"; } - } - - public void Initialise(IConfigSource source) - { - if (!m_Initialized) - { - IConfig moduleConfig = source.Configs["Modules"]; - if (moduleConfig != null) - { - string name = moduleConfig.GetString("InventoryServices", ""); - if (name == Name) - { - IConfig inventoryConfig = source.Configs["InventoryService"]; - if (inventoryConfig == null) - { - m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); - return; - } - - string localDll = inventoryConfig.GetString("LocalGridInventoryService", - String.Empty); - string HGDll = inventoryConfig.GetString("HypergridInventoryService", - String.Empty); - - if (localDll == String.Empty) - { - m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService"); - //return; - throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); - } - - if (HGDll == String.Empty) - { - m_log.Error("[HG INVENTORY CONNECTOR]: No HypergridInventoryService named in section InventoryService"); - //return; - throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); - } - - Object[] args = new Object[] { source }; - m_GridService = - ServerUtils.LoadPlugin(localDll, - args); - - m_HGService = - ServerUtils.LoadPlugin(HGDll, - args); - - if (m_GridService == null) - { - m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service"); - return; - } - if (m_HGService == null) - { - m_log.Error("[HG INVENTORY CONNECTOR]: Can't load hypergrid inventory service"); - return; - } - - Init(source); - - m_Enabled = true; - m_log.Info("[HG INVENTORY CONNECTOR]: HG inventory broker enabled"); - } - } - m_Initialized = true; - } - } - - public void PostInitialise() - { - } - - public void Close() - { - } - - public void AddRegion(Scene scene) - { - if (!m_Enabled) - return; - - m_Scene = scene; - m_UserAccountService = m_Scene.UserAccountService; - - scene.RegisterModuleInterface(this); - m_cache.AddRegion(scene); - } - - public void RemoveRegion(Scene scene) - { - if (!m_Enabled) - return; - - m_cache.RemoveRegion(scene); - } - - public void RegionLoaded(Scene scene) - { - if (!m_Enabled) - return; - - m_log.InfoFormat("[HG INVENTORY CONNECTOR]: Enabled HG inventory for region {0}", scene.RegionInfo.RegionName); - - } - - #region IInventoryService - - public override bool CreateUserInventory(UUID userID) - { - return m_GridService.CreateUserInventory(userID); - } - - public override List GetInventorySkeleton(UUID userId) - { - return m_GridService.GetInventorySkeleton(userId); - } - - public override InventoryCollection GetUserInventory(UUID userID) - { - return null; - } - - public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - } - - // Inherited. See base - //public override InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - //{ - // if (IsLocalGridUser(userID)) - // return m_GridService.GetFolderForType(userID, type); - // else - // { - // UUID sessionID = GetSessionID(userID); - // string uri = GetUserInventoryURI(userID) + "/" + userID.ToString(); - // // !!!!!! - // return null; - // //return m_HGService.GetFolderForType(uri, sessionID, type); - // } - //} - - public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) - { - string uri = string.Empty; - if (!IsForeignUser(userID, out uri)) - return m_GridService.GetFolderContent(userID, folderID); - else - { - UUID sessionID = GetSessionID(userID); - uri = uri + "/" + userID.ToString(); - return m_HGService.GetFolderContent(uri, folderID, sessionID); - } - } - - public override Dictionary GetSystemFolders(UUID userID) - { - string uri = string.Empty; - if (!IsForeignUser(userID, out uri)) - { - // This is not pretty, but it will have to do for now - if (m_GridService is BaseInventoryConnector) - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetSystemsFolders redirected to RemoteInventoryServiceConnector module"); - return ((BaseInventoryConnector)m_GridService).GetSystemFolders(userID); - } - else - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetSystemsFolders redirected to GetSystemFoldersLocal"); - return GetSystemFoldersLocal(userID); - } - } - else - { - UUID sessionID = GetSessionID(userID); - uri = uri + "/" + userID.ToString(); - return m_HGService.GetSystemFolders(uri, sessionID); - } - } - - private Dictionary GetSystemFoldersLocal(UUID userID) - { - InventoryFolderBase root = m_GridService.GetRootFolder(userID); - if (root != null) - { - InventoryCollection content = m_GridService.GetFolderContent(userID, root.ID); - if (content != null) - { - Dictionary folders = new Dictionary(); - foreach (InventoryFolderBase folder in content.Folders) - { - //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: scanning folder type {0}", (AssetType)folder.Type); - if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) - folders[(AssetType)folder.Type] = folder; - } - // Put the root folder there, as type Folder - folders[AssetType.Folder] = root; - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); - return folders; - } - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); - - } - - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder not found for {0}", userID); - - return new Dictionary(); - } - - public override List GetFolderItems(UUID userID, UUID folderID) - { - string uri = string.Empty; - if (!IsForeignUser(userID, out uri)) - return m_GridService.GetFolderItems(userID, folderID); - else - { - UUID sessionID = GetSessionID(userID); - uri = uri + "/" + userID.ToString(); - return m_HGService.GetFolderItems(uri, folderID, sessionID); - } - } - - public override bool AddFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(folder.Owner, out uri)) - return m_GridService.AddFolder(folder); - else - { - UUID sessionID = GetSessionID(folder.Owner); - uri = uri + "/" + folder.Owner.ToString(); - return m_HGService.AddFolder(uri, folder, sessionID); - } - } - - public override bool UpdateFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(folder.Owner, out uri)) - return m_GridService.UpdateFolder(folder); - else - { - UUID sessionID = GetSessionID(folder.Owner); - uri = uri + "/" + folder.Owner.ToString(); - return m_HGService.UpdateFolder(uri, folder, sessionID); - } - } - - public override bool DeleteFolders(UUID ownerID, List folderIDs) - { - if (folderIDs == null) - return false; - if (folderIDs.Count == 0) - return false; - - string uri = string.Empty; - if (!IsForeignUser(ownerID, out uri)) - return m_GridService.DeleteFolders(ownerID, folderIDs); - else - { - UUID sessionID = GetSessionID(ownerID); - uri = uri + "/" + ownerID.ToString(); - return m_HGService.DeleteFolders(uri, folderIDs, sessionID); - } - } - - public override bool MoveFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(folder.Owner, out uri)) - return m_GridService.MoveFolder(folder); - else - { - UUID sessionID = GetSessionID(folder.Owner); - uri = uri + "/" + folder.Owner.ToString(); - return m_HGService.MoveFolder(uri, folder, sessionID); - } - } - - public override bool PurgeFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(folder.Owner, out uri)) - return m_GridService.PurgeFolder(folder); - else - { - UUID sessionID = GetSessionID(folder.Owner); - uri = uri + "/" + folder.Owner.ToString(); - return m_HGService.PurgeFolder(uri, folder, sessionID); - } - } - - // public bool AddItem(InventoryItemBase item) inherited - // Uses AddItemPlain - - protected override bool AddItemPlain(InventoryItemBase item) - { - if (item == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(item.Owner, out uri)) - { - return m_GridService.AddItem(item); - } - else - { - UUID sessionID = GetSessionID(item.Owner); - uri = uri + "/" + item.Owner.ToString(); - return m_HGService.AddItem(uri, item, sessionID); - } - } - - public override bool UpdateItem(InventoryItemBase item) - { - if (item == null) - return false; - - string uri = string.Empty; - if (!IsForeignUser(item.Owner, out uri)) - return m_GridService.UpdateItem(item); - else - { - UUID sessionID = GetSessionID(item.Owner); - uri = uri + "/" + item.Owner.ToString(); - return m_HGService.UpdateItem(uri, item, sessionID); - } - } - - public override bool MoveItems(UUID ownerID, List items) - { - if (items == null) - return false; - if (items.Count == 0) - return true; - - string uri = string.Empty; - if (!IsForeignUser(ownerID, out uri)) - return m_GridService.MoveItems(ownerID, items); - else - { - UUID sessionID = GetSessionID(ownerID); - uri = uri + "/" + ownerID.ToString(); - return m_HGService.MoveItems(uri, items, sessionID); - } - } - - public override bool DeleteItems(UUID ownerID, List itemIDs) - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); - - if (itemIDs == null) - return false; - if (itemIDs.Count == 0) - return true; - - string uri = string.Empty; - if (!IsForeignUser(ownerID, out uri)) - return m_GridService.DeleteItems(ownerID, itemIDs); - else - { - UUID sessionID = GetSessionID(ownerID); - uri = uri + "/" + ownerID.ToString(); - return m_HGService.DeleteItems(uri, itemIDs, sessionID); - } - } - - public override InventoryItemBase GetItem(InventoryItemBase item) - { - if (item == null) - return null; - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetItem {0} for user {1}", item.ID, item.Owner); - string uri = string.Empty; - if (!IsForeignUser(item.Owner, out uri)) - return m_GridService.GetItem(item); - else - { - UUID sessionID = GetSessionID(item.Owner); - uri = uri + "/" + item.Owner.ToString(); - return m_HGService.QueryItem(uri, item, sessionID); - } - } - - public override InventoryFolderBase GetFolder(InventoryFolderBase folder) - { - if (folder == null) - return null; - - string uri = string.Empty; - if (!IsForeignUser(folder.Owner, out uri)) - return m_GridService.GetFolder(folder); - else - { - UUID sessionID = GetSessionID(folder.Owner); - uri = uri + "/" + folder.Owner.ToString(); - return m_HGService.QueryFolder(uri, folder, sessionID); - } - } - - public override bool HasInventoryForUser(UUID userID) - { - return false; - } - - public override List GetActiveGestures(UUID userId) - { - return new List(); - } - - public override int GetAssetPermissions(UUID userID, UUID assetID) - { - string uri = string.Empty; - if (!IsForeignUser(userID, out uri)) - return m_GridService.GetAssetPermissions(userID, assetID); - else - { - UUID sessionID = GetSessionID(userID); - uri = uri + "/" + userID.ToString(); - return m_HGService.GetAssetPermissions(uri, assetID, sessionID); - } - } - - #endregion - - private UUID GetSessionID(UUID userID) - { - ScenePresence sp = null; - if (m_Scene.TryGetScenePresence(userID, out sp)) - { - return sp.ControllingClient.SessionId; - } - - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: scene presence for {0} not found", userID); - return UUID.Zero; - } - - private bool IsForeignUser(UUID userID, out string inventoryURL) - { - inventoryURL = string.Empty; - UserAccount account = null; - if (m_Scene.UserAccountService != null) - account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID); - - if (account == null) // foreign user - { - ScenePresence sp = null; - m_Scene.TryGetScenePresence(userID, out sp); - if (sp != null) - { - AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); - if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) - { - inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); - inventoryURL = inventoryURL.Trim(new char[] { '/' }); - return true; - } - } - } - return false; - } - - } -} -- cgit v1.1 From cbb297bc79ad0ecaad28ac968e40afe5a3552b2f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 2 May 2010 10:37:57 -0700 Subject: Renamed HGInventoryBroker2 to HGInventoryBroker. --- .../Resources/CoreModulePlugin.addin.xml | 1 - .../Inventory/HGInventoryBroker.cs | 556 +++++++++++++++++++++ .../Inventory/HGInventoryBroker2.cs | 556 --------------------- 3 files changed, 556 insertions(+), 557 deletions(-) create mode 100644 OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs delete mode 100644 OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index c738296..0a5ff3f 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml @@ -47,7 +47,6 @@ - diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs new file mode 100644 index 0000000..e09db15 --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -0,0 +1,556 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using log4net; +using Nini.Config; +using System; +using System.Collections.Generic; +using System.Reflection; +using OpenSim.Framework; + +using OpenSim.Server.Base; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; +using OpenMetaverse; + +namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory +{ + public class HGInventoryBroker : ISharedRegionModule, IInventoryService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private static bool m_Enabled = false; + + private static IInventoryService m_LocalGridInventoryService; + private Dictionary m_connectors = new Dictionary(); + + // A cache of userIDs --> ServiceURLs, for HGBroker only + protected Dictionary m_InventoryURLs = new Dictionary(); + + private List m_Scenes = new List(); + + public Type ReplaceableInterface + { + get { return null; } + } + + public string Name + { + get { return "HGInventoryBroker"; } + } + + public void Initialise(IConfigSource source) + { + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) + { + string name = moduleConfig.GetString("InventoryServices", ""); + if (name == Name) + { + IConfig inventoryConfig = source.Configs["InventoryService"]; + if (inventoryConfig == null) + { + m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); + return; + } + + string localDll = inventoryConfig.GetString("LocalGridInventoryService", + String.Empty); + //string HGDll = inventoryConfig.GetString("HypergridInventoryService", + // String.Empty); + + if (localDll == String.Empty) + { + m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService"); + //return; + throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); + } + + Object[] args = new Object[] { source }; + m_LocalGridInventoryService = + ServerUtils.LoadPlugin(localDll, + args); + + if (m_LocalGridInventoryService == null) + { + m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service"); + return; + } + + m_Enabled = true; + m_log.InfoFormat("[HG INVENTORY CONNECTOR]: HG inventory broker enabled with inner connector of type {0}", m_LocalGridInventoryService.GetType()); + } + } + } + + public void PostInitialise() + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + if (!m_Enabled) + return; + + m_Scenes.Add(scene); + + scene.RegisterModuleInterface(this); + + scene.EventManager.OnClientClosed += OnClientClosed; + + } + + public void RemoveRegion(Scene scene) + { + if (!m_Enabled) + return; + + m_Scenes.Remove(scene); + } + + public void RegionLoaded(Scene scene) + { + if (!m_Enabled) + return; + + m_log.InfoFormat("[HG INVENTORY CONNECTOR]: Enabled HG inventory for region {0}", scene.RegionInfo.RegionName); + + } + + #region URL Cache + + void OnClientClosed(UUID clientID, Scene scene) + { + if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache + { + ScenePresence sp = null; + foreach (Scene s in m_Scenes) + { + s.TryGetScenePresence(clientID, out sp); + if ((sp != null) && !sp.IsChildAgent && (s != scene)) + { + m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache", + scene.RegionInfo.RegionName, clientID); + return; + } + } + DropInventoryServiceURL(clientID); + } + } + + /// + /// Gets the user's inventory URL from its serviceURLs, if the user is foreign, + /// and sticks it in the cache + /// + /// + private void CacheInventoryServiceURL(UUID userID) + { + if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null) + { + // The user does not have a local account; let's cache its service URL + string inventoryURL = string.Empty; + ScenePresence sp = null; + foreach (Scene scene in m_Scenes) + { + scene.TryGetScenePresence(userID, out sp); + if (sp != null) + { + AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); + if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) + { + inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); + if (inventoryURL != null && inventoryURL != string.Empty) + { + inventoryURL = inventoryURL.Trim(new char[] { '/' }); + m_InventoryURLs.Add(userID, inventoryURL); + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); + return; + } + } + } + } + } + + // else put a null; it means that the methods should forward to local grid's inventory + m_InventoryURLs.Add(userID, null); + } + + private void DropInventoryServiceURL(UUID userID) + { + lock (m_InventoryURLs) + if (m_InventoryURLs.ContainsKey(userID)) + { + string url = m_InventoryURLs[userID]; + m_InventoryURLs.Remove(userID); + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url); + } + } + + public string GetInventoryServiceURL(UUID userID) + { + if (m_InventoryURLs.ContainsKey(userID)) + return m_InventoryURLs[userID]; + + else + CacheInventoryServiceURL(userID); + + return m_InventoryURLs[userID]; + } + #endregion + + #region IInventoryService + + public bool CreateUserInventory(UUID userID) + { + return m_LocalGridInventoryService.CreateUserInventory(userID); + } + + public List GetInventorySkeleton(UUID userId) + { + return m_LocalGridInventoryService.GetInventorySkeleton(userId); + } + + public InventoryCollection GetUserInventory(UUID userID) + { + return null; + } + + public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) + { + } + + public InventoryFolderBase GetRootFolder(UUID userID) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); + + string invURL = GetInventoryServiceURL(userID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetRootFolder(userID); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetRootFolder(userID); + } + + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); + + string invURL = GetInventoryServiceURL(userID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetFolderForType(userID, type); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetFolderForType(userID, type); + } + + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) + { + m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); + + string invURL = GetInventoryServiceURL(userID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetFolderContent(userID, folderID); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetFolderContent(userID, folderID); + + } + + public List GetFolderItems(UUID userID, UUID folderID) + { + m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); + + string invURL = GetInventoryServiceURL(userID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetFolderItems(userID, folderID); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetFolderItems(userID, folderID); + + } + + public bool AddFolder(InventoryFolderBase folder) + { + if (folder == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); + + string invURL = GetInventoryServiceURL(folder.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.AddFolder(folder); + + IInventoryService connector = GetConnector(invURL); + + return connector.AddFolder(folder); + } + + public bool UpdateFolder(InventoryFolderBase folder) + { + if (folder == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); + + string invURL = GetInventoryServiceURL(folder.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.UpdateFolder(folder); + + IInventoryService connector = GetConnector(invURL); + + return connector.UpdateFolder(folder); + } + + public bool DeleteFolders(UUID ownerID, List folderIDs) + { + if (folderIDs == null) + return false; + if (folderIDs.Count == 0) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); + + string invURL = GetInventoryServiceURL(ownerID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs); + + IInventoryService connector = GetConnector(invURL); + + return connector.DeleteFolders(ownerID, folderIDs); + } + + public bool MoveFolder(InventoryFolderBase folder) + { + if (folder == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); + + string invURL = GetInventoryServiceURL(folder.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.MoveFolder(folder); + + IInventoryService connector = GetConnector(invURL); + + return connector.MoveFolder(folder); + } + + public bool PurgeFolder(InventoryFolderBase folder) + { + if (folder == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); + + string invURL = GetInventoryServiceURL(folder.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.PurgeFolder(folder); + + IInventoryService connector = GetConnector(invURL); + + return connector.PurgeFolder(folder); + } + + public bool AddItem(InventoryItemBase item) + { + if (item == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); + + string invURL = GetInventoryServiceURL(item.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.AddItem(item); + + IInventoryService connector = GetConnector(invURL); + + return connector.AddItem(item); + } + + public bool UpdateItem(InventoryItemBase item) + { + if (item == null) + return false; + + m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); + + string invURL = GetInventoryServiceURL(item.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.UpdateItem(item); + + IInventoryService connector = GetConnector(invURL); + + return connector.UpdateItem(item); + } + + public bool MoveItems(UUID ownerID, List items) + { + if (items == null) + return false; + if (items.Count == 0) + return true; + + m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); + + string invURL = GetInventoryServiceURL(ownerID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.MoveItems(ownerID, items); + + IInventoryService connector = GetConnector(invURL); + + return connector.MoveItems(ownerID, items); + } + + public bool DeleteItems(UUID ownerID, List itemIDs) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); + + if (itemIDs == null) + return false; + if (itemIDs.Count == 0) + return true; + + m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID); + + string invURL = GetInventoryServiceURL(ownerID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs); + + IInventoryService connector = GetConnector(invURL); + + return connector.DeleteItems(ownerID, itemIDs); + } + + public InventoryItemBase GetItem(InventoryItemBase item) + { + if (item == null) + return null; + m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); + + string invURL = GetInventoryServiceURL(item.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetItem(item); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetItem(item); + } + + public InventoryFolderBase GetFolder(InventoryFolderBase folder) + { + if (folder == null) + return null; + + m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); + + string invURL = GetInventoryServiceURL(folder.Owner); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetFolder(folder); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetFolder(folder); + } + + public bool HasInventoryForUser(UUID userID) + { + return false; + } + + public List GetActiveGestures(UUID userId) + { + return new List(); + } + + public int GetAssetPermissions(UUID userID, UUID assetID) + { + m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); + + string invURL = GetInventoryServiceURL(userID); + + if (invURL == null) // not there, forward to local inventory connector to resolve + return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID); + + IInventoryService connector = GetConnector(invURL); + + return connector.GetAssetPermissions(userID, assetID); + } + + #endregion + + private IInventoryService GetConnector(string url) + { + IInventoryService connector = null; + lock (m_connectors) + { + if (m_connectors.ContainsKey(url)) + { + connector = m_connectors[url]; + } + else + { + // We're instantiating this class explicitly, but this won't + // work in general, because the remote grid may be running + // an inventory server that has a different protocol. + // Eventually we will want a piece of protocol asking + // the remote server about its kind. Definitely cool thing to do! + connector = new RemoteXInventoryServicesConnector(url); + m_connectors.Add(url, connector); + } + } + return connector; + } + + } +} diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs deleted file mode 100644 index fc3393f..0000000 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs +++ /dev/null @@ -1,556 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using log4net; -using Nini.Config; -using System; -using System.Collections.Generic; -using System.Reflection; -using OpenSim.Framework; - -using OpenSim.Server.Base; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Services.Interfaces; -using OpenSim.Services.Connectors; -using OpenMetaverse; - -namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory -{ - public class HGInventoryBroker2 : ISharedRegionModule, IInventoryService - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - private static bool m_Enabled = false; - - private static IInventoryService m_LocalGridInventoryService; - private Dictionary m_connectors = new Dictionary(); - - // A cache of userIDs --> ServiceURLs, for HGBroker only - protected Dictionary m_InventoryURLs = new Dictionary(); - - private List m_Scenes = new List(); - - public Type ReplaceableInterface - { - get { return null; } - } - - public string Name - { - get { return "HGInventoryBroker2"; } - } - - public void Initialise(IConfigSource source) - { - IConfig moduleConfig = source.Configs["Modules"]; - if (moduleConfig != null) - { - string name = moduleConfig.GetString("InventoryServices", ""); - if (name == Name) - { - IConfig inventoryConfig = source.Configs["InventoryService"]; - if (inventoryConfig == null) - { - m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); - return; - } - - string localDll = inventoryConfig.GetString("LocalGridInventoryService", - String.Empty); - //string HGDll = inventoryConfig.GetString("HypergridInventoryService", - // String.Empty); - - if (localDll == String.Empty) - { - m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService"); - //return; - throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); - } - - Object[] args = new Object[] { source }; - m_LocalGridInventoryService = - ServerUtils.LoadPlugin(localDll, - args); - - if (m_LocalGridInventoryService == null) - { - m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service"); - return; - } - - m_Enabled = true; - m_log.InfoFormat("[HG INVENTORY CONNECTOR]: HG inventory broker enabled with inner connector of type {0}", m_LocalGridInventoryService.GetType()); - } - } - } - - public void PostInitialise() - { - } - - public void Close() - { - } - - public void AddRegion(Scene scene) - { - if (!m_Enabled) - return; - - m_Scenes.Add(scene); - - scene.RegisterModuleInterface(this); - - scene.EventManager.OnClientClosed += OnClientClosed; - - } - - public void RemoveRegion(Scene scene) - { - if (!m_Enabled) - return; - - m_Scenes.Remove(scene); - } - - public void RegionLoaded(Scene scene) - { - if (!m_Enabled) - return; - - m_log.InfoFormat("[HG INVENTORY CONNECTOR]: Enabled HG inventory for region {0}", scene.RegionInfo.RegionName); - - } - - #region URL Cache - - void OnClientClosed(UUID clientID, Scene scene) - { - if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache - { - ScenePresence sp = null; - foreach (Scene s in m_Scenes) - { - s.TryGetScenePresence(clientID, out sp); - if ((sp != null) && !sp.IsChildAgent && (s != scene)) - { - m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache", - scene.RegionInfo.RegionName, clientID); - return; - } - } - DropInventoryServiceURL(clientID); - } - } - - /// - /// Gets the user's inventory URL from its serviceURLs, if the user is foreign, - /// and sticks it in the cache - /// - /// - private void CacheInventoryServiceURL(UUID userID) - { - if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null) - { - // The user does not have a local account; let's cache its service URL - string inventoryURL = string.Empty; - ScenePresence sp = null; - foreach (Scene scene in m_Scenes) - { - scene.TryGetScenePresence(userID, out sp); - if (sp != null) - { - AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); - if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) - { - inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); - if (inventoryURL != null && inventoryURL != string.Empty) - { - inventoryURL = inventoryURL.Trim(new char[] { '/' }); - m_InventoryURLs.Add(userID, inventoryURL); - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); - return; - } - } - } - } - } - - // else put a null; it means that the methods should forward to local grid's inventory - m_InventoryURLs.Add(userID, null); - } - - private void DropInventoryServiceURL(UUID userID) - { - lock (m_InventoryURLs) - if (m_InventoryURLs.ContainsKey(userID)) - { - string url = m_InventoryURLs[userID]; - m_InventoryURLs.Remove(userID); - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url); - } - } - - public string GetInventoryServiceURL(UUID userID) - { - if (m_InventoryURLs.ContainsKey(userID)) - return m_InventoryURLs[userID]; - - else - CacheInventoryServiceURL(userID); - - return m_InventoryURLs[userID]; - } - #endregion - - #region IInventoryService - - public bool CreateUserInventory(UUID userID) - { - return m_LocalGridInventoryService.CreateUserInventory(userID); - } - - public List GetInventorySkeleton(UUID userId) - { - return m_LocalGridInventoryService.GetInventorySkeleton(userId); - } - - public InventoryCollection GetUserInventory(UUID userID) - { - return null; - } - - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - } - - public InventoryFolderBase GetRootFolder(UUID userID) - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); - - string invURL = GetInventoryServiceURL(userID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetRootFolder(userID); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetRootFolder(userID); - } - - public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); - - string invURL = GetInventoryServiceURL(userID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetFolderForType(userID, type); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetFolderForType(userID, type); - } - - public InventoryCollection GetFolderContent(UUID userID, UUID folderID) - { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); - - string invURL = GetInventoryServiceURL(userID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetFolderContent(userID, folderID); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetFolderContent(userID, folderID); - - } - - public List GetFolderItems(UUID userID, UUID folderID) - { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); - - string invURL = GetInventoryServiceURL(userID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetFolderItems(userID, folderID); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetFolderItems(userID, folderID); - - } - - public bool AddFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); - - string invURL = GetInventoryServiceURL(folder.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.AddFolder(folder); - - IInventoryService connector = GetConnector(invURL); - - return connector.AddFolder(folder); - } - - public bool UpdateFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); - - string invURL = GetInventoryServiceURL(folder.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.UpdateFolder(folder); - - IInventoryService connector = GetConnector(invURL); - - return connector.UpdateFolder(folder); - } - - public bool DeleteFolders(UUID ownerID, List folderIDs) - { - if (folderIDs == null) - return false; - if (folderIDs.Count == 0) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); - - string invURL = GetInventoryServiceURL(ownerID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs); - - IInventoryService connector = GetConnector(invURL); - - return connector.DeleteFolders(ownerID, folderIDs); - } - - public bool MoveFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); - - string invURL = GetInventoryServiceURL(folder.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.MoveFolder(folder); - - IInventoryService connector = GetConnector(invURL); - - return connector.MoveFolder(folder); - } - - public bool PurgeFolder(InventoryFolderBase folder) - { - if (folder == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); - - string invURL = GetInventoryServiceURL(folder.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.PurgeFolder(folder); - - IInventoryService connector = GetConnector(invURL); - - return connector.PurgeFolder(folder); - } - - public bool AddItem(InventoryItemBase item) - { - if (item == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); - - string invURL = GetInventoryServiceURL(item.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.AddItem(item); - - IInventoryService connector = GetConnector(invURL); - - return connector.AddItem(item); - } - - public bool UpdateItem(InventoryItemBase item) - { - if (item == null) - return false; - - m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); - - string invURL = GetInventoryServiceURL(item.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.UpdateItem(item); - - IInventoryService connector = GetConnector(invURL); - - return connector.UpdateItem(item); - } - - public bool MoveItems(UUID ownerID, List items) - { - if (items == null) - return false; - if (items.Count == 0) - return true; - - m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); - - string invURL = GetInventoryServiceURL(ownerID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.MoveItems(ownerID, items); - - IInventoryService connector = GetConnector(invURL); - - return connector.MoveItems(ownerID, items); - } - - public bool DeleteItems(UUID ownerID, List itemIDs) - { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); - - if (itemIDs == null) - return false; - if (itemIDs.Count == 0) - return true; - - m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID); - - string invURL = GetInventoryServiceURL(ownerID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs); - - IInventoryService connector = GetConnector(invURL); - - return connector.DeleteItems(ownerID, itemIDs); - } - - public InventoryItemBase GetItem(InventoryItemBase item) - { - if (item == null) - return null; - m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); - - string invURL = GetInventoryServiceURL(item.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetItem(item); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetItem(item); - } - - public InventoryFolderBase GetFolder(InventoryFolderBase folder) - { - if (folder == null) - return null; - - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); - - string invURL = GetInventoryServiceURL(folder.Owner); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetFolder(folder); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetFolder(folder); - } - - public bool HasInventoryForUser(UUID userID) - { - return false; - } - - public List GetActiveGestures(UUID userId) - { - return new List(); - } - - public int GetAssetPermissions(UUID userID, UUID assetID) - { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); - - string invURL = GetInventoryServiceURL(userID); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID); - - IInventoryService connector = GetConnector(invURL); - - return connector.GetAssetPermissions(userID, assetID); - } - - #endregion - - private IInventoryService GetConnector(string url) - { - IInventoryService connector = null; - lock (m_connectors) - { - if (m_connectors.ContainsKey(url)) - { - connector = m_connectors[url]; - } - else - { - // We're instantiating this class explicitly, but this won't - // work in general, because the remote grid may be running - // an inventory server that has a different protocol. - // Eventually we will want a piece of protocol asking - // the remote server about its kind. Definitely cool thing to do! - connector = new RemoteXInventoryServicesConnector(url); - m_connectors.Add(url, connector); - } - } - return connector; - } - - } -} -- cgit v1.1 From 7e7429117614b425512d67c9d5696a69248d0536 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 3 May 2010 01:50:32 +0200 Subject: Make the IUserAccountData properly unpack the god mode data, so grid gods work again --- .../Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | 2 +- OpenSim/Services/Interfaces/IUserAccountService.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 1527db2..38c191a 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs @@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) { - m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUSerAccount {0}", userID); + m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index befd14e..e316731 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -84,11 +84,11 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("ScopeID")) UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("UserLevel")) - Convert.ToInt32(kvp["UserLevel"].ToString()); + UserLevel = Convert.ToInt32(kvp["UserLevel"].ToString()); if (kvp.ContainsKey("UserFlags")) - Convert.ToInt32(kvp["UserFlags"].ToString()); + UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); if (kvp.ContainsKey("UserTitle")) - Email = kvp["UserTitle"].ToString(); + UserTitle = kvp["UserTitle"].ToString(); if (kvp.ContainsKey("Created")) Convert.ToInt32(kvp["Created"].ToString()); -- cgit v1.1 From d9910d2a444537216630024ff464d56b2b77e5dd Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 00:08:28 +0100 Subject: test commit --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index a004cad..570f732 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) Contributors, http://opensimulator.org/ +Copyright (c) Contributors, http://opensimulator.org/ See CONTRIBUTORS.TXT for a full list of copyright holders. Redistribution and use in source and binary forms, with or without -- cgit v1.1 From 02f9b3ac2da0911d558ccd97523d9b274a4508c5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 00:09:47 +0100 Subject: And again --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 570f732..a004cad 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) Contributors, http://opensimulator.org/ +Copyright (c) Contributors, http://opensimulator.org/ See CONTRIBUTORS.TXT for a full list of copyright holders. Redistribution and use in source and binary forms, with or without -- cgit v1.1 From fbd422253385d6d198d9eb041e56ba9c0b0bce12 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 00:11:12 +0100 Subject: Last time? --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index a004cad..570f732 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) Contributors, http://opensimulator.org/ +Copyright (c) Contributors, http://opensimulator.org/ See CONTRIBUTORS.TXT for a full list of copyright holders. Redistribution and use in source and binary forms, with or without -- cgit v1.1 From af0ffb2a5aa3bd2889f9aa45730ea71d68763425 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 00:15:55 +0100 Subject: Add URL_REQUEST_* script constants --- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index ee35fa4..dba6502 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -548,5 +548,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int STATS_ACTIVE_SCRIPTS = 19; public const int STATS_SCRIPT_LPS = 20; + public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; + public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; } } -- cgit v1.1 From 18f6714451d0b351fc2145d8600b9fd78696a2bf Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 2 May 2010 19:56:40 -0400 Subject: Modify README.txt to trigger new build --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index f1a71be..2bf28ce 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ Welcome to OpenSim! -== OVERVIEW == +=== OVERVIEW === OpenSim is a BSD Licensed Open Source project to develop a functioning virtual worlds server platform capable of supporting multiple clients -- cgit v1.1 From 74d63d4da2e0e8b7367a44787cda31c2d5b59c6b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 2 May 2010 20:08:19 -0400 Subject: Modify README.txt to trigger new build /again/ --- BUILDING.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.txt b/BUILDING.txt index 03fb482..972fe46 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -1,4 +1,4 @@ -== Building OpenSim == +=== Building OpenSim === === Building on Windows === -- cgit v1.1 From 45301d8a4984b0a6e5e5df4741175ce81729810d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 01:14:38 +0100 Subject: Defer sending of CHANGED_OWNER to make it work on rezzed objects and attachments in addition to objects sold in place --- OpenSim/Framework/TaskInventoryItem.cs | 11 +++++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 2b0096b..2cb7895 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -122,6 +122,8 @@ namespace OpenSim.Framework private int _type = 0; private UUID _oldID; + private bool _ownerChanged = false; + public UUID AssetID { get { return _assetID; @@ -320,6 +322,15 @@ namespace OpenSim.Framework } } + public bool OwnerChanged { + get { + return _ownerChanged; + } + set { + _ownerChanged = value; + } + } + // See ICloneable #region ICloneable Members diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 4da63c0..eea73ff 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -955,10 +955,9 @@ namespace OpenSim.Region.Framework.Scenes item.CurrentPermissions &= item.NextPermissions; item.BasePermissions &= item.NextPermissions; item.EveryonePermissions &= item.NextPermissions; + item.OwnerChanged = true; } } - - m_part.TriggerScriptChangedEvent(Changed.OWNER); } public void ApplyGodPermissions(uint perms) @@ -1042,7 +1041,6 @@ namespace OpenSim.Region.Framework.Scenes if (engines == null) return; - lock (m_items) { foreach (TaskInventoryItem item in m_items.Values) @@ -1052,7 +1050,10 @@ namespace OpenSim.Region.Framework.Scenes foreach (IScriptModule engine in engines) { if (engine != null) + { + engine.PostScriptEvent(item.ItemID, "changed", new Object[] { Changed.OWNER }); engine.ResumeScript(item.ItemID); + } } } } -- cgit v1.1 From 7a8ad1ceb23b768863a05997d3c0397dc301a323 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 May 2010 01:30:57 +0100 Subject: Make in-place sale send CHANGED_OWNER again --- OpenSim/Region/Framework/Scenes/Scene.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 61a2956..3e4694a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4522,6 +4522,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart child in partList) { child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); + child.TriggerScriptChangedEvent(Changed.OWNER); child.ApplyNextOwnerPermissions(); } } @@ -4531,6 +4532,8 @@ namespace OpenSim.Region.Framework.Scenes group.HasGroupChanged = true; part.GetProperties(remoteClient); + part.TriggerScriptChangedEvent(Changed.OWNER); + group.ResumeScripts(); part.ScheduleFullUpdate(); break; -- cgit v1.1 From b8362499263a7034cc66cbacec2a2cf6a480b7eb Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 2 May 2010 20:44:34 -0400 Subject: * Untested Suggestion from lkalif to change remoteClient.SendMapBlock(blocks, 0); to remoteClient.SendMapBlock(blocks, 2); in OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs --- OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 56b50dc..a1a4f9e 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap data.Y = 0; blocks.Add(data); - remoteClient.SendMapBlock(blocks, 0); + remoteClient.SendMapBlock(blocks, 2); } private Scene GetClientScene(IClientAPI client) -- cgit v1.1 From 7b80060df1559df4f91d499a9e2374412aa67e91 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 2 May 2010 21:00:20 -0400 Subject: * Another one of those super useful commit tests --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 2bf28ce..f1a71be 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ Welcome to OpenSim! -=== OVERVIEW === +== OVERVIEW == OpenSim is a BSD Licensed Open Source project to develop a functioning virtual worlds server platform capable of supporting multiple clients -- cgit v1.1