OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
/// <summary>
/// Called by the CopyInventoryFromNotecard caps handler.
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
Called by the CopyInventoryFromNotecard caps handler.
Called by the CopyInventoryFromNotecard caps handler .
public string CopyInventoryFromNotecard(string request, string path, string param,
                                             IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
        {
            Hashtable response = new Hashtable();
            response["int_response_code"] = 404;
            response["content_type"] = "text/plain";
            response["keepalive"] = false;
            response["str_response_string"] = "";
            try
            {
                OSDMap content = (OSDMap)OSDParser.DeserializeLLSDXml(request);
                UUID objectID = content["object-id"].AsUUID();
                UUID notecardID = content["notecard-id"].AsUUID();
                UUID folderID = content["folder-id"].AsUUID();
                UUID itemID = content["item-id"].AsUUID();
                if (objectID != UUID.Zero)
                {
                    SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
                    if (part != null)
                    {
                        if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, m_HostCapsObj.AgentID))
                        {
                            return LLSDHelpers.SerialiseLLSDReply(response);
                        }
                    }
                }
                InventoryItemBase item = null;
                InventoryItemBase copyItem = null;
                IClientAPI client = null;
                m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
                item = m_Scene.InventoryService.GetItem(new InventoryItemBase(itemID));
                if (item != null)
                {
                    string message;
                    copyItem = m_Scene.GiveInventoryItem(m_HostCapsObj.AgentID, item.Owner, itemID, folderID, out message);
                    if (client != null)
                    {
                        if (copyItem != null)
                        {
                            m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
                            client.SendBulkUpdateInventory(copyItem);
                        }
                        else
                        {
                            client.SendAgentAlertMessage(message, false);
                        }
                    }
                }
                else
                {
                    m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard - Failed to retrieve item {0} from notecard {1}", itemID, notecardID);
                    if (client != null)
                        client.SendAgentAlertMessage("Failed to retrieve item", false);
                }
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard : {0}", e.ToString());
            }
            response["int_response_code"] = 200;
            return LLSDHelpers.SerialiseLLSDReply(response);
        }
public string CopyInventoryFromNotecard ( string request , string path , string param , IOSHttpRequest httpRequest , IOSHttpResponse httpResponse ) { Hashtable response = new Hashtable ( ) ; response [ " " ] = 404 ; response [ " " ] = " " ; response [ " " ] = false ; response [ " " ] = " " ; try { OSDMap content = ( OSDMap ) OSDParser . DeserializeLLSDXml ( request ) ; UUID objectID = content [ " " ] . AsUUID ( ) ; UUID notecardID = content [ " " ] . AsUUID ( ) ; UUID folderID = content [ " " ] . AsUUID ( ) ; UUID itemID = content [ " " ] . AsUUID ( ) ; if ( objectID != UUID . Zero ) { SceneObjectPart part = m_Scene . GetSceneObjectPart ( objectID ) ; if ( part != null ) { if ( ! m_Scene . Permissions . CanCopyObjectInventory ( notecardID , objectID , m_HostCapsObj . AgentID ) ) { return LLSDHelpers . SerialiseLLSDReply ( response ) ; } } } InventoryItemBase item = null ; InventoryItemBase copyItem = null ; IClientAPI client = null ; m_Scene . TryGetClient ( m_HostCapsObj . AgentID , out client ) ; item = m_Scene . InventoryService . GetItem ( new InventoryItemBase ( itemID ) ) ; if ( item != null ) { string message ; copyItem = m_Scene . GiveInventoryItem ( m_HostCapsObj . AgentID , item . Owner , itemID , folderID , out message ) ; if ( client != null ) { if ( copyItem != null ) { m_log . InfoFormat ( " " , copyItem . ID , copyItem . Folder ) ; client . SendBulkUpdateInventory ( copyItem ) ; } else { client . SendAgentAlertMessage ( message , false ) ; } } } else { m_log . ErrorFormat ( " " , itemID , notecardID ) ; if ( client != null ) client . SendAgentAlertMessage ( " " , false ) ; } } catch ( Exception e ) { m_log . ErrorFormat ( " " , e . ToString ( ) ) ; } response [ " " ] = 200 ; return LLSDHelpers . SerialiseLLSDReply ( response ) ; }
Called by the CopyInventoryFromNotecard caps handler.
Called by the CopyInventoryFromNotecard caps handler .
//  m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, FolderID:{0}, ItemID:{1}, NotecardID:{2}, ObjectID:{3}", folderID, itemID, notecardID, objectID); //                        TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
request
string
None
path
string
None
param
string
None
httpRequest
IOSHttpRequest
httpResponse
IOSHttpResponse