From 3c9cba162739b93a07067d8a286f6dad55e02217 Mon Sep 17 00:00:00 2001 From: diva Date: Sun, 5 Apr 2009 03:27:50 +0000 Subject: Added CreateObject(regionhandle, userID, itemID) to post objects that are to be fetched from the user's inventory server and rezzed in the region. Added all code necessary to fetch the item and the asset, and rez it inworld. The access to the item is uncap-ed and unverified -- I may place it later either under a cap or with auth verification. But in this model regions don't have the user's inventory, so they would have to guess the item IDs. Added safemode config to Standalone Hypergrid, similar effect to AllowRegionAccessToInventory in Inventory Server. Everyone should have these vars set to their default values except me! --- .../Communications/Services/HGInventoryService.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications/Services/HGInventoryService.cs') diff --git a/OpenSim/Framework/Communications/Services/HGInventoryService.cs b/OpenSim/Framework/Communications/Services/HGInventoryService.cs index abb9b92..a3234bf 100644 --- a/OpenSim/Framework/Communications/Services/HGInventoryService.cs +++ b/OpenSim/Framework/Communications/Services/HGInventoryService.cs @@ -107,6 +107,17 @@ namespace OpenSim.Framework.Communications.Services public virtual void AddHttpHandlers() { httpServer.AddHTTPHandler("/InvCap/", CapHandler); + + // Un-cap'ed for now + httpServer.AddStreamHandler(new RestDeserialiseSecureHandler( + "POST", "/GetItem/", GetInventoryItem, CheckAuthSession)); + + } + + public InventoryItemBase GetInventoryItem(Guid id) + { + UUID itemID = new UUID(id); + return m_inventoryService.GetInventoryItem(itemID); } public bool CheckAuthSession(string session_id, string avatar_id) @@ -353,10 +364,15 @@ namespace OpenSim.Framework.Communications.Services m_log.DebugFormat("[HGStandaloneInvService]: client with uuid {0} is trying to get an item of owner {1}", item.Owner, item2.Owner); return asset; } + UUID assetID = item2.AssetID; + if (assetID != item.AssetID) + { + m_log.WarnFormat("[HGStandaloneInvService]: asset IDs don't match {0}, {1}", item.AssetID, item2.AssetID); + } // All good, get the asset //AssetBase theasset = m_assetProvider.FetchAsset(item.AssetID); - AssetBase theasset = FetchAsset(item.AssetID, (item.InvType == (int)InventoryType.Texture)); + AssetBase theasset = FetchAsset(assetID, (item.InvType == (int)InventoryType.Texture)); m_log.Debug("[HGStandaloneInvService] Found asset " + ((theasset == null) ? "NULL" : "Not Null")); if (theasset != null) -- cgit v1.1