Example #1
0
        public TradeOfferManager(string apiKey, string sessionId, string token, string tokensecure)
        {
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            if (sessionId == null)
            {
                throw new ArgumentNullException("sessionId");
            }

            if (token == null)
            {
                throw new ArgumentNullException("token");
            }

            if (tokensecure == null)
            {
                throw new ArgumentNullException("tokensecure");
            }

            this.apiKey      = apiKey;
            this.sessionId   = sessionId;
            this.token       = token;
            this.tokensecure = tokensecure;

            webApi  = new TradeOfferWebAPI(this.apiKey);
            session = new OfferSession(this.sessionId, this.token, this.tokensecure, webApi);
        }
Example #2
0
        public OfferSession(TradeOfferWebAPI webApi, SteamWeb steamWeb)
        {
            this.webApi   = webApi;
            this.steamWeb = steamWeb;

            JsonSerializerSettings = new JsonSerializerSettings();
            JsonSerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.None;
            JsonSerializerSettings.Formatting = Formatting.None;
        }
Example #3
0
        public TradeOfferManager(string apiKey, SteamWeb steamWeb)
        {
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            webApi  = new TradeOfferWebAPI(apiKey, steamWeb);
            session = new OfferSession(webApi, steamWeb);
        }
Example #4
0
        public TradeOfferManager(string apiKey, SteamWeb steamWeb)
        {
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            LastTimeCheckedOffers = DateTime.MinValue;
            webApi  = new TradeOfferWebAPI(apiKey, steamWeb);
            session = new OfferSession(webApi, steamWeb);
            unhandledTradeOfferUpdates = new Queue <Offer>();
        }
Example #5
0
        public OfferSession(string sessionId, string token, string tokensecure, TradeOfferWebAPI webApi)
        {
            Cookies.Add(new Cookie("sessionid", sessionId, String.Empty, "steamcommunity.com"));
            Cookies.Add(new Cookie("steamLogin", token, String.Empty, "steamcommunity.com"));
            Cookies.Add(new Cookie("steamLoginSecure", tokensecure, String.Empty, "steamcommunity.com"));

            SessionId        = sessionId;
            SteamLogin       = token;
            SteamLoginSecure = tokensecure;
            this.WebApi      = webApi;

            JsonSerializerSettings = new JsonSerializerSettings();
            JsonSerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.None;
            JsonSerializerSettings.Formatting = Formatting.None;
        }