CSharpTradeOffers.Trading.EconServiceHandler.SendTradeOfferWithLink C# (CSharp) Метод

SendTradeOfferWithLink() публичный Метод

Sends a trade offer to the specified recipient that's not on your friends list using the trade url. If is not the case, use SendTradeOffer function.
public SendTradeOfferWithLink ( ulong partnerSid, string token, string tradeoffermessage, string serverid, CSharpTradeOffers.Trading.TradeOffer offer, CookieContainer container ) : SendOfferResponse
partnerSid ulong The SteamId64 (ulong) of the person to send the offer to.
token string The token part from the recipient's trade url. Example: a1b2cdEF
tradeoffermessage string An optional message to be sent with the offer. Can be null.
serverid string Almost always 1, not quite sure what other numbers do.
offer CSharpTradeOffers.Trading.TradeOffer A TradeOffer object containing the trade parameters.
container System.Net.CookieContainer Auth Cookies MUST be passed here, the function will fail if not.
Результат SendOfferResponse
        public SendOfferResponse SendTradeOfferWithLink(ulong partnerSid, string token, string tradeoffermessage,
            string serverid, TradeOffer offer, CookieContainer container)
        {
            const string url = "https://steamcommunity.com/tradeoffer/new/send";
            container.Add(new Cookie("bCompletedTradeOfferTutorial", "true") { Domain = "steamcommunity.com" });
            string sessionid = (from Cookie cookie in container.GetCookies(new Uri("https://steamcommunity.com"))
                                where cookie.Name == "sessionid"
                                select cookie.Value).FirstOrDefault();

            CEconTradeOffer offerToken = new CEconTradeOffer { TradeOfferAccessToken = token };

            var data = new Dictionary<string, string>
            {
                {"sessionid", sessionid},
                {"serverid", serverid},
                {"partner", partnerSid.ToString()},
                {"tradeoffermessage", tradeoffermessage},
                {"json_tradeoffer", JsonConvert.SerializeObject(offer)},
                {"captcha", string.Empty},
                {"trade_offer_create_params", JsonConvert.SerializeObject(offerToken)}
            };
            return
                _web.Fetch(url, "POST", data, container, false,
                    string.Format("https://steamcommunity.com/tradeoffer/new/?partner={0}&token={1}",
                        IdConversions.UlongToAccountId(partnerSid), token), false, 10000, 20)
                    .DeserializeJson<SendOfferResponse>();
        }