private void Exit(bool kill = false) { if (!kill) { InstallationQueue.Enqueue("-1"); } else { Exited?.Invoke(this, new EventArgs()); Active = false; steam.close(SteamExitReason.NothingSpecial, 5000); } }
static void Main(string[] args) { SteamInstaller installer = new SteamInstaller("C:\\SteamTest\\"); if (!installer.Installed) { Console.WriteLine("Preparing steamcmd.."); installer.installSteam(); SteamInstance _ = new SteamInstance(new System.IO.FileInfo(installer.Folder.FullName + "\\steamcmd.exe")); _.tryGetSteamLogin(); _.close().Wait(); } SteamInstance.killAll(); SteamInstance instance = new SteamInstance(new System.IO.FileInfo(installer.Folder.FullName + "\\steamcmd.exe")); instance.SteamOutput += Instance_SteamOutput; instance.LoggedIn += Instance_LoggedIn; Console.WriteLine("Please enter your steam-username:"******"Please enter your password:"******"Please enter your steam guard code:"); string code = Console.ReadLine(); Console.WriteLine(instance.login(username, password, code)); } else { Console.WriteLine("Result: " + r.ToString()); } instance.SteamOutput -= Instance_SteamOutput; Console.WriteLine("Press return to exit.."); Console.ReadLine(); instance.close(); }