static void OnLoginKey(SteamUser.LoginKeyCallback callback) { myUniqueId = callback.UniqueID.ToString(); steamUser.AcceptNewLoginKey(callback); var list = JsonConvert.DeserializeObject <RootObject>(File.ReadAllText(Program.AccountsJsonFile)); foreach (var a in list.Accounts) { if (a.username == user) { a.LoginKey = callback.LoginKey; // check this NewloginKey = callback.LoginKey; // check this if (a.SteamID.ToString() == "0") //add null or empty? { a.SteamID = steamClient.SteamID.ConvertToUInt64(); } Console.WriteLine("[" + Program.BOTNAME + "] - Got Login-Key, setting in config!"); } } File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(list, Formatting.Indented)); }
private void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (rememberLogin) { File.WriteAllText("login.dat", $"{username}|{callback.LoginKey}"); } }
public static void HandleLogin(SteamUser.LoginKeyCallback msg) { Steam.Friends.SetPersonaName(String.IsNullOrWhiteSpace(Configurator.Config.BotName) ? "AgopBot" : Configurator.Config.BotName); Steam.Friends.SetPersonaState((EPersonaState)6); // Looking to Play - hehe. //Join(103582791430091926); Join(103582791433166824); }
void OnLoginKeyCallback(SteamUser.LoginKeyCallback cb) { var login_key_ack = new ClientMsgProtobuf <CMsgClientNewLoginKeyAccepted>(EMsg.ClientNewLoginKeyAccepted); login_key_ack.Body.unique_id = cb.UniqueID; Instance.SteamClient.Send(login_key_ack); }
private void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (string.IsNullOrEmpty(callback.LoginKey)) { return; } IniModel.SetSteamLoginKey(callback.LoginKey); steamUser.AcceptNewLoginKey(callback); }
private void LoginKeyCallback(SteamUser.LoginKeyCallback loginKey) { Console.WriteLine("Accepted new login key for account {0}", logonDetails.Username); ConfigStore.TheConfig.LoginKeys[logonDetails.Username] = loginKey.LoginKey; ConfigStore.Save(); steamUser.AcceptNewLoginKey(loginKey); }
private void LoginKeyCallback(SteamUser.LoginKeyCallback loginKey) { DebugLog.WriteLine("Steam3Session", "Accepted new login key for account " + logonDetails.Username); ConfigStore.TheConfig.LoginKeys[logonDetails.Username] = loginKey.LoginKey; ConfigStore.Save(); steamUser.AcceptNewLoginKey(loginKey); }
private void LoginKeyCallback(SteamUser.LoginKeyCallback loginKey) { Console.WriteLine("Accepted new login key for account {0}", logonDetails.Username); AccountSettingsStore.Instance.LoginKeys[logonDetails.Username] = loginKey.LoginKey; AccountSettingsStore.Save(); steamUser.AcceptNewLoginKey(loginKey); }
/// <summary> /// This is fired when steam gives the login key, so we store it /// </summary> /// <param name="callback"></param> private void OnLoginKey(SteamUser.LoginKeyCallback callback) { if ((callback != null) && (!string.IsNullOrEmpty(callback.LoginKey))) //Check if the data is valid { steamUser.AcceptNewLoginKey(callback); //Tell steam we have accepted their offering File.WriteAllText(LoginKeyFile, callback.LoginKey); //We now will write the data LoginData.LoginKey = callback.LoginKey; //We will now set the login Key used in Log-in Console.WriteLine("Wrote New LoginKey"); //Tell the user we have wrote a new login key file } }
private void OnLoginKey(SteamUser.LoginKeyCallback callback) { // Save unique ID to use with SteamCommunity kraxbot.UniqueID = callback.UniqueID; // Save key to file File.WriteAllTextAsync("loginkey", callback.LoginKey); kraxbot.AcceptNewLoginKey(callback); Kraxbot.Log("Saved login key"); }
void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (callback == null) { return; } File.WriteAllText(loginKeyFileName, callback.LoginKey); steamUser.AcceptNewLoginKey(callback); }
void OnKeyGet(SteamUser.LoginKeyCallback callback) { if (RememberMe == true && File.Exists("sentry.bin")) { byte[] newpass = Encoding.Unicode.GetBytes(callback.LoginKey); byte[] newphashed = CryptoHelper.SymmetricEncrypt(newpass, getstandardkey()); File.WriteAllBytes("UserKey.bin", newphashed); Console.WriteLine("UserKey encrypted and stored!", Console.ForegroundColor = ConsoleColor.Green); Console.ResetColor(); } }
private void LoginKeyCallback(SteamUser.LoginKeyCallback loginKey) { Log.Info("Accepted new login key for account {0}", logonDetails.Username); AccountSettingsStore.Instance.LoginKeys[logonDetails.Username] = loginKey.LoginKey; AccountSettingsStore.Save(); steamUser.AcceptNewLoginKey(loginKey); bDidReceiveLoginKey = true; }
static public void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (callback == null) { return; } informationsteam = (String.Format("Обновляю ключ...")); File.WriteAllText(LoginKeyFileName, callback.LoginKey); SteamUser.AcceptNewLoginKey(callback); informationsteam = (String.Format("Обновляю ключ...готово!")); }
private void OnLoginKey(SteamUser.LoginKeyCallback obj) { Logger.Log24Bit(ConsoleSwatch.XTermColor.Pink, false, Console.Out, string.Empty, "Updating login key file... "); if (File.Exists("login.key")) { File.Delete("login.key"); } User.AcceptNewLoginKey(obj); File.WriteAllText("login.key", obj.LoginKey); Logger.Log24Bit(ConsoleSwatch.XTermColor.Pink, true, Console.Out, string.Empty, "Done!"); }
static public void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (callback == null) { return; } informationsteam = (String.Format("Updating key...")); File.WriteAllText(LoginKeyFileName, callback.LoginKey); SteamUser.AcceptNewLoginKey(callback); informationsteam = (String.Format("Updating key... Done!")); }
private void LoginKey(SteamUser.LoginKeyCallback callback) { myUniqueId = callback.UniqueID.ToString(); UserWebLogOn(); Console.WriteLine("Steam Bot Logged In Completely!"); LoggedIn = true; if (!botThread.IsBusy) { botThread.RunWorkerAsync(); } ScanMarket(); }
/// <summary> /// Retreive the login key for account /// </summary> /// <param name="callback">SteamUser.LoginKeyCallback</param> private void OnLoginKey(SteamUser.LoginKeyCallback callback) { /*With the LoginKey we'll be able to auto-login to the account * without the user needing to enter their Authentication code*/ mLog.Write(Log.LogLevel.Info, $"Received LoginKey from Steam"); mAccountSettings.Details.LoginKey = callback.LoginKey; mSteam.loginDetails.LoginKey = callback.LoginKey; mSteam.uniqueId = callback.UniqueID.ToString(); mSteam.user.AcceptNewLoginKey(callback); if (mAccountSettings.ConnectToSteamCommunity) { mLog.Write(Log.LogLevel.Info, $"Authenticating user ..."); UserWebLogOn(); } }
///<summary> /// Authenticate using SteamKit2 and ISteamUserAuth. /// This does the same as SteamWeb.DoLogin(), but without contacting the Steam Website. /// </summary> /// <remarks>Should this one doesnt work anymore, use <see cref="SteamWeb.DoLogin"/></remarks> public static bool Authenticate(SteamUser.LoginKeyCallback callback, SteamClient client, out string sessionId, out string token) { sessionId = Convert.ToBase64String(Encoding.UTF8.GetBytes(callback.UniqueID.ToString())); using (dynamic userAuth = WebAPI.GetInterface("ISteamUserAuth")) { // generate an AES session key var sessionKey = CryptoHelper.GenerateRandomBlock(32); // rsa encrypt it with the public key for the universe we're on byte[] cryptedSessionKey = null; using (RSACrypto rsa = new RSACrypto(KeyDictionary.GetPublicKey(client.ConnectedUniverse))) { cryptedSessionKey = rsa.Encrypt(sessionKey); } byte[] loginKey = new byte[20]; Array.Copy(Encoding.ASCII.GetBytes(callback.LoginKey), loginKey, callback.LoginKey.Length); // aes encrypt the loginkey with our session key byte[] cryptedLoginKey = CryptoHelper.SymmetricEncrypt(loginKey, sessionKey); KeyValue authResult; try { authResult = userAuth.AuthenticateUser( steamid: client.SteamID.ConvertToUInt64(), sessionkey: HttpUtility.UrlEncode(cryptedSessionKey), encrypted_loginkey: HttpUtility.UrlEncode(cryptedLoginKey), method: "POST" ); } catch (Exception) { token = null; return(false); } token = authResult ["token"].AsString(); return(true); } }
public void OnLoginKey(SteamUser.LoginKeyCallback e) { Bot._myUniqueId = e.UniqueID.ToString(); Bot._userWebLogOn(); if (Trade.CurrentSchema == null) { Log.Info("Downloading Schema..."); Trade.CurrentSchema = Schema.FetchSchema(Bot.ApiKey, Bot.schemaLang); Log.Success("Schema Downloaded!"); } Bot.SteamFriends.SetPersonaName(Bot.DisplayNamePrefix + Bot.DisplayName); Bot.SteamFriends.SetPersonaState(EPersonaState.Online); Log.Success("Steam Bot Logged In Completely!"); Bot._getUserHandler(Bot.SteamClient.SteamID).OnLoginCompleted(); }
private void OnKeyCallback(SteamUser.LoginKeyCallback obj) { var test = new SteamWeb(); var IsLoggedIn = false; do { IsLoggedIn = test.Authenticate(obj.UniqueID.ToString(), _client, _userNonce); if (!IsLoggedIn) { //Log.Warn("Authentication failed, retrying in 2s..."); Thread.Sleep(2000); } } while (!IsLoggedIn); var c**k = test.VerifyCookies(); var steamh = new SteamHandler(test); Token = steamh.GetNextTocken(); _client.Disconnect(); }
private async void OnLoginKeyReceived(SteamUser.LoginKeyCallback loginKeyCallback) { try { CookieManager.LoginKeyUniqueId = loginKeyCallback.UniqueID; CookieManager.CookiesExpired += async(sender, args) => { try { var webApiUserNonceCallback = await _steamUser.RequestWebAPIUserNonce(); if (webApiUserNonceCallback.Result != EResult.OK) { _logger.Warn( $"#{SequenceNumber} Invalid WebAPIUserNonceCallback result: {webApiUserNonceCallback.Result}"); } CookieManager.WebApiUserNonce = webApiUserNonceCallback.Nonce; await CookieManager.Refresh(); } catch (TaskCanceledException) { _logger.Warn($"#{SequenceNumber} Request new WebAPIUserNonce timeout."); } catch (Exception e) { _logger.Fatal($"#{SequenceNumber} Request new WebAPIUserNonce unhandled exception.", e); } }; await CookieManager.Refresh(); } catch (Exception e) { _logger.Fatal($"#{SequenceNumber} Fatal unhandled exception (OnLoginKeyReceived) : {e.Message}"); Restart(); } }
private void OnSteamLoginKey(SteamUser.LoginKeyCallback data) { SteamSentryManager.WriteLoginKey(data, Globals.AppState.LoginState.Username); }
private void OnKeyCallback(SteamUser.LoginKeyCallback obj) { _steamAccount.LoginKey = obj.LoginKey; _steamAccount.Save(); }
public static void WriteLoginKey(SteamUser.LoginKeyCallback data, string username) { AccountSettingsStore.Instance.LoginKeys[username] = data.LoginKey; AccountSettingsStore.Save(); }
private static void OnLoginKeyCallback(SteamUser.LoginKeyCallback callback) { steamFriends.SetPersonaState(EPersonaState.Online); steamFriends.SetPersonaName(displayName); }
private static void OnLoginKey(SteamUser.LoginKeyCallback obj) { user.AcceptNewLoginKey(obj); Console.WriteLine($"Your login key: {obj.LoginKey}"); user.LogOff(); }
private void onLoginKey(SteamUser.LoginKeyCallback callback) { Program.steam.isRunning = false; this.closeForm(); }
private void OnLoginKey(SteamUser.LoginKeyCallback callback) { _authenticationProvider.SaveLoginKey(Credentials, callback.LoginKey); _steamUser.AcceptNewLoginKey(callback); }
public void AcceptNewLoginKey(SteamUser.LoginKeyCallback loginKey) => user.AcceptNewLoginKey(loginKey);