Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TradeSession"/> class.
        /// </summary>
        /// <param name="otherSid">The Steam id of the other trading partner.</param>
        /// <param name="steamWeb">The SteamWeb instance for this bot</param>
        public TradeSession(SteamID otherSid, SteamWeb steamWeb)
        {
            OtherSID = otherSid;
            SteamWeb = steamWeb;

            Init();
        }
        public TradeOfferManager(string apiKey, SteamWeb steamWeb)
        {
            if (apiKey == null)
                throw new ArgumentNullException("apiKey");

            webApi = new TradeOfferWebAPI(apiKey, steamWeb);
            session = new OfferSession(webApi, steamWeb);
        }
Beispiel #3
0
        public OfferSession(TradeOfferWebAPI webApi, SteamWeb steamWeb)
        {
            this.webApi = webApi;
            this.steamWeb = steamWeb;

            JsonSerializerSettings = new JsonSerializerSettings();
            JsonSerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.None;
            JsonSerializerSettings.Formatting = Formatting.None;
        }
        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>();
        }
Beispiel #5
0
 public Trade(TradeOffers tradeOffers, SteamID partnerId, SteamWeb steamWeb)
 {
     _tradeOffers = tradeOffers;
     _partnerId = partnerId;
     _steamWeb = steamWeb;
     tradeStatus = new TradeStatus
     {
         version = 1,
         newversion = true
     };
     tradeStatus.me = new TradeStatusUser(ref tradeStatus);
     tradeStatus.them = new TradeStatusUser(ref tradeStatus);
 }