From 2ceff87a02d9862497d1d8fa965851ae2d9c9b1b Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 11 Jul 2007 17:47:25 +0000 Subject: [PATCH] More work on UserProfile and inventory cache (still currently not enabled). Asset uploading over CAPS now works, and although inventory isn't really working yet, this should now at least enables texturing of prims. --- .../Communications/CommunicationsManager.cs | 4 + .../Communications/IInventoryServices.cs | 17 +++ .../Communications/caches/CachedUserInfo.cs | 77 +++++++++++ .../Communications/caches}/InventoryFolder.cs | 2 +- .../caches}/UserProfileCache.cs | 42 +++++- OpenSim/Framework/Data/InventoryData.cs | 6 +- .../General/Interfaces/IClientAPI.cs | 4 + .../Framework/Servers/BinaryStreamHandler.cs | 44 +++++++ OpenSim/Framework/Servers/RestMethod.cs | 1 + OpenSim/Region/Caches/CachedUserInfo.cs | 20 --- OpenSim/Region/Capabilities/Caps.cs | 20 +-- .../Region/Capabilities/LLSDCapsDetails.cs | 2 +- .../ClientStack/Assets/InventoryCache.cs | 1 + OpenSim/Region/ClientStack/ClientView.API.cs | 122 ++++++++++++++---- prebuild.xml | 48 +++---- 15 files changed, 326 insertions(+), 84 deletions(-) create mode 100644 OpenSim/Framework/Communications/IInventoryServices.cs create mode 100644 OpenSim/Framework/Communications/caches/CachedUserInfo.cs rename OpenSim/{Region/Caches => Framework/Communications/caches}/InventoryFolder.cs (93%) rename OpenSim/{Region/Caches => Framework/Communications/caches}/UserProfileCache.cs (50%) create mode 100644 OpenSim/Framework/Servers/BinaryStreamHandler.cs delete mode 100644 OpenSim/Region/Caches/CachedUserInfo.cs diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 109d027394..ebc9632d4f 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -32,6 +32,7 @@ using OpenSim.Framework.Data; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Servers; +using OpenSim.Framework.Communications.Caches; namespace OpenSim.Framework.Communications { @@ -40,12 +41,15 @@ namespace OpenSim.Framework.Communications { public IUserServices UserServer; public IGridServices GridServer; + public IInventoryServices InventoryServer; public IInterRegionCommunications InterRegion; + public UserProfileCache UserProfilesCache; public NetworkServersInfo ServersInfo; public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer) { ServersInfo = serversInfo; + UserProfilesCache = new UserProfileCache(this); } #region Packet Handlers diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs new file mode 100644 index 0000000000..0b05834c14 --- /dev/null +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Data; +using libsecondlife; +using OpenSim.Framework.Communications.Caches; + +namespace OpenSim.Framework.Communications +{ + public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo); + public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo); + + public interface IInventoryServices + { + void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); + } +} diff --git a/OpenSim/Framework/Communications/caches/CachedUserInfo.cs b/OpenSim/Framework/Communications/caches/CachedUserInfo.cs new file mode 100644 index 0000000000..1c779e9a53 --- /dev/null +++ b/OpenSim/Framework/Communications/caches/CachedUserInfo.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Data; +using libsecondlife; + +namespace OpenSim.Framework.Communications.Caches +{ + public class CachedUserInfo + { + public UserProfileData UserProfile; + //public Dictionary Folders = new Dictionary(); + public InventoryFolder RootFolder; + + public CachedUserInfo() + { + + } + + /// + /// + /// + /// + /// + public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) + { + if (userID == UserProfile.UUID) + { + if (this.RootFolder == null) + { + if (folderInfo.parentID == LLUUID.Zero) + { + this.RootFolder = folderInfo; + } + } + else + { + if (this.RootFolder.folderID == folderInfo.parentID) + { + this.RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); + } + else + { + InventoryFolder pFolder = this.RootFolder.HasSubFolder(folderInfo.parentID); + if (pFolder != null) + { + pFolder.SubFolders.Add(folderInfo.folderID, folderInfo); + } + } + } + } + } + + public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) + { + if (userID == UserProfile.UUID) + { + if (this.RootFolder != null) + { + if (itemInfo.parentFolderID == this.RootFolder.folderID) + { + this.RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); + } + else + { + InventoryFolder pFolder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); + if (pFolder != null) + { + pFolder.Items.Add(itemInfo.inventoryID, itemInfo); + } + } + } + + } + } + } +} diff --git a/OpenSim/Region/Caches/InventoryFolder.cs b/OpenSim/Framework/Communications/caches/InventoryFolder.cs similarity index 93% rename from OpenSim/Region/Caches/InventoryFolder.cs rename to OpenSim/Framework/Communications/caches/InventoryFolder.cs index 364a1840b4..eaddf19651 100644 --- a/OpenSim/Region/Caches/InventoryFolder.cs +++ b/OpenSim/Framework/Communications/caches/InventoryFolder.cs @@ -4,7 +4,7 @@ using System.Text; using libsecondlife; using OpenSim.Framework.Data; -namespace OpenSim.Region.Caches +namespace OpenSim.Framework.Communications.Caches { public class InventoryFolder : InventoryFolderBase { diff --git a/OpenSim/Region/Caches/UserProfileCache.cs b/OpenSim/Framework/Communications/caches/UserProfileCache.cs similarity index 50% rename from OpenSim/Region/Caches/UserProfileCache.cs rename to OpenSim/Framework/Communications/caches/UserProfileCache.cs index 0717e55e5f..0ee63ba94d 100644 --- a/OpenSim/Region/Caches/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/caches/UserProfileCache.cs @@ -3,16 +3,19 @@ using System.Collections.Generic; using System.Text; using libsecondlife; using OpenSim.Framework.Data; +using OpenSim.Framework.Communications; -namespace OpenSim.Region.Caches +namespace OpenSim.Framework.Communications.Caches { public class UserProfileCache { public Dictionary UserProfiles = new Dictionary(); - public UserProfileCache() - { + private CommunicationsManager m_parent; + public UserProfileCache(CommunicationsManager parent) + { + m_parent = parent; } /// @@ -22,7 +25,36 @@ namespace OpenSim.Region.Caches /// public void AddNewUser(LLUUID userID) { + if (!this.UserProfiles.ContainsKey(userID)) + { + CachedUserInfo userInfo = new CachedUserInfo(); + userInfo.UserProfile = this.RequestUserProfileForUser(userID); + this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); + if (userInfo.UserProfile != null) + { + this.UserProfiles.Add(userID, userInfo); + } + else + { + //no profile for this user, what do we do now? + } + } + else + { + //already have a cached profile for this user + //we should make sure its upto date with the user server version + } + } + /// + /// A new user has moved into a region in this instance + /// so get info from servers + /// + /// + /// + public void AddNewUser(string firstName, string lastName) + { + } /// @@ -40,9 +72,9 @@ namespace OpenSim.Region.Caches /// Request the user profile from User server /// /// - private void RequestUserProfileForUser(LLUUID userID) + private UserProfileData RequestUserProfileForUser(LLUUID userID) { - + return this.m_parent.UserServer.GetUserProfile(userID); } /// diff --git a/OpenSim/Framework/Data/InventoryData.cs b/OpenSim/Framework/Data/InventoryData.cs index fe2e25c28a..7253cc70ca 100644 --- a/OpenSim/Framework/Data/InventoryData.cs +++ b/OpenSim/Framework/Data/InventoryData.cs @@ -48,7 +48,7 @@ namespace OpenSim.Framework.Data /// public int type; /// - /// The folder this item is contained in (NULL_KEY = Inventory Root) + /// The folder this item is contained in /// public LLUUID parentFolderID; /// @@ -56,7 +56,7 @@ namespace OpenSim.Framework.Data /// public LLUUID avatarID; /// - /// The creator of this folder + /// The creator of this item /// public LLUUID creatorsID; /// @@ -91,7 +91,7 @@ namespace OpenSim.Framework.Data /// public LLUUID agentID; /// - /// The folder this folder is contained in (NULL_KEY for root) + /// The folder this folder is contained in /// public LLUUID parentID; /// diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 1b0c682506..fe1e9dc320 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -30,6 +30,7 @@ using System.Net; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Types; +using OpenSim.Framework.Data; namespace OpenSim.Framework.Interfaces { @@ -176,5 +177,8 @@ namespace OpenSim.Framework.Interfaces void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); + + void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items); + void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); } } diff --git a/OpenSim/Framework/Servers/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/BinaryStreamHandler.cs new file mode 100644 index 0000000000..302dbff039 --- /dev/null +++ b/OpenSim/Framework/Servers/BinaryStreamHandler.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace OpenSim.Framework.Servers +{ + + public class BinaryStreamHandler : BaseStreamHandler + { + BinaryMethod m_restMethod; + + override public byte[] Handle(string path, Stream request) + { + byte[] data = ReadFully(request); + string param = GetParam(path); + string responseString = m_restMethod(data, path, param); + + return Encoding.UTF8.GetBytes(responseString); + } + + public BinaryStreamHandler(string httpMethod, string path, BinaryMethod restMethod) + : base(httpMethod, path) + { + m_restMethod = restMethod; + } + + public byte[] ReadFully(Stream stream) + { + byte[] buffer = new byte[32768]; + using (MemoryStream ms = new MemoryStream()) + { + while (true) + { + int read = stream.Read(buffer, 0, buffer.Length); + if (read <= 0) + return ms.ToArray(); + ms.Write(buffer, 0, read); + } + } + } + } + +} diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs index c6cb230c93..2a92fc1fc6 100644 --- a/OpenSim/Framework/Servers/RestMethod.cs +++ b/OpenSim/Framework/Servers/RestMethod.cs @@ -28,4 +28,5 @@ namespace OpenSim.Framework.Servers { public delegate string RestMethod( string request, string path, string param ); + public delegate string BinaryMethod(byte[] data, string path, string param); } diff --git a/OpenSim/Region/Caches/CachedUserInfo.cs b/OpenSim/Region/Caches/CachedUserInfo.cs deleted file mode 100644 index 08a7848d51..0000000000 --- a/OpenSim/Region/Caches/CachedUserInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Data; -using libsecondlife; - -namespace OpenSim.Region.Caches -{ - public class CachedUserInfo - { - public UserProfileData UserProfile; - //public Dictionary Folders = new Dictionary(); - public InventoryFolder RootFolder; - - public CachedUserInfo() - { - - } - } -} diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index 6068076b24..db8df9b856 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Text; +using System.IO; using libsecondlife; using OpenSim.Framework.Servers; using OpenSim.Framework.Types; @@ -118,7 +119,7 @@ namespace OpenSim.Region.Capabilities string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; caps.MapLayer = capsBaseUrl + m_mapLayerPath; - // caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; + caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; return caps; } @@ -253,10 +254,12 @@ namespace OpenSim.Region.Capabilities LLUUID newInvItem = LLUUID.Random(); string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); + + string capsBase = "/CAPS/" + m_capsObjectPath; + httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); - AddLegacyCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); - - string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; + + string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath +uploaderPath; //Console.WriteLine("uploader url is " + uploaderURL); res += ""; res += "uploader" + uploaderURL + ""; @@ -303,10 +306,10 @@ namespace OpenSim.Region.Capabilities } - public string uploaderCaps(string request, string path, string param) + public string uploaderCaps(byte[] data, string path, string param) { - Encoding _enc = Encoding.UTF8; - byte[] data = _enc.GetBytes(request); + //Encoding _enc = Encoding.UTF8; + //byte[] data = _enc.GetBytes(request); //Console.WriteLine("recieved upload " + Util.FieldToString(data)); LLUUID inv = this.inventoryItemID; string res = ""; @@ -324,7 +327,8 @@ namespace OpenSim.Region.Capabilities OnUpLoad(newAssetID, inv, data); } - /*FileStream fs = File.Create("upload.jp2"); + /* + FileStream fs = File.Create("upload.jp2"); BinaryWriter bw = new BinaryWriter(fs); bw.Write(data); bw.Close(); diff --git a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs index 1f8b24293d..1522559863 100644 --- a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs @@ -4,7 +4,7 @@ namespace OpenSim.Region.Capabilities public class LLSDCapsDetails { public string MapLayer = ""; - //public string NewFileAgentInventory = ""; + public string NewFileAgentInventory = ""; //public string EventQueueGet = ""; public LLSDCapsDetails() diff --git a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs index 082c0d068d..e2cfa46b9d 100644 --- a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs +++ b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs @@ -196,6 +196,7 @@ namespace OpenSim.Assets public void FetchInventoryDescendents(ClientView userInfo, FetchInventoryDescendentsPacket FetchDescend) { + if (this._agentsInventory.ContainsKey(userInfo.AgentID)) { AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID]; diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 225e906693..d5b6b52f66 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -35,6 +35,7 @@ using libsecondlife.Packets; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; +using OpenSim.Framework.Data; namespace OpenSim.Region.ClientStack { @@ -76,7 +77,7 @@ namespace OpenSim.Region.ClientStack public event GenericCall6 OnRemoveAvatar; public event RequestMapBlocks OnRequestMapBlocks; public event TeleportLocationRequest OnTeleportLocationRequest; - + public event UUIDNameRequest OnNameFromUUIDRequest; public event ParcelPropertiesRequest OnParcelPropertiesRequest; @@ -188,7 +189,7 @@ namespace OpenSim.Region.ClientStack mov.Data.RegionHandle = regInfo.RegionHandle; mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this - if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0)) + if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0)) { mov.Data.Position = this.startpos; } @@ -325,11 +326,11 @@ namespace OpenSim.Region.ClientStack /// /// /// - public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint ) + public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint) { IPAddress neighbourIP = neighbourEndPoint.Address; - ushort neighbourPort = (ushort) neighbourEndPoint.Port; - + ushort neighbourPort = (ushort)neighbourEndPoint.Port; + EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); enablesimpacket.SimulatorInfo.Handle = neighbourHandle; @@ -405,7 +406,7 @@ namespace OpenSim.Region.ClientStack mapReply.Data[i].Name = _enc.GetBytes(mapBlocks[i].Name); mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags; mapReply.Data[i].Access = mapBlocks[i].Access; - mapReply.Data[i].Agents = mapBlocks[i].Agents; + mapReply.Data[i].Agents = mapBlocks[i].Agents; } this.OutPacket(mapReply); } @@ -421,7 +422,7 @@ namespace OpenSim.Region.ClientStack OutPacket(tpLocal); } - public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags) + public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags) { TeleportFinishPacket teleport = new TeleportFinishPacket(); teleport.Info.AgentID = this.AgentID; @@ -439,7 +440,7 @@ namespace OpenSim.Region.ClientStack teleport.Info.SimIP = ip; teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; teleport.Info.LocationID = 4; - teleport.Info.TeleportFlags = 1 << 4; + teleport.Info.TeleportFlags = 1 << 4; OutPacket(teleport); } @@ -492,6 +493,81 @@ namespace OpenSim.Region.ClientStack OutPacket(kill); } + public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items) + { + Encoding enc = Encoding.ASCII; + uint FULL_MASK_PERMISSIONS = 2147483647; + InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); + descend.AgentData.AgentID = this.AgentId; + descend.AgentData.OwnerID = ownerID; + descend.AgentData.FolderID = folderID; + descend.AgentData.Descendents = items.Count; + descend.AgentData.Version = 0; + descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; + int i = 0; + foreach (InventoryItemBase item in items) + { + descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); + descend.ItemData[i].ItemID = item.inventoryID; + descend.ItemData[i].AssetID = item.assetID; + descend.ItemData[i].CreatorID = item.creatorsID; + descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS; + descend.ItemData[i].CreationDate = 1000; + descend.ItemData[i].Description = enc.GetBytes(item.inventoryDescription+ "\0"); + descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS; + descend.ItemData[i].Flags = 1; + descend.ItemData[i].FolderID = item.parentFolderID; + descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS; + descend.ItemData[i].InvType = (sbyte)item.type; + descend.ItemData[i].Name = enc.GetBytes(item.inventoryName+ "\0"); + descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS; + descend.ItemData[i].OwnerID = item.avatarID; + descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS; + descend.ItemData[i].SalePrice = 0; + descend.ItemData[i].SaleType = 0; + descend.ItemData[i].Type = (sbyte)item.type; + descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100,descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); + + i++; + } + + this.OutPacket(descend); + + } + + public void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item) + { + Encoding enc = Encoding.ASCII; + uint FULL_MASK_PERMISSIONS = 2147483647; + FetchInventoryReplyPacket inventoryReply = new FetchInventoryReplyPacket(); + inventoryReply.AgentData.AgentID = this.AgentId; + inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; + inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock(); + inventoryReply.InventoryData[0].ItemID = item.inventoryID; + inventoryReply.InventoryData[0].AssetID = item.assetID; + inventoryReply.InventoryData[0].CreatorID = item.creatorsID; + inventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; + inventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + inventoryReply.InventoryData[0].Description = enc.GetBytes(item.inventoryDescription + "\0"); + inventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; + inventoryReply.InventoryData[0].Flags = 0; + inventoryReply.InventoryData[0].FolderID = item.parentFolderID; + inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + inventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; + inventoryReply.InventoryData[0].InvType = (sbyte)item.type; + inventoryReply.InventoryData[0].Name = enc.GetBytes(item.inventoryName + "\0"); + inventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS; + inventoryReply.InventoryData[0].OwnerID = item.avatarID; + inventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS; + inventoryReply.InventoryData[0].SalePrice = 0; + inventoryReply.InventoryData[0].SaleType = 0; + inventoryReply.InventoryData[0].Type = (sbyte)item.type; + inventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, inventoryReply.InventoryData[0].GroupID, 100, inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); + + this.OutPacket(inventoryReply); + } + #region Appearance/ Wearables Methods @@ -545,20 +621,20 @@ namespace OpenSim.Region.ClientStack OutPacket(avp); } - public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) - { - AvatarAnimationPacket ani = new AvatarAnimationPacket(); - ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; - ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); - ani.AnimationSourceList[0].ObjectID = sourceAgentId; - ani.Sender = new AvatarAnimationPacket.SenderBlock(); - ani.Sender.ID = sourceAgentId; - ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; - ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); - ani.AnimationList[0].AnimID = animID; - ani.AnimationList[0].AnimSequenceID = seq; - this.OutPacket(ani); - } + public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) + { + AvatarAnimationPacket ani = new AvatarAnimationPacket(); + ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; + ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); + ani.AnimationSourceList[0].ObjectID = sourceAgentId; + ani.Sender = new AvatarAnimationPacket.SenderBlock(); + ani.Sender.ID = sourceAgentId; + ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; + ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); + ani.AnimationList[0].AnimID = animID; + ani.AnimationList[0].AnimSequenceID = seq; + this.OutPacket(ani); + } #endregion @@ -674,7 +750,7 @@ namespace OpenSim.Region.ClientStack /// /// /// - public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID , uint flags) + public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags) { ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); outPacket.RegionData.RegionHandle = regionHandle; diff --git a/prebuild.xml b/prebuild.xml index 248fdf97a1..99a54f4c92 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -54,6 +54,29 @@ + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + @@ -73,6 +96,7 @@ + @@ -103,29 +127,6 @@ - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - @@ -603,6 +604,7 @@ +