コード例 #1
0
        /// <summary>
        /// generates a empty llsd settings response for viewer
        /// </summary>
        /// <param name="messageID">the message UUID</param>
        /// <param name="regionID">the region UUID</param>
        public static string EmptySettings(UUID messageID, UUID regionID)
        {
            OSDArray arr = new OSDArray();
            LLSDEnvironmentRequest msg = new LLSDEnvironmentRequest();

            msg.messageID = messageID;
            msg.regionID  = regionID;
            arr.Array.Add(msg);
            return(LLSDHelpers.SerializeLLSDReply(arr));
        }
コード例 #2
0
        public override byte[] Handle(string path, Stream request,
                                      OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
            //Encoding encoding = Encoding.UTF8;
            //StreamReader streamReader = new StreamReader(request, false);

            //string requestBody = streamReader.ReadToEnd();
            //streamReader.Close();

            // OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap)
            //    OpenMetaverse.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request));

            Hashtable hash        = (Hashtable)LLSD.LLSDDeserialize(request);
            TRequest  llsdRequest = new TRequest();

            LLSDHelpers.DeserializeOSDMap(hash, llsdRequest);

            TResponse response = m_method(llsdRequest);

            Encoding encoding = new UTF8Encoding(false);

            return(encoding.GetBytes(LLSDHelpers.SerializeLLSDReply(response)));
        }