private void _userWebLogOn() { do { IsLoggedIn = SteamWeb.Authenticate(_myUniqueId, SteamClient, _myUserNonce); if(!IsLoggedIn) { Log.Warn("Authentication failed, retrying in 2s..."); Thread.Sleep(2000); } } while(!IsLoggedIn); Log.Success("User Authenticated!"); _tradeManager = new TradeManager(ApiKey, SteamWeb, _sendChatToEveryone); _tradeManager.SetTradeTimeLimits(MaximumTradeTime, MaximumActionGap, _tradePollingInterval); _tradeManager.OnTimeout += _onTradeTimeout; _tradeOfferManager = new TradeOfferManager(ApiKey, SteamWeb); _tradeOfferManager.LogDebug = (s) => Log.Debug(s); _tradeOfferManager.LogError = (s) => Log.Error(s); SubscribeTradeOffer(_tradeOfferManager); _cookiesAreInvalid = false; // Success, check trade offers which we have received while we were offline _tradeOfferManager.GetOffers(); }
void UserWebLogOn() { do { IsLoggedIn = SteamWeb.Authenticate(myUniqueId, SteamClient, myUserNonce); if(!IsLoggedIn) { Log.Warn("Authentication failed, retrying in 2s..."); Thread.Sleep(2000); } } while(!IsLoggedIn); Log.Success("User Authenticated!"); tradeManager = new TradeManager(ApiKey, SteamWeb); tradeManager.SetTradeTimeLimits(MaximumTradeTime, MaximumActionGap, tradePollingInterval); tradeManager.OnTimeout += OnTradeTimeout; tradeOfferManager = new TradeOfferManager(ApiKey, SteamWeb); SubscribeTradeOffer(tradeOfferManager); cookiesAreInvalid = false; // Success, check trade offers which we have received while we were offline tradeOfferManager.GetOffers(); }
void UserWebLogOn() { while (true) { bool authd = SteamWeb.Authenticate(MyUniqueId, SteamClient, out sessionId, out token, out tokensecure, MyUserNonce); if (authd) { log.Success("User Authenticated!"); tradeManager = new TradeManager(apiKey, sessionId, token); tradeManager.SetTradeTimeLimits(MaximumTradeTime, MaximiumActionGap, TradePollingInterval); tradeManager.OnTimeout += OnTradeTimeout; tradeOfferManager = new TradeOfferManager(apiKey, sessionId, token, tokensecure); SubscribeTradeOffer(tradeOfferManager); CookiesAreInvalid = false; // Success, check trade offers which we have received while we were offline tradeOfferManager.GetOffers(); break; } else { log.Warn("Authentication failed, retrying in 2s..."); Thread.Sleep(2000); } } }