Implement CreateNewOutfitAttachments. This addresses mantis #199.
parent
e941da205b
commit
330343505c
|
@ -593,6 +593,7 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||||
public event DisconnectUser OnDisconnectUser;
|
public event DisconnectUser OnDisconnectUser;
|
||||||
public event RequestAvatarProperties OnRequestAvatarProperties;
|
public event RequestAvatarProperties OnRequestAvatarProperties;
|
||||||
public event SetAlwaysRun OnSetAlwaysRun;
|
public event SetAlwaysRun OnSetAlwaysRun;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
|
public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
|
||||||
public event DeRezObject OnDeRezObject;
|
public event DeRezObject OnDeRezObject;
|
||||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
|
|
|
@ -253,6 +253,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
|
||||||
public event AddNewPrim OnAddPrim;
|
public event AddNewPrim OnAddPrim;
|
||||||
public event FetchInventory OnAgentDataUpdateRequest;
|
public event FetchInventory OnAgentDataUpdateRequest;
|
||||||
public event TeleportLocationRequest OnSetStartLocationRequest;
|
public event TeleportLocationRequest OnSetStartLocationRequest;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event RequestGodlikePowers OnRequestGodlikePowers;
|
public event RequestGodlikePowers OnRequestGodlikePowers;
|
||||||
public event GodKickUser OnGodKickUser;
|
public event GodKickUser OnGodKickUser;
|
||||||
public event ObjectDuplicate OnObjectDuplicate;
|
public event ObjectDuplicate OnObjectDuplicate;
|
||||||
|
|
|
@ -290,6 +290,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||||
public event GenericCall2 OnStopMovement = delegate { };
|
public event GenericCall2 OnStopMovement = delegate { };
|
||||||
public event Action<UUID> OnRemoveAvatar = delegate { };
|
public event Action<UUID> OnRemoveAvatar = delegate { };
|
||||||
public event ObjectPermissions OnObjectPermissions = delegate { };
|
public event ObjectPermissions OnObjectPermissions = delegate { };
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy = delegate { };
|
||||||
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
|
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
|
||||||
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
|
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
|
||||||
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
|
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
|
||||||
|
|
|
@ -264,6 +264,9 @@ namespace OpenSim.Framework
|
||||||
public delegate void MoveInventoryItem(
|
public delegate void MoveInventoryItem(
|
||||||
IClientAPI remoteClient, List<InventoryItemBase> items);
|
IClientAPI remoteClient, List<InventoryItemBase> items);
|
||||||
|
|
||||||
|
public delegate void MoveItemsAndLeaveCopy(
|
||||||
|
IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
|
||||||
|
|
||||||
public delegate void RemoveInventoryItem(
|
public delegate void RemoveInventoryItem(
|
||||||
IClientAPI remoteClient, List<UUID> itemIDs);
|
IClientAPI remoteClient, List<UUID> itemIDs);
|
||||||
|
|
||||||
|
@ -772,6 +775,7 @@ namespace OpenSim.Framework
|
||||||
event RequestTaskInventory OnRequestTaskInventory;
|
event RequestTaskInventory OnRequestTaskInventory;
|
||||||
event UpdateInventoryItem OnUpdateInventoryItem;
|
event UpdateInventoryItem OnUpdateInventoryItem;
|
||||||
event CopyInventoryItem OnCopyInventoryItem;
|
event CopyInventoryItem OnCopyInventoryItem;
|
||||||
|
event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
event MoveInventoryItem OnMoveInventoryItem;
|
event MoveInventoryItem OnMoveInventoryItem;
|
||||||
event RemoveInventoryFolder OnRemoveInventoryFolder;
|
event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||||
event RemoveInventoryItem OnRemoveInventoryItem;
|
event RemoveInventoryItem OnRemoveInventoryItem;
|
||||||
|
|
|
@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public event RequestTaskInventory OnRequestTaskInventory;
|
public event RequestTaskInventory OnRequestTaskInventory;
|
||||||
public event UpdateInventoryItem OnUpdateInventoryItem;
|
public event UpdateInventoryItem OnUpdateInventoryItem;
|
||||||
public event CopyInventoryItem OnCopyInventoryItem;
|
public event CopyInventoryItem OnCopyInventoryItem;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event MoveInventoryItem OnMoveInventoryItem;
|
public event MoveInventoryItem OnMoveInventoryItem;
|
||||||
public event RemoveInventoryItem OnRemoveInventoryItem;
|
public event RemoveInventoryItem OnRemoveInventoryItem;
|
||||||
public event RemoveInventoryFolder OnRemoveInventoryFolder;
|
public event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||||
|
@ -4840,6 +4841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
|
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
|
||||||
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
|
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
|
||||||
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
|
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
|
||||||
|
AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
|
||||||
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
|
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
|
||||||
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
|
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
|
||||||
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
|
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
|
||||||
|
@ -9350,6 +9352,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return true;
|
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)
|
private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public event DisconnectUser OnDisconnectUser;
|
public event DisconnectUser OnDisconnectUser;
|
||||||
public event RequestAvatarProperties OnRequestAvatarProperties;
|
public event RequestAvatarProperties OnRequestAvatarProperties;
|
||||||
public event SetAlwaysRun OnSetAlwaysRun;
|
public event SetAlwaysRun OnSetAlwaysRun;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event DeRezObject OnDeRezObject;
|
public event DeRezObject OnDeRezObject;
|
||||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
public event GenericCall2 OnRequestWearables;
|
public event GenericCall2 OnRequestWearables;
|
||||||
|
|
|
@ -648,6 +648,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newName == null) newName = item.Name;
|
||||||
|
|
||||||
AssetBase asset = AssetService.Get(item.AssetID.ToString());
|
AssetBase asset = AssetService.Get(item.AssetID.ToString());
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
|
@ -694,6 +696,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return asset;
|
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>
|
/// <summary>
|
||||||
/// Move an item within the agent's inventory.
|
/// Move an item within the agent's inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2922,6 +2922,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
client.OnFetchInventory += HandleFetchInventory;
|
client.OnFetchInventory += HandleFetchInventory;
|
||||||
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
||||||
client.OnCopyInventoryItem += CopyInventoryItem;
|
client.OnCopyInventoryItem += CopyInventoryItem;
|
||||||
|
client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
|
||||||
client.OnMoveInventoryItem += MoveInventoryItem;
|
client.OnMoveInventoryItem += MoveInventoryItem;
|
||||||
client.OnRemoveInventoryItem += RemoveInventoryItem;
|
client.OnRemoveInventoryItem += RemoveInventoryItem;
|
||||||
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
|
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
|
||||||
|
|
|
@ -815,6 +815,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
public event ObjectOwner OnObjectOwner;
|
public event ObjectOwner OnObjectOwner;
|
||||||
public event DirPlacesQuery OnDirPlacesQuery;
|
public event DirPlacesQuery OnDirPlacesQuery;
|
||||||
public event DirFindQuery OnDirFindQuery;
|
public event DirFindQuery OnDirFindQuery;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event DirLandQuery OnDirLandQuery;
|
public event DirLandQuery OnDirLandQuery;
|
||||||
public event DirPopularQuery OnDirPopularQuery;
|
public event DirPopularQuery OnDirPopularQuery;
|
||||||
public event DirClassifiedQuery OnDirClassifiedQuery;
|
public event DirClassifiedQuery OnDirClassifiedQuery;
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
#pragma warning disable 67
|
#pragma warning disable 67
|
||||||
public event Action<IClientAPI> OnLogout;
|
public event Action<IClientAPI> OnLogout;
|
||||||
public event ObjectPermissions OnObjectPermissions;
|
public event ObjectPermissions OnObjectPermissions;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event MoneyTransferRequest OnMoneyTransferRequest;
|
public event MoneyTransferRequest OnMoneyTransferRequest;
|
||||||
public event ParcelBuy OnParcelBuy;
|
public event ParcelBuy OnParcelBuy;
|
||||||
public event Action<IClientAPI> OnConnectionClosed;
|
public event Action<IClientAPI> OnConnectionClosed;
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
public event MoneyTransferRequest OnMoneyTransferRequest;
|
public event MoneyTransferRequest OnMoneyTransferRequest;
|
||||||
public event ParcelBuy OnParcelBuy;
|
public event ParcelBuy OnParcelBuy;
|
||||||
public event Action<IClientAPI> OnConnectionClosed;
|
public event Action<IClientAPI> OnConnectionClosed;
|
||||||
|
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||||
public event ImprovedInstantMessage OnInstantMessage;
|
public event ImprovedInstantMessage OnInstantMessage;
|
||||||
public event ChatMessage OnChatFromClient;
|
public event ChatMessage OnChatFromClient;
|
||||||
public event TextureRequest OnRequestTexture;
|
public event TextureRequest OnRequestTexture;
|
||||||
|
|
Loading…
Reference in New Issue