示例#1
0
        protected override void ProcessRequest(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, OSDMap osd)
        {
            string      action    = osd["action"].AsString();
            OSDArray    selection = (OSDArray)osd["selection"];
            List <uint> sel       = new List <uint>();

            for (int i = 0; i < selection.Count; i++)
            {
                sel.Add(selection[i].AsUInteger());
            }

            Util.FireAndForget(
                x => { m_module.HandleMenuSelection(action, m_agentID, sel); }, null, "DynamicMenuModule.HandleMenuSelection");

            httpResponse.StatusCode = (int)HttpStatusCode.OK;
            //httpResponse.RawBuffer = Util.UTF8NBGetbytes("<llsd></llsd>");
        }
        protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
        {
            StreamReader reader      = new StreamReader(request);
            string       requestBody = reader.ReadToEnd();

            OSD osd = OSDParser.DeserializeLLSDXml(requestBody);

            string      action    = ((OSDMap)osd)["action"].AsString();
            OSDArray    selection = (OSDArray)((OSDMap)osd)["selection"];
            List <uint> sel       = new List <uint>();

            for (int i = 0; i < selection.Count; i++)
            {
                sel.Add(selection[i].AsUInteger());
            }

            Util.FireAndForget(x => { m_module.HandleMenuSelection(action, m_agentID, sel); });

            Encoding encoding = Encoding.UTF8;

            return(encoding.GetBytes(OSDParser.SerializeLLSDXmlString(new OSD())));
        }