aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTom2010-08-06 11:39:10 -0700
committerTom2010-08-06 11:39:10 -0700
commit330343505ca2d6d109e89b4767f4351ab9bec91d (patch)
treef4aea7182e3ca13f23a94b4b47499937bb473cbb /OpenSim
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
downloadopensim-SC_OLD-330343505ca2d6d109e89b4767f4351ab9bec91d.zip
opensim-SC_OLD-330343505ca2d6d109e89b4767f4351ab9bec91d.tar.gz
opensim-SC_OLD-330343505ca2d6d109e89b4767f4351ab9bec91d.tar.bz2
opensim-SC_OLD-330343505ca2d6d109e89b4767f4351ab9bec91d.tar.xz
Implement CreateNewOutfitAttachments. This addresses mantis #199.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs1
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs1
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs1
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs33
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
11 files changed, 65 insertions, 3 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index ce2e9a1..84c6916 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -593,6 +593,7 @@ namespace OpenSim.Client.MXP.ClientStack
593 public event DisconnectUser OnDisconnectUser; 593 public event DisconnectUser OnDisconnectUser;
594 public event RequestAvatarProperties OnRequestAvatarProperties; 594 public event RequestAvatarProperties OnRequestAvatarProperties;
595 public event SetAlwaysRun OnSetAlwaysRun; 595 public event SetAlwaysRun OnSetAlwaysRun;
596 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
596 public event TeleportLandmarkRequest OnTeleportLandmarkRequest; 597 public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
597 public event DeRezObject OnDeRezObject; 598 public event DeRezObject OnDeRezObject;
598 public event Action<IClientAPI> OnRegionHandShakeReply; 599 public event Action<IClientAPI> OnRegionHandShakeReply;
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index 2063616..6ad5f5a 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -253,6 +253,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
253 public event AddNewPrim OnAddPrim; 253 public event AddNewPrim OnAddPrim;
254 public event FetchInventory OnAgentDataUpdateRequest; 254 public event FetchInventory OnAgentDataUpdateRequest;
255 public event TeleportLocationRequest OnSetStartLocationRequest; 255 public event TeleportLocationRequest OnSetStartLocationRequest;
256 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
256 public event RequestGodlikePowers OnRequestGodlikePowers; 257 public event RequestGodlikePowers OnRequestGodlikePowers;
257 public event GodKickUser OnGodKickUser; 258 public event GodKickUser OnGodKickUser;
258 public event ObjectDuplicate OnObjectDuplicate; 259 public event ObjectDuplicate OnObjectDuplicate;
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 841f9a4..8ef411b 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -290,6 +290,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
290 public event GenericCall2 OnStopMovement = delegate { }; 290 public event GenericCall2 OnStopMovement = delegate { };
291 public event Action<UUID> OnRemoveAvatar = delegate { }; 291 public event Action<UUID> OnRemoveAvatar = delegate { };
292 public event ObjectPermissions OnObjectPermissions = delegate { }; 292 public event ObjectPermissions OnObjectPermissions = delegate { };
293 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy = delegate { };
293 public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { }; 294 public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
294 public event LinkInventoryItem OnLinkInventoryItem = delegate { }; 295 public event LinkInventoryItem OnLinkInventoryItem = delegate { };
295 public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { }; 296 public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 95aec94..07bded6 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -264,6 +264,9 @@ namespace OpenSim.Framework
264 public delegate void MoveInventoryItem( 264 public delegate void MoveInventoryItem(
265 IClientAPI remoteClient, List<InventoryItemBase> items); 265 IClientAPI remoteClient, List<InventoryItemBase> items);
266 266
267 public delegate void MoveItemsAndLeaveCopy(
268 IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
269
267 public delegate void RemoveInventoryItem( 270 public delegate void RemoveInventoryItem(
268 IClientAPI remoteClient, List<UUID> itemIDs); 271 IClientAPI remoteClient, List<UUID> itemIDs);
269 272
@@ -772,6 +775,7 @@ namespace OpenSim.Framework
772 event RequestTaskInventory OnRequestTaskInventory; 775 event RequestTaskInventory OnRequestTaskInventory;
773 event UpdateInventoryItem OnUpdateInventoryItem; 776 event UpdateInventoryItem OnUpdateInventoryItem;
774 event CopyInventoryItem OnCopyInventoryItem; 777 event CopyInventoryItem OnCopyInventoryItem;
778 event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
775 event MoveInventoryItem OnMoveInventoryItem; 779 event MoveInventoryItem OnMoveInventoryItem;
776 event RemoveInventoryFolder OnRemoveInventoryFolder; 780 event RemoveInventoryFolder OnRemoveInventoryFolder;
777 event RemoveInventoryItem OnRemoveInventoryItem; 781 event RemoveInventoryItem OnRemoveInventoryItem;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 0b8b95b..cd7c11b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
154 public event RequestTaskInventory OnRequestTaskInventory; 154 public event RequestTaskInventory OnRequestTaskInventory;
155 public event UpdateInventoryItem OnUpdateInventoryItem; 155 public event UpdateInventoryItem OnUpdateInventoryItem;
156 public event CopyInventoryItem OnCopyInventoryItem; 156 public event CopyInventoryItem OnCopyInventoryItem;
157 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
157 public event MoveInventoryItem OnMoveInventoryItem; 158 public event MoveInventoryItem OnMoveInventoryItem;
158 public event RemoveInventoryItem OnRemoveInventoryItem; 159 public event RemoveInventoryItem OnRemoveInventoryItem;
159 public event RemoveInventoryFolder OnRemoveInventoryFolder; 160 public event RemoveInventoryFolder OnRemoveInventoryFolder;
@@ -4840,6 +4841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4840 AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false); 4841 AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
4841 AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false); 4842 AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
4842 AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode); 4843 AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
4844 AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
4843 AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false); 4845 AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
4844 AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents); 4846 AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
4845 AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery); 4847 AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
@@ -9349,6 +9351,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9349 { 9351 {
9350 return true; 9352 return true;
9351 } 9353 }
9354
9355 private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack)
9356 {
9357 CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
9358
9359 #region Packet Session and User Check
9360 if (m_checkPackets)
9361 {
9362 if (packet.AgentData.SessionID != SessionId ||
9363 packet.AgentData.AgentID != AgentId)
9364 return true;
9365 }
9366 #endregion
9367 MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null;
9368 List<InventoryItemBase> items = new List<InventoryItemBase>();
9369 foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
9370 {
9371 InventoryItemBase b = new InventoryItemBase();
9372 b.ID = n.OldItemID;
9373 b.Folder = n.OldFolderID;
9374 items.Add(b);
9375 }
9376
9377 handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
9378 if (handlerMoveItemsAndLeaveCopy != null)
9379 {
9380 handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID);
9381 }
9382
9383 return true;
9384 }
9352 9385
9353 private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack) 9386 private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
9354 { 9387 {
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 4db8f9e..cdc56a2 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Examples.SimpleModule
79 public event DisconnectUser OnDisconnectUser; 79 public event DisconnectUser OnDisconnectUser;
80 public event RequestAvatarProperties OnRequestAvatarProperties; 80 public event RequestAvatarProperties OnRequestAvatarProperties;
81 public event SetAlwaysRun OnSetAlwaysRun; 81 public event SetAlwaysRun OnSetAlwaysRun;
82 82 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
83 public event DeRezObject OnDeRezObject; 83 public event DeRezObject OnDeRezObject;
84 public event Action<IClientAPI> OnRegionHandShakeReply; 84 public event Action<IClientAPI> OnRegionHandShakeReply;
85 public event GenericCall2 OnRequestWearables; 85 public event GenericCall2 OnRequestWearables;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 59731f7..17159b4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -648,6 +648,8 @@ namespace OpenSim.Region.Framework.Scenes
648 return; 648 return;
649 } 649 }
650 650
651 if (newName == null) newName = item.Name;
652
651 AssetBase asset = AssetService.Get(item.AssetID.ToString()); 653 AssetBase asset = AssetService.Get(item.AssetID.ToString());
652 654
653 if (asset != null) 655 if (asset != null)
@@ -695,6 +697,24 @@ namespace OpenSim.Region.Framework.Scenes
695 } 697 }
696 698
697 /// <summary> 699 /// <summary>
700 /// Move an item within the agent's inventory, and leave a copy (used in making a new outfit)
701 /// </summary>
702 public void MoveInventoryItemsLeaveCopy(IClientAPI remoteClient, List<InventoryItemBase> items, UUID destfolder)
703 {
704 List<InventoryItemBase> moveitems = new List<InventoryItemBase>();
705 foreach (InventoryItemBase b in items)
706 {
707 CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null);
708 InventoryItemBase n = InventoryService.GetItem(b);
709 n.Folder = destfolder;
710 moveitems.Add(n);
711 remoteClient.SendInventoryItemCreateUpdate(n, 0);
712 }
713
714 MoveInventoryItem(remoteClient, moveitems);
715 }
716
717 /// <summary>
698 /// Move an item within the agent's inventory. 718 /// Move an item within the agent's inventory.
699 /// </summary> 719 /// </summary>
700 /// <param name="remoteClient"></param> 720 /// <param name="remoteClient"></param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 644fbb0..ea52ffb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2922,6 +2922,7 @@ namespace OpenSim.Region.Framework.Scenes
2922 client.OnFetchInventory += HandleFetchInventory; 2922 client.OnFetchInventory += HandleFetchInventory;
2923 client.OnUpdateInventoryItem += UpdateInventoryItemAsset; 2923 client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
2924 client.OnCopyInventoryItem += CopyInventoryItem; 2924 client.OnCopyInventoryItem += CopyInventoryItem;
2925 client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
2925 client.OnMoveInventoryItem += MoveInventoryItem; 2926 client.OnMoveInventoryItem += MoveInventoryItem;
2926 client.OnRemoveInventoryItem += RemoveInventoryItem; 2927 client.OnRemoveInventoryItem += RemoveInventoryItem;
2927 client.OnRemoveInventoryFolder += RemoveInventoryFolder; 2928 client.OnRemoveInventoryFolder += RemoveInventoryFolder;
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index c7a9484..91cbee9 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -815,6 +815,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
815 public event ObjectOwner OnObjectOwner; 815 public event ObjectOwner OnObjectOwner;
816 public event DirPlacesQuery OnDirPlacesQuery; 816 public event DirPlacesQuery OnDirPlacesQuery;
817 public event DirFindQuery OnDirFindQuery; 817 public event DirFindQuery OnDirFindQuery;
818 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
818 public event DirLandQuery OnDirLandQuery; 819 public event DirLandQuery OnDirLandQuery;
819 public event DirPopularQuery OnDirPopularQuery; 820 public event DirPopularQuery OnDirPopularQuery;
820 public event DirClassifiedQuery OnDirClassifiedQuery; 821 public event DirClassifiedQuery OnDirClassifiedQuery;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 23255fb..d6f4d53 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
156#pragma warning disable 67 156#pragma warning disable 67
157 public event Action<IClientAPI> OnLogout; 157 public event Action<IClientAPI> OnLogout;
158 public event ObjectPermissions OnObjectPermissions; 158 public event ObjectPermissions OnObjectPermissions;
159 159 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
160 public event MoneyTransferRequest OnMoneyTransferRequest; 160 public event MoneyTransferRequest OnMoneyTransferRequest;
161 public event ParcelBuy OnParcelBuy; 161 public event ParcelBuy OnParcelBuy;
162 public event Action<IClientAPI> OnConnectionClosed; 162 public event Action<IClientAPI> OnConnectionClosed;
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 2993b46..1e4bc2a 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock
65 public event MoneyTransferRequest OnMoneyTransferRequest; 65 public event MoneyTransferRequest OnMoneyTransferRequest;
66 public event ParcelBuy OnParcelBuy; 66 public event ParcelBuy OnParcelBuy;
67 public event Action<IClientAPI> OnConnectionClosed; 67 public event Action<IClientAPI> OnConnectionClosed;
68 68 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
69 public event ImprovedInstantMessage OnInstantMessage; 69 public event ImprovedInstantMessage OnInstantMessage;
70 public event ChatMessage OnChatFromClient; 70 public event ChatMessage OnChatFromClient;
71 public event TextureRequest OnRequestTexture; 71 public event TextureRequest OnRequestTexture;