/// <summary>
        /// Gets response in json/xml/vdf format.
        /// </summary>
        /// <param name="format"></param>
        /// <returns></returns>
        public virtual string GetRawResponse(Format format)
        {
            if (Socket == null)
            {
                Socket = new SteamSocket();
            }
            string response = string.Empty;

            if (format == ReceivedFormat)
            {
                response = ReceivedResponse;
            }
            else
            {
                RequestUrl.Format = format;
                response          = Socket.GetResponse(RequestUrl.ToString());
            }
            return(response);
        }
Beispiel #2
0
        private GetGroupDetailsResponse GetGroupDetails(string url)
        {
            var reply = new SteamSocket().GetResponse(url);

            doc.LoadXml(reply);
            doc.RemoveChild(doc.FirstChild);
            RemoveCData("memberList/groupDetails/groupName");
            RemoveCData("memberList/groupDetails/groupURL");
            RemoveCData("memberList/groupDetails/headline");
            RemoveCData("memberList/groupDetails/summary");
            RemoveCData("memberList/groupDetails/avatarIcon");
            RemoveCData("memberList/groupDetails/avatarMedium");
            RemoveCData("memberList/groupDetails/avatarFull");
            doc.SelectSingleNode("memberList").RemoveChild(doc.SelectSingleNode("memberList/memberCount"));
            doc.SelectSingleNode("memberList").InnerXml += doc.SelectSingleNode("memberList/members").InnerXml;
            doc.SelectSingleNode("memberList").RemoveChild(doc.SelectSingleNode("memberList/members"));
            var jsonString = JsonConvert.SerializeXmlNode(doc);
            var response   = ParseResponse <GetGroupDetailsResponse>(jsonString);

            response.ReceivedResponse = reply;
            return(response);
        }