From 70fa30204272e874b8e3acccdc2e22cd4e42b2b2 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 22 Jul 2007 11:44:36 +0000 Subject: * Some work in progress code: Inventory cache, start of inventory server/service, userprofile cache, inventory handling. (non of it is enabled yet (or at least it shouldn't be). * Fixed some of the problems with crossing regions when flying: you should no longer sink to ground level when crossing (should keep roughly your right height). Should no longer sometimes get sent back to the centre of the current region when attempting to border cross. But instead sometimes you will find you avatar stop at the edge of region and you will need to start moving again to retry the crossing (which should then work). This code is partly based on Babblefrog's issue #212 patch. [I think I have some ideas of how to solve the stopping at edges problem, just want to get the inventory code done first] * Capabilities code has now been moved to the OpenSim.Framework.Communications project as some of the caps code will be tightly tied to inventory/asset handling and it was causing a two way reference problem when it was in its own project/dll. This is a Big commit as I was going to keep my inventory work local until I had it in a working state, in case it brakes anything, but its getting harder to keep in sync with svn. --- OpenSim/Region/ClientStack/ClientView.API.cs | 4 +++- .../ClientStack/ClientView.AgentAssetUpload.cs | 3 ++- .../ClientStack/ClientView.ProcessPackets.cs | 23 +++++++++++++--------- OpenSim/Region/ClientStack/ClientView.cs | 3 ++- OpenSim/Region/ClientStack/PacketServer.cs | 2 +- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- OpenSim/Region/ClientStack/UDPServer.cs | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index c99c365..956f2b4 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -81,8 +81,10 @@ namespace OpenSim.Region.ClientStack public event RequestMapBlocks OnRequestMapBlocks; public event TeleportLocationRequest OnTeleportLocationRequest; + public event CreateNewInventoryItem OnCreateNewInventoryItem; public event CreateInventoryFolder OnCreateNewInventoryFolder; public event FetchInventoryDescendents OnFetchInventoryDescendents; + public event FetchInventory OnFetchInventory; public event RequestTaskInventory OnRequestTaskInventory; public event UUIDNameRequest OnNameFromUUIDRequest; @@ -549,7 +551,7 @@ namespace OpenSim.Region.ClientStack } - public void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item) + public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) { Encoding enc = Encoding.ASCII; uint FULL_MASK_PERMISSIONS = 2147483647; diff --git a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs b/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs index 109f7e6..a785eff 100644 --- a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs +++ b/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs @@ -33,7 +33,8 @@ using OpenSim.Assets; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; -using OpenSim.Region.Caches; +using OpenSim.Framework.Communications.Caches; + namespace OpenSim.Region.ClientStack { diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 267e7ee..1613aa1 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -387,11 +387,9 @@ namespace OpenSim.Region.ClientStack { CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; this.OnCreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); - //m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); } break; case PacketType.CreateInventoryItem: - //Console.WriteLine(Pack.ToString()); CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) { @@ -399,20 +397,28 @@ namespace OpenSim.Region.ClientStack } else { - // Console.Write(Pack.ToString()); - this.CreateInventoryItem(createItem); + if (this.OnCreateNewInventoryItem != null) + { + this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID, + Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType, + createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask); + } } break; case PacketType.FetchInventory: - //Console.WriteLine("fetch item packet"); - FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; - m_inventoryCache.FetchInventory(this, FetchInventory); + if (this.OnFetchInventory != null) + { + FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; + for (int i = 0; i < FetchInventory.InventoryData.Length; i++) + { + this.OnFetchInventory(this, FetchInventory.InventoryData[i].ItemID, FetchInventory.InventoryData[i].OwnerID); + } + } break; case PacketType.FetchInventoryDescendents: if (this.OnFetchInventoryDescendents != null) { FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; - // m_inventoryCache.FetchInventoryDescendents(this, Fetch); this.OnFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, Fetch.InventoryData.SortOrder); } break; @@ -450,7 +456,6 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.RequestTaskInventory: - // Console.WriteLine(Pack.ToString()); RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; if (this.OnRequestTaskInventory != null) { diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 90ca600..3fd3a46 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -40,7 +40,8 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Inventory; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; -using OpenSim.Region.Caches; +using OpenSim.Framework.Communications.Caches; + using Timer=System.Timers.Timer; namespace OpenSim.Region.ClientStack diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 7b15ab4..596cdbe 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs @@ -33,7 +33,7 @@ using OpenSim.Assets; using OpenSim.Framework; using OpenSim.Framework.Types; using OpenSim.Framework.Interfaces; -using OpenSim.Region.Caches; +using OpenSim.Framework.Communications.Caches; namespace OpenSim.Region.ClientStack { diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 1651ec2..d91cd95 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -36,11 +36,11 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; using OpenSim.Framework.Types; using OpenSim.Physics.Manager; -using OpenSim.Region.Caches; using OpenSim.Region.Environment; using libsecondlife; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Caches; namespace OpenSim.Region.ClientStack { diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 2c10df9..ec64bad 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -35,7 +35,7 @@ using OpenSim.Framework; using OpenSim.Framework.Types; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using OpenSim.Region.Caches; +using OpenSim.Framework.Communications.Caches; namespace OpenSim.Region.ClientStack { -- cgit v1.1