public void initChatSystem() { int num; string[] strArray = SteamHttp.SteamWebRequest(this.cookiesContainer, "chat/", null, "").Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); for (num = 0; num < strArray.Length; num++) { if (strArray[num].IndexOf("WebAPI = new CWebAPI") != -1) { this.access_token = strArray[num].Split(new char[] { '"' })[1]; break; } } string str2 = this.randomInt(13); string[] strArray2 = SteamHttp.SteamWebRequest(this.cookiesContainer, "https://api.steampowered.com/ISteamWebUserPresenceOAuth/Logon/v0001/?jsonp=jQuery" + this.randomInt(0x16) + "_" + str2 + "&ui_mode=web&access_token=" + this.access_token + "&_=" + str2, null, "").Split(new char[] { '"' }); for (num = 0; num < strArray2.Length; num++) { if (strArray2[num] == "umqid") { this.umquid = strArray2[num + 2]; break; } } }
public void sendMessage(string steamID, string message) { string str = this.randomInt(0x16); string str2 = this.randomInt(13); string url = string.Format("https://api.steampowered.com/ISteamWebUserPresenceOAuth/Message/v0001/?jsonp=jQuery{0}_{1}&umqid={2}&type=saytext&steamid_dst={3}&text={4}&access_token={5}&_={1}", new object[] { str, str2, this.umquid, steamID, Uri.EscapeDataString(message), this.access_token }); SteamHttp.SteamWebRequest(this.cookiesContainer, url, null, ""); }
public OfferStatus acceptOffer(string[] value, out string error) { error = string.Empty; string str = SteamHttp.SteamWebRequest(this.cookiesContainer, "https://steamcommunity.com/tradeoffer/" + value[0] + "/accept", "sessionid=" + this.sessionID + "&tradeofferid=" + value[0] + "&partner=" + value[1], "tradeoffer/" + value[0] + "/"); if (str != null) { if (str.IndexOf("tradeid") != -1) { return(OfferStatus.Accepted); } error = str; return(OfferStatus.Error); } return(OfferStatus.Error); }
public void getSessionID() { while (!SteamHttp.ObtainsessionID(this.cookiesContainer)) { } if (this.cookiesContainer.Count < 4) { this.cookiesContainer = new CookieContainer(); this.setCookies(true); this.getSessionID(); } else { this.sessionID = this.getCookieValue(this.cookiesContainer, "sessionid"); } }
public void getFriends() { this.friends.Clear(); string[] strArray = SteamHttp.SteamWebRequest(this.cookiesContainer, "profiles/" + this.steamID + "/friends/", null, "").Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); try { for (int i = 0; i < strArray.Length; i++) { if (strArray[i].IndexOf("name=\"friends") != -1) { string item = strArray[i].Split(new char[] { '[', ']' })[3]; if (!this.friends.Contains(item)) { this.friends.Add(item); } } } } catch { } }
public List <string[]> GetItems(string steamID, string appID, string[] contexIds = null) { string str; string str2; List <string[]> whereINeedPut = new List <string[]>(); if (contexIds == null) { str = "profiles/" + steamID + "/inventory/json/" + appID + "/2/?trading=1&market=1"; str2 = SteamHttp.SteamWebRequest(this.cookiesContainer, str, null, ""); try { whereINeedPut = new inventoryjson().Parse(str2, "2"); } catch { return(null); } } else { for (int i = 0; i < contexIds.Length; i++) { str = "profiles/" + steamID + "/inventory/json/" + appID + "/" + contexIds[i] + "/?trading=1&market=1"; str2 = SteamHttp.SteamWebRequest(this.cookiesContainer, str, null, ""); try { List <string[]> willinputed = new inventoryjson().Parse(str2, contexIds[i]); this.addInList(ref whereINeedPut, willinputed); } catch { } } } return((whereINeedPut.Count > 0) ? whereINeedPut : null); }
public List <string[]> getIncomingTradeoffers() { List <string[]> list = new List <string[]>(); string[] strArray = SteamHttp.SteamWebRequest(this.cookiesContainer, "profiles/" + this.steamID + "/tradeoffers/", null, "").Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { if ((strArray[i].IndexOf("tradeofferid_") == -1) || (strArray[i + 11].IndexOf("inactive") != -1)) { continue; } int num2 = -1; for (int j = i; j < strArray.Length; j++) { if (strArray[j].IndexOf("tradeoffer_footer") != -1) { num2 = j; break; } } bool flag = false; for (int k = num2; k > 0; k--) { if (strArray[k].IndexOf("tradeoffer_item_list") != -1) { break; } if (strArray[k].IndexOf("trade_item") != -1) { flag = true; break; } } list.Add(new string[] { strArray[i].Split(new char[] { '"' })[3].Split(new char[] { '_' })[1], strArray[i + 1].Split(new char[] { '\'' })[1], Uri.UnescapeDataString(strArray[i + 1].Split(new string[] { """ }, StringSplitOptions.RemoveEmptyEntries)[1]), flag ? "1" : "0" }); } return(list); }
private string sentItems(string sessionID, string items, string[] Offer, string message = "") { return(SteamHttp.SteamWebRequest(this.cookiesContainer, "tradeoffer/new/send", "sessionid=" + sessionID + "&partner=" + Offer[0] + "&tradeoffermessage=" + Uri.EscapeDataString(message) + "&json_tradeoffer=" + Uri.EscapeDataString(string.Format("{5}\"newversion\":true,\"version\":2,\"me\":{5}\"assets\":[{3}],\"currency\":[],\"ready\":false{6},\"them\":{5}\"assets\":[],\"currency\":[],\"ready\":false{6}{6}", new object[] { sessionID, Offer[0], message, items, Offer[2], "{", "}" })) + "&trade_offer_create_params=" + Uri.EscapeDataString(string.Format("{0}\"trade_offer_access_token\":\"{2}\"{1}", "{", "}", Offer[2])), "tradeoffer/new/?partner=" + Offer[1] + "&token=" + Offer[2])); }
public void declineOffer(string offer) { string str = SteamHttp.SteamWebRequest(this.cookiesContainer, "https://steamcommunity.com/tradeoffer/" + offer + "/decline", "sessionid=" + this.sessionID, this.steamID + "76561198068284082/tradeoffers"); }