internal SteamID(SteamUniverse universe, SteamAccountType accountType, SteamInstance instance, uint accountID) { Universe = universe; Type = accountType; Instance = instance; AccountID = accountID; }
public U3WorkshopInstaller(U3Server server, FileInfo steamcmd) { this.server = server; steam = new SteamInstance(steamcmd); steam.ModDownloaded += Steam_ModDownloaded; steam.SteamOutput += Steam_SteamOutput; if (PrepareSteam(steam).Result) { MapFolder = new DirectoryInfo(this.server.ServerInformation.ServerDirectory.Parent.Parent.FullName + "\\Bundles\\Workshop\\Maps"); ContentFolder = new DirectoryInfo(this.server.ServerInformation.ServerDirectory.FullName + "\\Workshop\\Content\\"); if (!MapFolder.Exists) { MapFolder.Create(); } if (!ContentFolder.Exists) { ContentFolder.Create(); } } else { Exception ex = new Exception("Unable to start steamcmd correctly!"); throw ex; } }
public bool Install() { var steam = SteamInstance.Get(); var dota = steam.GetGame(AppIDs.DOTA2_ID); return(dota.Install(ModContainer)); }
/// <summary> /// Constructs a Steam Id from the four components. /// </summary> /// <param name="universe">Which Steam system this Steam Id belongs to (such as Public)</param> /// <param name="accountType">The type of account for this Steam Id (such as Individual)</param> /// <param name="accountId">The 32-bit account identifier for the Steam account</param> /// <param name="instance">Not really sure. It seems to mostly be "1".</param> public SteamId(SteamUniverse universe, SteamAccountType accountType, uint accountId, SteamInstance instance) { Universe = universe; AccountType = accountType; Instance = instance; AccountId = accountId; ResolvedFrom = SteamIdResolvedFrom.IndividualComponents; }
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(); }
public MainWindow() { Utilities.Utilities.RegisterException(); _updater = new Updater(); CheckForUpdates(); ResizeMode = ResizeMode.NoResize; _steam = SteamInstance.Get(); _steam.IndexAllGames(); _dota = _steam.GetGame(AppIDs.DOTA2_ID); DataContext = this; InitializeComponent(); d2.Title += " V" + _currentVersion; BringToFront(); }
private Task <bool> PrepareSteam(SteamInstance steam) { return(Task.Run(() => { try { foreach (string user in Steam.Utils.publicSteamAccounts.Keys) { LoginResult result = steam.login(user, Steam.Utils.publicSteamAccounts[user], "", 6000); if (result == LoginResult.OK) { return true; } } return false; } catch (Exception) { return false; } })); }
public U3SteamInstaller(SteamInstance steam) : base(steam) { }
static void Main(string[] args) { Parser.Default.ParseArguments <Options>(args) .WithParsed(option => { var updater = new Updater(); if (updater.CheckForUpdate()) { Console.WriteLine("Update available!"); Console.WriteLine(updater.GetChangeLog()); } var modPack = Utilities.ReadModConfig(Path.Join(Utilities.AssemblyDirectory(), "config.xml")); var modNames = modPack.Mods.Select(mod => mod.DisplayName).Prepend(ALL); HashSet <string> selectedMods; if (option.All) { selectedMods = new HashSet <string>(new[] { ALL }); } else { selectedMods = Prompt.MultiSelect("Select mods to install:", modNames).ToHashSet(); } if (selectedMods.Contains(ALL)) { foreach (var m in modPack.Mods) { m.Selected = true; } } else { foreach (var mod in modPack.Mods.Where(mod => selectedMods.Contains(mod.DisplayName))) { mod.Selected = true; } } if (option.DotaLocation == null) { var steam = SteamInstance.Get(); steam.IndexAllGames(); var dota = new Dota(steam.LocateGame(AppIDs.DOTA2_ID)); if (!dota.Validate()) { throw new Exception("Unable to find dota"); } if (option.TrySDK) { if (!dota.SDKInstall(modPack, steam)) { throw new Exception($"Unable to install mods using source sdk"); } } else { if (!dota.Install(modPack)) { throw new Exception($"Unable to install mods at \"{steam.LocateGame(AppIDs.DOTA2_ID)}\""); } } } else { if (option.TrySDK) { throw new Exception("Unable to use sdk and custom location at the same time!"); } var dota = new Dota(option.DotaLocation); if (!dota.Validate()) { throw new Exception($"Unable to find dota at \"{option.DotaLocation}\""); } if (!dota.Install(modPack)) { throw new Exception($"Unable to install mods at \"{option.DotaLocation}\""); } } }); }
/// <summary> /// Constructs a Steam Id from the four components. /// </summary> /// <param name="universe">Which Steam system this Steam Id belongs to (such as Public)</param> /// <param name="accountType">The type of account for this Steam Id (such as Individual)</param> /// <param name="accountId">The 32-bit account identifier for the Steam account</param> /// <param name="instance">Not really sure. It seems to mostly be "1".</param> public SteamId(SteamUniverse universe, SteamAccountType accountType, uint accountId, SteamInstance instance) { Universe = universe; AccountType = accountType; Instance = instance; AccountId = accountId; ResolvedFrom = SteamIdResolvedFrom.IndividualComponents; }