OpenMetaverse.Messages.Linden.UpdateScriptAgentRequestMessage.Serialize C# (CSharp) Method

Serialize() public method

Serialize the object
public Serialize ( ) : OSDMap
return OSDMap
        public override OSDMap Serialize()
        {
            OSDMap map = new OSDMap(2);
            map["item_id"] = OSD.FromUUID(ItemID);
            map["target"] = OSD.FromString(Target);
            return map;
        }

Usage Example

Example #1
0
        /// <summary>
        /// Update an existing script in an agents Inventory
        /// </summary>
        /// <param name="data">A byte[] array containing the encoded scripts contents</param>
        /// <param name="itemID">the itemID of the script</param>
        /// <param name="mono">if true, sets the script content to run on the mono interpreter</param>
        /// <param name="callback"></param>
        public void RequestUpdateScriptAgentInventory(byte[] data, UUID itemID, bool mono, ScriptUpdatedCallback callback)
        {
            Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("UpdateScriptAgent");

            if (url != null)
            {
                UpdateScriptAgentRequestMessage msg = new UpdateScriptAgentRequestMessage();
                msg.ItemID = itemID;
                msg.Target = mono ? "mono" : "lsl2";

                CapsClient request = new CapsClient(url);
                request.OnComplete += new CapsClient.CompleteCallback(UpdateScriptAgentInventoryResponse);
                request.UserData = new object[2] { new KeyValuePair<ScriptUpdatedCallback, byte[]>(callback, data), itemID };
                request.BeginGetResponse(msg.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
            }
            else
            {
                throw new Exception("UpdateScriptAgent capability is not currently available");
            }
        }
All Usage Examples Of OpenMetaverse.Messages.Linden.UpdateScriptAgentRequestMessage::Serialize
UpdateScriptAgentRequestMessage