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

Serialize() public method

Serialize the object
public Serialize ( ) : OSDMap
return OSDMap
        public override OSDMap Serialize()
        {
            OSDMap map = new OSDMap(4);
            map["is_script_running"] = OSD.FromBoolean(ScriptRunning);
            map["item_id"] = OSD.FromUUID(ItemID);
            map["target"] = OSD.FromString(Target);
            map["task_id"] = OSD.FromUUID(TaskID);
            return map;
        }

Usage Example

コード例 #1
0
ファイル: InventoryManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Update an existing script in an task 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="taskID">UUID of the prim containting the script</param>
        /// <param name="mono">if true, sets the script content to run on the mono interpreter</param>
        /// <param name="running">if true, sets the script to running</param>
        /// <param name="callback"></param>
        public void RequestUpdateScriptTask(byte[] data, UUID itemID, UUID taskID, bool mono, bool running, ScriptUpdatedCallback callback)
        {
            Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("UpdateScriptTask");

            if (url != null)
            {
                UpdateScriptTaskUpdateMessage msg = new UpdateScriptTaskUpdateMessage();
                msg.ItemID = itemID;
                msg.TaskID = taskID;
                msg.ScriptRunning = running;
                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("UpdateScriptTask capability is not currently available");
            }
        }
All Usage Examples Of OpenMetaverse.Messages.Linden.UpdateScriptTaskUpdateMessage::Serialize
UpdateScriptTaskUpdateMessage