Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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>();
        }
Exemplo n.º 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;
        }