diff options
author | MW | 2007-08-15 18:34:36 +0000 |
---|---|---|
committer | MW | 2007-08-15 18:34:36 +0000 |
commit | 94dded470d04f72c573bf0aa82e1f7522362c54a (patch) | |
tree | 0ecb098a3b75a6b0fee01c21ca11c614a32bceef /OpenSim/Region | |
parent | * We now have a field of spinning objects. (diff) | |
download | opensim-SC-94dded470d04f72c573bf0aa82e1f7522362c54a.zip opensim-SC-94dded470d04f72c573bf0aa82e1f7522362c54a.tar.gz opensim-SC-94dded470d04f72c573bf0aa82e1f7522362c54a.tar.bz2 opensim-SC-94dded470d04f72c573bf0aa82e1f7522362c54a.tar.xz |
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.]
Diffstat (limited to '')
8 files changed, 63 insertions, 45 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index d9c7508..d7962dc 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -86,6 +86,8 @@ namespace OpenSim.Region.ClientStack | |||
86 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 86 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
87 | public event FetchInventory OnFetchInventory; | 87 | public event FetchInventory OnFetchInventory; |
88 | public event RequestTaskInventory OnRequestTaskInventory; | 88 | public event RequestTaskInventory OnRequestTaskInventory; |
89 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
90 | public event XferReceive OnXferReceive; | ||
89 | 91 | ||
90 | public event UUIDNameRequest OnNameFromUUIDRequest; | 92 | public event UUIDNameRequest OnNameFromUUIDRequest; |
91 | 93 | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 58d4cfe..1e3685b 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -217,7 +217,7 @@ namespace OpenSim.Region.ClientStack | |||
217 | case PacketType.ObjectAdd: | 217 | case PacketType.ObjectAdd: |
218 | if (OnAddPrim != null) | 218 | if (OnAddPrim != null) |
219 | { | 219 | { |
220 | ObjectAddPacket addPacket = (ObjectAddPacket) Pack ; | 220 | ObjectAddPacket addPacket = (ObjectAddPacket)Pack; |
221 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); | 221 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); |
222 | 222 | ||
223 | OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape); | 223 | OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape); |
@@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack | |||
290 | } | 290 | } |
291 | break; | 291 | break; |
292 | case PacketType.ObjectGrab: | 292 | case PacketType.ObjectGrab: |
293 | ObjectGrabPacket grab = (ObjectGrabPacket)Pack; | 293 | ObjectGrabPacket grab = (ObjectGrabPacket)Pack; |
294 | if (OnGrabObject != null) | 294 | if (OnGrabObject != null) |
295 | { | 295 | { |
296 | OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); | 296 | OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); |
@@ -338,7 +338,7 @@ namespace OpenSim.Region.ClientStack | |||
338 | #region Inventory/Asset/Other related packets | 338 | #region Inventory/Asset/Other related packets |
339 | case PacketType.RequestImage: | 339 | case PacketType.RequestImage: |
340 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | 340 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; |
341 | 341 | ||
342 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | 342 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) |
343 | { | 343 | { |
344 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); | 344 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); |
@@ -351,14 +351,20 @@ namespace OpenSim.Region.ClientStack | |||
351 | break; | 351 | break; |
352 | case PacketType.AssetUploadRequest: | 352 | case PacketType.AssetUploadRequest: |
353 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 353 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
354 | // Console.WriteLine(request.ToString()); | 354 | if (OnAssetUploadRequest != null) |
355 | //this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); | 355 | { |
356 | OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData); | ||
357 | } | ||
356 | break; | 358 | break; |
357 | case PacketType.RequestXfer: | 359 | case PacketType.RequestXfer: |
358 | //Console.WriteLine(Pack.ToString()); | 360 | //Console.WriteLine(Pack.ToString()); |
359 | break; | 361 | break; |
360 | case PacketType.SendXferPacket: | 362 | case PacketType.SendXferPacket: |
361 | this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); | 363 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; |
364 | if (OnXferReceive != null) | ||
365 | { | ||
366 | OnXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); | ||
367 | } | ||
362 | break; | 368 | break; |
363 | case PacketType.CreateInventoryFolder: | 369 | case PacketType.CreateInventoryFolder: |
364 | if (this.OnCreateNewInventoryFolder != null) | 370 | if (this.OnCreateNewInventoryFolder != null) |
@@ -369,18 +375,11 @@ namespace OpenSim.Region.ClientStack | |||
369 | break; | 375 | break; |
370 | case PacketType.CreateInventoryItem: | 376 | case PacketType.CreateInventoryItem: |
371 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; | 377 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; |
372 | if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) | 378 | if (this.OnCreateNewInventoryItem != null) |
373 | { | 379 | { |
374 | this.UploadAssets.CreateInventoryItem(createItem); | 380 | this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID, |
375 | } | 381 | Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType, |
376 | else | 382 | createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask); |
377 | { | ||
378 | if (this.OnCreateNewInventoryItem != null) | ||
379 | { | ||
380 | this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID, | ||
381 | Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType, | ||
382 | createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask); | ||
383 | } | ||
384 | } | 383 | } |
385 | break; | 384 | break; |
386 | case PacketType.FetchInventory: | 385 | case PacketType.FetchInventory: |
@@ -558,7 +557,7 @@ namespace OpenSim.Region.ClientStack | |||
558 | if (OnParcelPropertiesUpdateRequest != null) | 557 | if (OnParcelPropertiesUpdateRequest != null) |
559 | { | 558 | { |
560 | OnParcelPropertiesUpdateRequest(updatePacket, this); | 559 | OnParcelPropertiesUpdateRequest(updatePacket, this); |
561 | 560 | ||
562 | } | 561 | } |
563 | break; | 562 | break; |
564 | case PacketType.ParcelSelectObjects: | 563 | case PacketType.ParcelSelectObjects: |
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index e2a953c..9ff9133 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs | |||
@@ -33,6 +33,7 @@ using OpenSim.Framework.Communications.Caches; | |||
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Utilities; | 34 | using OpenSim.Framework.Utilities; |
35 | using OpenSim.Framework.Data; | 35 | using OpenSim.Framework.Data; |
36 | using OpenSim.Framework.UserManagement; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.Communications.Local | 38 | namespace OpenSim.Region.Communications.Local |
38 | { | 39 | { |
@@ -42,6 +43,7 @@ namespace OpenSim.Region.Communications.Local | |||
42 | public LocalUserServices UserServices; | 43 | public LocalUserServices UserServices; |
43 | public LocalLoginService LoginServices; | 44 | public LocalLoginService LoginServices; |
44 | public LocalInventoryService InvenServices; | 45 | public LocalInventoryService InvenServices; |
46 | // public CAPSService CapsServices; | ||
45 | 47 | ||
46 | public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage ) | 48 | public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage ) |
47 | : base(serversInfo, httpServer, assetCache) | 49 | : base(serversInfo, httpServer, assetCache) |
@@ -57,6 +59,8 @@ namespace OpenSim.Region.Communications.Local | |||
57 | InstanceServices = new LocalBackEndServices(); | 59 | InstanceServices = new LocalBackEndServices(); |
58 | GridServer = InstanceServices; | 60 | GridServer = InstanceServices; |
59 | InterRegion = InstanceServices; | 61 | InterRegion = InstanceServices; |
62 | |||
63 | //CapsServices = new CAPSService(httpServer); | ||
60 | 64 | ||
61 | LoginServices = new LocalLoginService(UserServices, welcomeMessage, this, serversInfo, accountsAuthenticate); | 65 | LoginServices = new LocalLoginService(UserServices, welcomeMessage, this, serversInfo, accountsAuthenticate); |
62 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); | 66 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 88377bc..d3b76de 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -90,6 +90,7 @@ namespace OpenSim.Region.Communications.Local | |||
90 | response.RegionY = reg.RegionLocY; | 90 | response.RegionY = reg.RegionLocY; |
91 | 91 | ||
92 | response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; | 92 | response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; |
93 | // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; | ||
93 | theUser.currentAgent.currentRegion = reg.SimUUID; | 94 | theUser.currentAgent.currentRegion = reg.SimUUID; |
94 | theUser.currentAgent.currentHandle = reg.RegionHandle; | 95 | theUser.currentAgent.currentHandle = reg.RegionHandle; |
95 | 96 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index cca8998..afa4ea5 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 | |||
714 | /// <param name="nextOwnerMask"></param> | 714 | /// <param name="nextOwnerMask"></param> |
715 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) | 715 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) |
716 | { | 716 | { |
717 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 717 | if (transActionID == LLUUID.Zero) |
718 | if (userInfo != null) | ||
719 | { | 718 | { |
720 | AssetBase asset = new AssetBase(); | 719 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
721 | asset.Name = name; | 720 | if (userInfo != null) |
722 | asset.Description = description; | 721 | { |
723 | asset.InvType = invType; | 722 | AssetBase asset = new AssetBase(); |
724 | asset.Type = type; | 723 | asset.Name = name; |
725 | asset.FullID = LLUUID.Random(); | 724 | asset.Description = description; |
726 | asset.Data = new byte[1]; | 725 | asset.InvType = invType; |
727 | this.assetCache.AddAsset(asset); | 726 | asset.Type = type; |
728 | 727 | asset.FullID = LLUUID.Random(); | |
729 | InventoryItemBase item = new InventoryItemBase(); | 728 | asset.Data = new byte[1]; |
730 | item.avatarID = remoteClient.AgentId; | 729 | this.assetCache.AddAsset(asset); |
731 | item.creatorsID = remoteClient.AgentId; | 730 | |
732 | item.inventoryID = LLUUID.Random(); | 731 | InventoryItemBase item = new InventoryItemBase(); |
733 | item.assetID = asset.FullID; | 732 | item.avatarID = remoteClient.AgentId; |
734 | item.inventoryDescription = description; | 733 | item.creatorsID = remoteClient.AgentId; |
735 | item.inventoryName = name; | 734 | item.inventoryID = LLUUID.Random(); |
736 | item.assetType = invType; | 735 | item.assetID = asset.FullID; |
737 | item.invType = invType; | 736 | item.inventoryDescription = description; |
738 | item.parentFolderID = folderID; | 737 | item.inventoryName = name; |
739 | item.inventoryCurrentPermissions = 2147483647; | 738 | item.assetType = invType; |
740 | item.inventoryNextPermissions = nextOwnerMask; | 739 | item.invType = invType; |
741 | 740 | item.parentFolderID = folderID; | |
742 | userInfo.AddItem(remoteClient.AgentId, item); | 741 | item.inventoryCurrentPermissions = 2147483647; |
743 | remoteClient.SendInventoryItemUpdate(item); | 742 | item.inventoryNextPermissions = nextOwnerMask; |
743 | |||
744 | userInfo.AddItem(remoteClient.AgentId, item); | ||
745 | remoteClient.SendInventoryItemUpdate(item); | ||
746 | } | ||
747 | } | ||
748 | else | ||
749 | { | ||
750 | commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); | ||
751 | //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); | ||
744 | } | 752 | } |
745 | } | 753 | } |
746 | 754 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3ee1f19..378acf9 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -577,6 +577,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | CreateAndAddScenePresence(client); | 577 | CreateAndAddScenePresence(client); |
578 | m_LandManager.sendParcelOverlay(client); | 578 | m_LandManager.sendParcelOverlay(client); |
579 | commsManager.UserProfiles.AddNewUser(client.AgentId); | 579 | commsManager.UserProfiles.AddNewUser(client.AgentId); |
580 | commsManager.TransactionsManager.AddUser(client.AgentId); | ||
580 | } | 581 | } |
581 | 582 | ||
582 | protected virtual void SubscribeToClientEvents(IClientAPI client) | 583 | protected virtual void SubscribeToClientEvents(IClientAPI client) |
@@ -625,6 +626,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
625 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; | 626 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; |
626 | client.OnRequestTaskInventory += RequestTaskInventory; | 627 | client.OnRequestTaskInventory += RequestTaskInventory; |
627 | client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; | 628 | client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; |
629 | client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; | ||
630 | client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; | ||
628 | 631 | ||
629 | client.OnGrabObject += ProcessObjectGrab; | 632 | client.OnGrabObject += ProcessObjectGrab; |
630 | } | 633 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 7a1f117..3bd83aa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -706,7 +706,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | } | 706 | } |
707 | } | 707 | } |
708 | } | 708 | } |
709 | |||
710 | #endregion | 709 | #endregion |
711 | /// <summary> | 710 | /// <summary> |
712 | /// | 711 | /// |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index af3d77b..c0132f5 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -71,6 +71,8 @@ namespace SimpleApp | |||
71 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 71 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
72 | public event FetchInventory OnFetchInventory; | 72 | public event FetchInventory OnFetchInventory; |
73 | public event RequestTaskInventory OnRequestTaskInventory; | 73 | public event RequestTaskInventory OnRequestTaskInventory; |
74 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
75 | public event XferReceive OnXferReceive; | ||
74 | 76 | ||
75 | public event UUIDNameRequest OnNameFromUUIDRequest; | 77 | public event UUIDNameRequest OnNameFromUUIDRequest; |
76 | 78 | ||