Make scripted item and folder gives pop up a "accept, decline" message
and allow deletion of the just received item.0.6.1-post-fixes
parent
07330b0ea4
commit
3aa7ad24da
|
@ -1121,15 +1121,16 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="folderID"></param>
|
||||
/// <param name="part"></param>
|
||||
/// <param name="itemID"></param>
|
||||
public void MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId)
|
||||
public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId)
|
||||
{
|
||||
InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId);
|
||||
|
||||
if (agentItem == null)
|
||||
return;
|
||||
return null;
|
||||
|
||||
agentItem.Folder = folderId;
|
||||
AddInventoryItem(remoteClient, agentItem);
|
||||
return agentItem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1178,13 +1179,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="folderID"></param>
|
||||
/// <param name="part"></param>
|
||||
/// <param name="itemID"></param>
|
||||
public void MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId)
|
||||
public InventoryItemBase MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId)
|
||||
{
|
||||
ScenePresence avatar;
|
||||
|
||||
if (TryGetAvatar(avatarId, out avatar))
|
||||
{
|
||||
MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId);
|
||||
return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1201,11 +1202,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId);
|
||||
|
||||
if (agentItem == null)
|
||||
return;
|
||||
return null;
|
||||
|
||||
agentItem.Folder = folderId;
|
||||
|
||||
AddInventoryItem(avatarId, agentItem);
|
||||
|
||||
return agentItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1310,7 +1313,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
public void MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items)
|
||||
public UUID MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items)
|
||||
{
|
||||
CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID);
|
||||
if (profile == null || profile.RootFolder == null)
|
||||
|
@ -1319,7 +1322,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
"[PRIM INVENTORY]: " +
|
||||
"Avatar {0} cannot be found to add items",
|
||||
destID);
|
||||
return;
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
UUID newFolderID = UUID.Random();
|
||||
|
@ -1347,6 +1350,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
profile.SendInventoryDecendents(avatar.ControllingClient,
|
||||
newFolderID, false, true);
|
||||
}
|
||||
|
||||
return newFolderID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -79,6 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
private DateTime m_timer = DateTime.Now;
|
||||
private bool m_waitingForScriptAnswer=false;
|
||||
private bool m_automaticLinkPermission=false;
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
|
||||
//private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
@ -98,6 +99,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
m_automaticLinkPermission =
|
||||
m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
|
||||
|
||||
m_TransferModule =
|
||||
m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
|
||||
AsyncCommands = new AsyncCommandManager(ScriptEngine);
|
||||
}
|
||||
|
||||
|
@ -2654,11 +2657,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid;
|
||||
msg.binaryBucket = new byte[0];// binaryBucket;
|
||||
|
||||
IMessageTransferModule tr = World.RequestModuleInterface<IMessageTransferModule>();
|
||||
|
||||
if (tr != null)
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
tr.SendInstantMessage(msg, delegate(bool success) {} );
|
||||
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
|
||||
}
|
||||
ScriptSleep(2000);
|
||||
}
|
||||
|
@ -3318,6 +3319,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
bool found = false;
|
||||
UUID destId = UUID.Zero;
|
||||
UUID objId = UUID.Zero;
|
||||
int assetType = 0;
|
||||
string objName = String.Empty;
|
||||
|
||||
if (!UUID.TryParse(destination, out destId))
|
||||
{
|
||||
|
@ -3332,6 +3335,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
found = true;
|
||||
objId = inv.Key;
|
||||
assetType = inv.Value.Type;
|
||||
objName = inv.Value.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3346,7 +3351,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (World.GetScenePresence(destId) != null)
|
||||
{
|
||||
// destination is an avatar
|
||||
InventoryItemBase agentItem =
|
||||
World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId);
|
||||
|
||||
if (agentItem == null)
|
||||
return;
|
||||
|
||||
byte[] bucket = new byte[17];
|
||||
bucket[0] = (byte)assetType;
|
||||
byte[] objBytes = objId.GetBytes();
|
||||
Array.Copy(objBytes, 0, bucket, 1, 16);
|
||||
|
||||
GridInstantMessage msg = new GridInstantMessage(World,
|
||||
m_host.UUID, m_host.Name+", an object owned by "+
|
||||
resolveName(m_host.OwnerID)+",", destId,
|
||||
(byte)InstantMessageDialog.InventoryOffered,
|
||||
false, objName+"\n"+m_host.Name+" is located at "+
|
||||
World.RegionInfo.RegionName+" "+
|
||||
m_host.AbsolutePosition.ToString(),
|
||||
agentItem.ID, true, m_host.AbsolutePosition,
|
||||
bucket);
|
||||
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5485,7 +5512,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (itemList.Count == 0)
|
||||
return;
|
||||
|
||||
m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList);
|
||||
UUID folderID = m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList);
|
||||
|
||||
if (folderID == UUID.Zero)
|
||||
return;
|
||||
|
||||
byte[] bucket = new byte[17];
|
||||
bucket[0] = (byte)AssetType.Folder;
|
||||
byte[] objBytes = folderID.GetBytes();
|
||||
Array.Copy(objBytes, 0, bucket, 1, 16);
|
||||
|
||||
GridInstantMessage msg = new GridInstantMessage(World,
|
||||
m_host.UUID, m_host.Name+", an object owned by "+
|
||||
resolveName(m_host.OwnerID)+",", destID,
|
||||
(byte)InstantMessageDialog.InventoryOffered,
|
||||
false, category+"\n"+m_host.Name+" is located at "+
|
||||
World.RegionInfo.RegionName+" "+
|
||||
m_host.AbsolutePosition.ToString(),
|
||||
folderID, true, m_host.AbsolutePosition,
|
||||
bucket);
|
||||
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
|
||||
}
|
||||
|
||||
public void llSetVehicleType(int type)
|
||||
|
|
Loading…
Reference in New Issue