Implement CreateNewOutfitAttachments. This addresses mantis #199.

avinationmerge
Tom 2010-08-06 11:39:10 -07:00
parent e941da205b
commit 330343505c
11 changed files with 65 additions and 3 deletions

View File

@ -593,6 +593,7 @@ namespace OpenSim.Client.MXP.ClientStack
public event DisconnectUser OnDisconnectUser;
public event RequestAvatarProperties OnRequestAvatarProperties;
public event SetAlwaysRun OnSetAlwaysRun;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
public event DeRezObject OnDeRezObject;
public event Action<IClientAPI> OnRegionHandShakeReply;

View File

@ -253,6 +253,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event AddNewPrim OnAddPrim;
public event FetchInventory OnAgentDataUpdateRequest;
public event TeleportLocationRequest OnSetStartLocationRequest;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event RequestGodlikePowers OnRequestGodlikePowers;
public event GodKickUser OnGodKickUser;
public event ObjectDuplicate OnObjectDuplicate;

View File

@ -290,6 +290,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event GenericCall2 OnStopMovement = delegate { };
public event Action<UUID> OnRemoveAvatar = delegate { };
public event ObjectPermissions OnObjectPermissions = delegate { };
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy = delegate { };
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };

View File

@ -264,6 +264,9 @@ namespace OpenSim.Framework
public delegate void MoveInventoryItem(
IClientAPI remoteClient, List<InventoryItemBase> items);
public delegate void MoveItemsAndLeaveCopy(
IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
public delegate void RemoveInventoryItem(
IClientAPI remoteClient, List<UUID> itemIDs);
@ -772,6 +775,7 @@ namespace OpenSim.Framework
event RequestTaskInventory OnRequestTaskInventory;
event UpdateInventoryItem OnUpdateInventoryItem;
event CopyInventoryItem OnCopyInventoryItem;
event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
event MoveInventoryItem OnMoveInventoryItem;
event RemoveInventoryFolder OnRemoveInventoryFolder;
event RemoveInventoryItem OnRemoveInventoryItem;

View File

@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event RequestTaskInventory OnRequestTaskInventory;
public event UpdateInventoryItem OnUpdateInventoryItem;
public event CopyInventoryItem OnCopyInventoryItem;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event MoveInventoryItem OnMoveInventoryItem;
public event RemoveInventoryItem OnRemoveInventoryItem;
public event RemoveInventoryFolder OnRemoveInventoryFolder;
@ -4840,6 +4841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
@ -9349,6 +9351,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
return true;
}
private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack)
{
CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
#region Packet Session and User Check
if (m_checkPackets)
{
if (packet.AgentData.SessionID != SessionId ||
packet.AgentData.AgentID != AgentId)
return true;
}
#endregion
MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null;
List<InventoryItemBase> items = new List<InventoryItemBase>();
foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
{
InventoryItemBase b = new InventoryItemBase();
b.ID = n.OldItemID;
b.Folder = n.OldFolderID;
items.Add(b);
}
handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
if (handlerMoveItemsAndLeaveCopy != null)
{
handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID);
}
return true;
}
private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
{

View File

@ -79,7 +79,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event DisconnectUser OnDisconnectUser;
public event RequestAvatarProperties OnRequestAvatarProperties;
public event SetAlwaysRun OnSetAlwaysRun;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event DeRezObject OnDeRezObject;
public event Action<IClientAPI> OnRegionHandShakeReply;
public event GenericCall2 OnRequestWearables;

View File

@ -648,6 +648,8 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
if (newName == null) newName = item.Name;
AssetBase asset = AssetService.Get(item.AssetID.ToString());
if (asset != null)
@ -694,6 +696,24 @@ namespace OpenSim.Region.Framework.Scenes
return asset;
}
/// <summary>
/// Move an item within the agent's inventory, and leave a copy (used in making a new outfit)
/// </summary>
public void MoveInventoryItemsLeaveCopy(IClientAPI remoteClient, List<InventoryItemBase> items, UUID destfolder)
{
List<InventoryItemBase> moveitems = new List<InventoryItemBase>();
foreach (InventoryItemBase b in items)
{
CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null);
InventoryItemBase n = InventoryService.GetItem(b);
n.Folder = destfolder;
moveitems.Add(n);
remoteClient.SendInventoryItemCreateUpdate(n, 0);
}
MoveInventoryItem(remoteClient, moveitems);
}
/// <summary>
/// Move an item within the agent's inventory.
/// </summary>

View File

@ -2922,6 +2922,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnFetchInventory += HandleFetchInventory;
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
client.OnCopyInventoryItem += CopyInventoryItem;
client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
client.OnMoveInventoryItem += MoveInventoryItem;
client.OnRemoveInventoryItem += RemoveInventoryItem;
client.OnRemoveInventoryFolder += RemoveInventoryFolder;

View File

@ -815,6 +815,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event ObjectOwner OnObjectOwner;
public event DirPlacesQuery OnDirPlacesQuery;
public event DirFindQuery OnDirFindQuery;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event DirLandQuery OnDirLandQuery;
public event DirPopularQuery OnDirPopularQuery;
public event DirClassifiedQuery OnDirClassifiedQuery;

View File

@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
#pragma warning disable 67
public event Action<IClientAPI> OnLogout;
public event ObjectPermissions OnObjectPermissions;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event MoneyTransferRequest OnMoneyTransferRequest;
public event ParcelBuy OnParcelBuy;
public event Action<IClientAPI> OnConnectionClosed;

View File

@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock
public event MoneyTransferRequest OnMoneyTransferRequest;
public event ParcelBuy OnParcelBuy;
public event Action<IClientAPI> OnConnectionClosed;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event ImprovedInstantMessage OnInstantMessage;
public event ChatMessage OnChatFromClient;
public event TextureRequest OnRequestTexture;