From 94dded470d04f72c573bf0aa82e1f7522362c54a Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 15 Aug 2007 18:34:36 +0000 Subject: [PATCH] More work on inventory, can now create other inventory types, like Clothes and body parts. [Note while you can edit these, at the moment your changes won't be saved between restarts. This will be fixed very soon.] --- .../Cache/AssetTransactionManager.cs | 36 +++++- .../Communications/Cache/AssetTransactions.cs | 114 +++++++++++++++++- .../Communications/CommunicationsManager.cs | 2 + .../General/Interfaces/IClientAPI.cs | 5 + OpenSim/Framework/General/NullClientAPI.cs | 2 + OpenSim/Framework/UserManager/CAPSService.cs | 38 ++++++ OpenSim/Region/ClientStack/ClientView.API.cs | 2 + .../ClientStack/ClientView.ProcessPackets.cs | 35 +++--- .../Local/CommunicationsLocal.cs | 4 + .../Communications/Local/LocalLoginService.cs | 1 + .../Scenes/Scene.PacketHandlers.cs | 56 +++++---- OpenSim/Region/Environment/Scenes/Scene.cs | 3 + .../Environment/Scenes/SceneObjectGroup.cs | 1 - .../Examples/SimpleApp/MyNpcCharacter.cs | 2 + 14 files changed, 247 insertions(+), 54 deletions(-) create mode 100644 OpenSim/Framework/UserManager/CAPSService.cs diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs index f9f814abf9..1f5f99d1a3 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs @@ -41,14 +41,20 @@ namespace OpenSim.Framework.Communications.Caches public class AssetTransactionManager { // Fields + public CommunicationsManager CommsManager; public Dictionary AgentTransactions = new Dictionary(); + public AssetTransactionManager(CommunicationsManager commsManager) + { + CommsManager = commsManager; + } + // Methods public AgentAssetTransactions AddUser(LLUUID userID) { if (!this.AgentTransactions.ContainsKey(userID)) { - AgentAssetTransactions transactions = new AgentAssetTransactions(userID); + AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this); this.AgentTransactions.Add(userID, transactions); return transactions; } @@ -64,18 +70,38 @@ namespace OpenSim.Framework.Communications.Caches return null; } - public void HandleInventoryFromTransaction() + public void HandleInventoryFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { + AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); + if (transactions != null) + { + transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); + } + } - public void HandleUDPUploadRequest() + public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data) { + AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); + if (transactions != null) + { + AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); + if (uploader != null) + { + uploader.Initialise(remoteClient, assetID, transaction, type, data); + } + } } - public void HandleXfer(IClientAPI remoteClient, uint xferID, uint packetID, byte[] data) + public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) { + AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); + if (transactions != null) + { + transactions.HandleXfer(xferID, packetID, data); + } } } } - + diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 8909bdf156..cea6e6e2d9 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs @@ -35,6 +35,7 @@ using libsecondlife.Packets; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; +using OpenSim.Framework.Data; using OpenSim.Region.Capabilities; using OpenSim.Framework.Servers; @@ -47,11 +48,13 @@ namespace OpenSim.Framework.Communications.Caches public List NotecardUpdaters = new List(); public LLUUID UserID; public Dictionary XferUploaders = new Dictionary(); + public AssetTransactionManager Manager; // Methods - public AgentAssetTransactions(LLUUID agentID) + public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager) { this.UserID = agentID; + Manager = manager; } public AssetCapsUploader RequestCapsUploader() @@ -70,9 +73,34 @@ namespace OpenSim.Framework.Communications.Caches public AssetXferUploader RequestXferUploader(LLUUID transactionID) { - AssetXferUploader uploader = new AssetXferUploader(); - this.XferUploaders.Add(transactionID, uploader); - return uploader; + if (!this.XferUploaders.ContainsKey(transactionID)) + { + AssetXferUploader uploader = new AssetXferUploader(this); + + this.XferUploaders.Add(transactionID, uploader); + return uploader; + } + return null; + } + + public void HandleXfer(ulong xferID, uint packetID, byte[] data) + { + foreach (AssetXferUploader uploader in this.XferUploaders.Values) + { + if (uploader.XferID == xferID) + { + uploader.HandleXferPacket(xferID, packetID, data); + break; + } + } + } + + public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) + { + if (this.XferUploaders.ContainsKey(transactionID)) + { + this.XferUploaders[transactionID].RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); + } } // Nested Types @@ -143,10 +171,23 @@ namespace OpenSim.Framework.Communications.Caches private IClientAPI ourClient; public LLUUID TransactionID = LLUUID.Zero; public bool UploadComplete; - public uint XferID; + public ulong XferID; + private string m_name = ""; + private string m_description = ""; + private sbyte type = 0; + private sbyte invType = 0; + private uint nextPerm = 0; + private bool m_finished = false; + private bool m_createItem = false; + private AgentAssetTransactions m_userTransactions; + + public AssetXferUploader(AgentAssetTransactions transactions) + { + this.m_userTransactions = transactions; + } // Methods - public void HandleXferPacket(uint xferID, uint packetID, byte[] data) + public void HandleXferPacket(ulong xferID, uint packetID, byte[] data) { if (this.XferID == xferID) { @@ -216,6 +257,67 @@ namespace OpenSim.Framework.Communications.Caches newPack.AssetBlock.Success = true; newPack.AssetBlock.UUID = this.Asset.FullID; this.ourClient.OutPacket(newPack); + this.m_finished = true; + if (m_createItem) + { + DoCreateItem(); + } + Console.WriteLine("upload complete "+ this.TransactionID); + //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); + } + private void SaveAssetToFile(string filename, byte[] data) + { + FileStream fs = File.Create(filename); + BinaryWriter bw = new BinaryWriter(fs); + bw.Write(data); + bw.Close(); + fs.Close(); + } + + public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) + { + if (this.TransactionID == transactionID) + { + this.InventFolder = folderID; + this.m_name = name; + this.m_description = description; + this.type = type; + this.invType = invType; + this.nextPerm = nextOwnerMask; + this.Asset.Name = name; + this.Asset.Description = description; + this.Asset.Type = type; + this.Asset.InvType = invType; + m_createItem = true; + if (m_finished) + { + DoCreateItem(); + } + } + } + + private void DoCreateItem() + { + this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); + CachedUserInfo userInfo = m_userTransactions.Manager.CommsManager.UserProfiles.GetUserDetails(ourClient.AgentId); + if (userInfo != null) + { + InventoryItemBase item = new InventoryItemBase(); + item.avatarID = this.ourClient.AgentId; + item.creatorsID = ourClient.AgentId; + item.inventoryID = LLUUID.Random(); + item.assetID = Asset.FullID; + item.inventoryDescription = this.m_description; + item.inventoryName = m_name; + item.assetType = type; + item.invType = this.invType; + item.parentFolderID = this.InventFolder; + item.inventoryCurrentPermissions = 2147483647; + item.inventoryNextPermissions = this.nextPerm; + + userInfo.AddItem(ourClient.AgentId, item); + ourClient.SendInventoryItemUpdate(item); + } } } diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index ac882ba199..7676597a3e 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -45,6 +45,7 @@ namespace OpenSim.Framework.Communications public IInventoryServices InventoryServer; public IInterRegionCommunications InterRegion; public UserProfileCache UserProfiles; + public AssetTransactionManager TransactionsManager; public AssetCache AssetCache; public NetworkServersInfo ServersInfo; @@ -53,6 +54,7 @@ namespace OpenSim.Framework.Communications ServersInfo = serversInfo; this.AssetCache = assetCache; UserProfiles = new UserProfileCache(this); + TransactionsManager = new AssetTransactionManager(this); } #region Packet Handlers diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 1af96e7f13..ff794f987b 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -87,6 +87,9 @@ namespace OpenSim.Framework.Interfaces public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); + public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data); + public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); + public interface IClientAPI { event ImprovedInstantMessage OnInstantMessage; @@ -135,6 +138,8 @@ namespace OpenSim.Framework.Interfaces event FetchInventoryDescendents OnFetchInventoryDescendents; event FetchInventory OnFetchInventory; event RequestTaskInventory OnRequestTaskInventory; + event UDPAssetUploadRequest OnAssetUploadRequest; + event XferReceive OnXferReceive; event UUIDNameRequest OnNameFromUUIDRequest; diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs index 864ea6028e..876c9b3bf6 100644 --- a/OpenSim/Framework/General/NullClientAPI.cs +++ b/OpenSim/Framework/General/NullClientAPI.cs @@ -57,6 +57,8 @@ namespace OpenSim.Framework public event FetchInventoryDescendents OnFetchInventoryDescendents; public event FetchInventory OnFetchInventory; public event RequestTaskInventory OnRequestTaskInventory; + public event UDPAssetUploadRequest OnAssetUploadRequest; + public event XferReceive OnXferReceive; public event UUIDNameRequest OnNameFromUUIDRequest; diff --git a/OpenSim/Framework/UserManager/CAPSService.cs b/OpenSim/Framework/UserManager/CAPSService.cs new file mode 100644 index 0000000000..39af140e3e --- /dev/null +++ b/OpenSim/Framework/UserManager/CAPSService.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Security.Cryptography; +using libsecondlife; +using Nwc.XmlRpc; +using OpenSim.Framework.Console; +using OpenSim.Framework.Data; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Inventory; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.Servers; + +namespace OpenSim.Framework.UserManagement +{ + public class CAPSService + { + private BaseHttpServer m_server; + + public CAPSService(BaseHttpServer httpServer) + { + m_server = httpServer; + this.AddCapsSeedHandler("/CapsSeed/", CapsRequest); + } + + private void AddCapsSeedHandler(string path, RestMethod restMethod) + { + m_server.AddStreamHandler(new RestStreamHandler("POST", path, restMethod)); + } + + public string CapsRequest(string request, string path, string param) + { + System.Console.WriteLine("new caps request " + request +" from path "+ path); + return ""; + } + } +} diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index d9c7508132..d7962dc6b2 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -86,6 +86,8 @@ namespace OpenSim.Region.ClientStack public event FetchInventoryDescendents OnFetchInventoryDescendents; public event FetchInventory OnFetchInventory; public event RequestTaskInventory OnRequestTaskInventory; + public event UDPAssetUploadRequest OnAssetUploadRequest; + public event XferReceive OnXferReceive; public event UUIDNameRequest OnNameFromUUIDRequest; diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 58d4cfe385..1e3685bc64 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -217,7 +217,7 @@ namespace OpenSim.Region.ClientStack case PacketType.ObjectAdd: if (OnAddPrim != null) { - ObjectAddPacket addPacket = (ObjectAddPacket) Pack ; + ObjectAddPacket addPacket = (ObjectAddPacket)Pack; PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape); @@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectGrab: - ObjectGrabPacket grab = (ObjectGrabPacket)Pack; + ObjectGrabPacket grab = (ObjectGrabPacket)Pack; if (OnGrabObject != null) { OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); @@ -338,7 +338,7 @@ namespace OpenSim.Region.ClientStack #region Inventory/Asset/Other related packets case PacketType.RequestImage: RequestImagePacket imageRequest = (RequestImagePacket)Pack; - + for (int i = 0; i < imageRequest.RequestImage.Length; i++) { m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); @@ -351,14 +351,20 @@ namespace OpenSim.Region.ClientStack break; case PacketType.AssetUploadRequest: AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; - // Console.WriteLine(request.ToString()); - //this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); + if (OnAssetUploadRequest != null) + { + OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData); + } break; case PacketType.RequestXfer: //Console.WriteLine(Pack.ToString()); break; case PacketType.SendXferPacket: - this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); + SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; + if (OnXferReceive != null) + { + OnXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); + } break; case PacketType.CreateInventoryFolder: if (this.OnCreateNewInventoryFolder != null) @@ -369,18 +375,11 @@ namespace OpenSim.Region.ClientStack break; case PacketType.CreateInventoryItem: CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; - if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) + if (this.OnCreateNewInventoryItem != null) { - this.UploadAssets.CreateInventoryItem(createItem); - } - else - { - 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); - } + 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: @@ -558,7 +557,7 @@ namespace OpenSim.Region.ClientStack if (OnParcelPropertiesUpdateRequest != null) { OnParcelPropertiesUpdateRequest(updatePacket, this); - + } break; case PacketType.ParcelSelectObjects: diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index e2a953ca41..9ff91336b1 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Communications.Caches; using OpenSim.Framework.Console; using OpenSim.Framework.Utilities; using OpenSim.Framework.Data; +using OpenSim.Framework.UserManagement; namespace OpenSim.Region.Communications.Local { @@ -42,6 +43,7 @@ namespace OpenSim.Region.Communications.Local public LocalUserServices UserServices; public LocalLoginService LoginServices; public LocalInventoryService InvenServices; + // public CAPSService CapsServices; public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage ) : base(serversInfo, httpServer, assetCache) @@ -57,6 +59,8 @@ namespace OpenSim.Region.Communications.Local InstanceServices = new LocalBackEndServices(); GridServer = InstanceServices; InterRegion = InstanceServices; + + //CapsServices = new CAPSService(httpServer); LoginServices = new LocalLoginService(UserServices, welcomeMessage, this, serversInfo, accountsAuthenticate); httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 88377bc99d..d3b76de346 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -90,6 +90,7 @@ namespace OpenSim.Region.Communications.Local response.RegionY = reg.RegionLocY; response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; + // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; theUser.currentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentHandle = reg.RegionHandle; diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index cca8998170..afa4ea5bfd 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -714,33 +714,41 @@ namespace OpenSim.Region.Environment.Scenes /// public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); - if (userInfo != null) + if (transActionID == LLUUID.Zero) { - AssetBase asset = new AssetBase(); - asset.Name = name; - asset.Description = description; - asset.InvType = invType; - asset.Type = type; - asset.FullID = LLUUID.Random(); - asset.Data = new byte[1]; - this.assetCache.AddAsset(asset); + CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + if (userInfo != null) + { + AssetBase asset = new AssetBase(); + asset.Name = name; + asset.Description = description; + asset.InvType = invType; + asset.Type = type; + asset.FullID = LLUUID.Random(); + asset.Data = new byte[1]; + this.assetCache.AddAsset(asset); - InventoryItemBase item = new InventoryItemBase(); - item.avatarID = remoteClient.AgentId; - item.creatorsID = remoteClient.AgentId; - item.inventoryID = LLUUID.Random(); - item.assetID = asset.FullID; - item.inventoryDescription = description; - item.inventoryName = name; - item.assetType = invType; - item.invType = invType; - item.parentFolderID = folderID; - item.inventoryCurrentPermissions = 2147483647; - item.inventoryNextPermissions = nextOwnerMask; + InventoryItemBase item = new InventoryItemBase(); + item.avatarID = remoteClient.AgentId; + item.creatorsID = remoteClient.AgentId; + item.inventoryID = LLUUID.Random(); + item.assetID = asset.FullID; + item.inventoryDescription = description; + item.inventoryName = name; + item.assetType = invType; + item.invType = invType; + item.parentFolderID = folderID; + item.inventoryCurrentPermissions = 2147483647; + item.inventoryNextPermissions = nextOwnerMask; - userInfo.AddItem(remoteClient.AgentId, item); - remoteClient.SendInventoryItemUpdate(item); + userInfo.AddItem(remoteClient.AgentId, item); + remoteClient.SendInventoryItemUpdate(item); + } + } + else + { + commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); + //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3ee1f19495..378acf9187 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -577,6 +577,7 @@ namespace OpenSim.Region.Environment.Scenes CreateAndAddScenePresence(client); m_LandManager.sendParcelOverlay(client); commsManager.UserProfiles.AddNewUser(client.AgentId); + commsManager.TransactionsManager.AddUser(client.AgentId); } protected virtual void SubscribeToClientEvents(IClientAPI client) @@ -625,6 +626,8 @@ namespace OpenSim.Region.Environment.Scenes client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; client.OnRequestTaskInventory += RequestTaskInventory; client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; + client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; + client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; client.OnGrabObject += ProcessObjectGrab; } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 7a1f117f10..3bd83aae72 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -706,7 +706,6 @@ namespace OpenSim.Region.Environment.Scenes } } } - #endregion /// /// diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index af3d77b933..c0132f539a 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -71,6 +71,8 @@ namespace SimpleApp public event FetchInventoryDescendents OnFetchInventoryDescendents; public event FetchInventory OnFetchInventory; public event RequestTaskInventory OnRequestTaskInventory; + public event UDPAssetUploadRequest OnAssetUploadRequest; + public event XferReceive OnXferReceive; public event UUIDNameRequest OnNameFromUUIDRequest;