diff --git a/ASFui/API.cs b/ASFui/API.cs index 60f8077..383ee85 100644 --- a/ASFui/API.cs +++ b/ASFui/API.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.Net; using System.Text; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ASFui { @@ -20,14 +18,6 @@ private IEnumerable GetBots() return _data.Bot.Keys; } - private static string GetAppName(uint id) - { - var url = "http://store.steampowered.com/api/appdetails?appids=" + id; - var content = new WebClient().DownloadString(url); - var json = JObject.Parse(content); - return json[id.ToString()]["data"]["name"].ToString(); - } - public string AllApi() { var result = new StringBuilder(); @@ -38,15 +28,16 @@ public string AllApi() result.Append(@" ⟐ Active: " + _data.Bot[bot].KeepRunning + Environment.NewLine); var games = _data.Bot[bot].CardsFarmer.GamesToFarm; - if (games.Keys.Count > 0) + if (games.Count > 0) { result.Append(@" ⟐ Games to Farm:" + Environment.NewLine); foreach (var game in games) { - var timePlayed = TimeSpan.FromHours(game.Value); - result.Append(@" ◇ " + GetAppName(game.Key) + @"; Time Farmed: " - + string.Format("{0:00}:{1:00}", timePlayed.Hours, timePlayed.Minutes) + Environment.NewLine); + var timePlayed = TimeSpan.FromHours(game.HoursPlayed); + result.Append(@" ◇ " + game.GameName + @"; Hours Played: " + + $"{timePlayed.Hours:00}:{timePlayed.Minutes:00}" + + @"; Cards Remaining: " + game.CardsRemaining + Environment.NewLine); } } else @@ -62,7 +53,7 @@ public string AllApi() foreach (var game in farming) { - result.Append(@" ◇ " + GetAppName(game) + Environment.NewLine); + result.Append(@" ◇ " + game.GameName + Environment.NewLine); } } else diff --git a/ASFui/ASFui.Designer.cs b/ASFui/ASFui.Designer.cs index edd995e..9daf4d0 100644 --- a/ASFui/ASFui.Designer.cs +++ b/ASFui/ASFui.Designer.cs @@ -45,7 +45,6 @@ private void InitializeComponent() this.btn2FA = new System.Windows.Forms.Button(); this.btn2FAOk = new System.Windows.Forms.Button(); this.btn2FANo = new System.Windows.Forms.Button(); - this.btn2FAOff = new System.Windows.Forms.Button(); this.gbCards = new System.Windows.Forms.GroupBox(); this.tlpCards = new System.Windows.Forms.TableLayoutPanel(); this.btnFarm = new System.Windows.Forms.Button(); @@ -172,12 +171,13 @@ private void InitializeComponent() // // btnReloadBots // + this.btnReloadBots.BackgroundImage = global::ASFui.Properties.Resources.refresh; + this.btnReloadBots.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnReloadBots.Enabled = false; this.btnReloadBots.Location = new System.Drawing.Point(209, 467); this.btnReloadBots.Name = "btnReloadBots"; this.btnReloadBots.Size = new System.Drawing.Size(23, 23); this.btnReloadBots.TabIndex = 7; - this.btnReloadBots.Text = "🔃"; this.btnReloadBots.UseVisualStyleBackColor = true; this.btnReloadBots.Click += new System.EventHandler(this.btnReloadBots_Click); // @@ -239,15 +239,14 @@ private void InitializeComponent() // // tlp2FA // - this.tlp2FA.ColumnCount = 4; - this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tlp2FA.ColumnCount = 3; + this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tlp2FA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tlp2FA.Controls.Add(this.btn2FA, 0, 0); - this.tlp2FA.Controls.Add(this.btn2FAOk, 2, 0); - this.tlp2FA.Controls.Add(this.btn2FANo, 3, 0); - this.tlp2FA.Controls.Add(this.btn2FAOff, 1, 0); + this.tlp2FA.Controls.Add(this.btn2FAOk, 1, 0); + this.tlp2FA.Controls.Add(this.btn2FANo, 2, 0); this.tlp2FA.Location = new System.Drawing.Point(6, 19); this.tlp2FA.Name = "tlp2FA"; this.tlp2FA.RowCount = 1; @@ -260,7 +259,7 @@ private void InitializeComponent() this.btn2FA.Enabled = false; this.btn2FA.Location = new System.Drawing.Point(3, 3); this.btn2FA.Name = "btn2FA"; - this.btn2FA.Size = new System.Drawing.Size(173, 25); + this.btn2FA.Size = new System.Drawing.Size(233, 25); this.btn2FA.TabIndex = 0; this.btn2FA.Text = "Generate Token"; this.btn2FA.UseVisualStyleBackColor = true; @@ -269,9 +268,9 @@ private void InitializeComponent() // btn2FAOk // this.btn2FAOk.Enabled = false; - this.btn2FAOk.Location = new System.Drawing.Point(361, 3); + this.btn2FAOk.Location = new System.Drawing.Point(242, 3); this.btn2FAOk.Name = "btn2FAOk"; - this.btn2FAOk.Size = new System.Drawing.Size(173, 25); + this.btn2FAOk.Size = new System.Drawing.Size(233, 25); this.btn2FAOk.TabIndex = 2; this.btn2FAOk.Text = "Accept Pending Confirmations"; this.btn2FAOk.UseVisualStyleBackColor = true; @@ -280,25 +279,14 @@ private void InitializeComponent() // btn2FANo // this.btn2FANo.Enabled = false; - this.btn2FANo.Location = new System.Drawing.Point(540, 3); + this.btn2FANo.Location = new System.Drawing.Point(481, 3); this.btn2FANo.Name = "btn2FANo"; - this.btn2FANo.Size = new System.Drawing.Size(175, 25); + this.btn2FANo.Size = new System.Drawing.Size(234, 25); this.btn2FANo.TabIndex = 3; this.btn2FANo.Text = "Deny Pending Confirmations"; this.btn2FANo.UseVisualStyleBackColor = true; this.btn2FANo.Click += new System.EventHandler(this.btn2FANo_Click); // - // btn2FAOff - // - this.btn2FAOff.Enabled = false; - this.btn2FAOff.Location = new System.Drawing.Point(182, 3); - this.btn2FAOff.Name = "btn2FAOff"; - this.btn2FAOff.Size = new System.Drawing.Size(173, 25); - this.btn2FAOff.TabIndex = 1; - this.btn2FAOff.Text = "Deactivate 2FA"; - this.btn2FAOff.UseVisualStyleBackColor = true; - this.btn2FAOff.Click += new System.EventHandler(this.btn2FAOff_Click); - // // gbCards // this.gbCards.Controls.Add(this.tlpCards); @@ -716,21 +704,23 @@ private void InitializeComponent() // // btnASFuiSettings // + this.btnASFuiSettings.BackgroundImage = global::ASFui.Properties.Resources.settings; + this.btnASFuiSettings.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnASFuiSettings.Location = new System.Drawing.Point(477, 468); this.btnASFuiSettings.Name = "btnASFuiSettings"; this.btnASFuiSettings.Size = new System.Drawing.Size(23, 23); this.btnASFuiSettings.TabIndex = 32; - this.btnASFuiSettings.Text = "🔧"; this.btnASFuiSettings.UseVisualStyleBackColor = true; this.btnASFuiSettings.Click += new System.EventHandler(this.btnASFuiSettings_Click); // // btnASFuiHelp // + this.btnASFuiHelp.BackgroundImage = global::ASFui.Properties.Resources.help; + this.btnASFuiHelp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnASFuiHelp.Location = new System.Drawing.Point(448, 468); this.btnASFuiHelp.Name = "btnASFuiHelp"; this.btnASFuiHelp.Size = new System.Drawing.Size(23, 23); this.btnASFuiHelp.TabIndex = 33; - this.btnASFuiHelp.Text = "❓"; this.btnASFuiHelp.UseVisualStyleBackColor = true; this.btnASFuiHelp.Click += new System.EventHandler(this.btnASFuiHelp_Click); // @@ -815,7 +805,6 @@ private void InitializeComponent() private System.Windows.Forms.Button btn2FA; private System.Windows.Forms.Button btn2FAOk; private System.Windows.Forms.Button btn2FANo; - private System.Windows.Forms.Button btn2FAOff; private System.Windows.Forms.GroupBox gbChat; private System.Windows.Forms.TableLayoutPanel tlpChat; private System.Windows.Forms.Button btnLeave; diff --git a/ASFui/ASFui.cs b/ASFui/ASFui.cs index 213d7ee..20229c5 100644 --- a/ASFui/ASFui.cs +++ b/ASFui/ASFui.cs @@ -609,7 +609,6 @@ private void EnableElements() btnASFVersion.Enabled = true; btnAPI.Enabled = true; btn2FA.Enabled = true; - btn2FAOff.Enabled = true; btn2FAOk.Enabled = true; btn2FANo.Enabled = true; } @@ -638,7 +637,6 @@ private void DisableElements() btnASFVersion.Enabled = false; btnAPI.Enabled = false; btn2FA.Enabled = false; - btn2FAOff.Enabled = false; btn2FAOk.Enabled = false; btn2FANo.Enabled = false; diff --git a/ASFui/ASFui.csproj b/ASFui/ASFui.csproj index 60bb05d..2f52503 100644 --- a/ASFui/ASFui.csproj +++ b/ASFui/ASFui.csproj @@ -157,6 +157,9 @@ Always + + + Designer diff --git a/ASFui/Bot.cs b/ASFui/Bot.cs index 0ef9705..11784c1 100644 --- a/ASFui/Bot.cs +++ b/ASFui/Bot.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; namespace ASFui { + [SuppressMessage("ReSharper", "InconsistentNaming")] public class Bot { public class Root @@ -23,14 +25,29 @@ public class Bots public class CardsFarmer { [JsonProperty("GamesToFarm")] - public Dictionary GamesToFarm { get; set; } + public HashSet GamesToFarm { get; set; } [JsonProperty("CurrentGamesFarming")] - public HashSet CurrentGamesFarming { get; set; } + public HashSet CurrentGamesFarming { get; set; } [JsonProperty("ManualMode")] public bool ManualMode { get; set; } } + public class Game + { + [JsonProperty("AppID")] + public uint AppID { get; set; } + + [JsonProperty("GameName")] + public string GameName { get; set; } + + [JsonProperty("HoursPlayed")] + public float HoursPlayed { get; set; } + + [JsonProperty("CardsRemaining")] + public ushort CardsRemaining { get; set; } + } + } -} +} \ No newline at end of file diff --git a/ASFui/Client.cs b/ASFui/Client.cs index c9881e6..b467ce1 100644 --- a/ASFui/Client.cs +++ b/ASFui/Client.cs @@ -1,7 +1,9 @@ using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.ServiceModel; using System.ServiceModel.Channels; +using Newtonsoft.Json; namespace ASFui { diff --git a/ASFui/Properties/AssemblyInfo.cs b/ASFui/Properties/AssemblyInfo.cs index 77b7e73..11d9ca5 100644 --- a/ASFui/Properties/AssemblyInfo.cs +++ b/ASFui/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión // mediante el carácter '*', como se muestra a continuación: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.3.0")] -[assembly: AssemblyFileVersion("0.3.3.0")] +[assembly: AssemblyVersion("0.3.4.0")] +[assembly: AssemblyFileVersion("0.3.4.0")] diff --git a/ASFui/Properties/Resources.Designer.cs b/ASFui/Properties/Resources.Designer.cs index 2e69d3e..e85ed87 100644 --- a/ASFui/Properties/Resources.Designer.cs +++ b/ASFui/Properties/Resources.Designer.cs @@ -69,5 +69,35 @@ internal static System.Drawing.Icon ASFui { return ((System.Drawing.Icon)(obj)); } } + + /// + /// Busca un recurso adaptado de tipo System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap help { + get { + object obj = ResourceManager.GetObject("help", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Busca un recurso adaptado de tipo System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap refresh { + get { + object obj = ResourceManager.GetObject("refresh", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Busca un recurso adaptado de tipo System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap settings { + get { + object obj = ResourceManager.GetObject("settings", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/ASFui/Properties/Resources.resx b/ASFui/Properties/Resources.resx index 82a46b5..594f572 100644 --- a/ASFui/Properties/Resources.resx +++ b/ASFui/Properties/Resources.resx @@ -1784,4 +1784,14 @@ AAAAAAAAAAAAAAAAAAAAAAAA + + + ..\Resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ASFui/Resources/help.png b/ASFui/Resources/help.png new file mode 100644 index 0000000..a3238d4 Binary files /dev/null and b/ASFui/Resources/help.png differ diff --git a/ASFui/Resources/refresh.png b/ASFui/Resources/refresh.png new file mode 100644 index 0000000..fb1cb23 Binary files /dev/null and b/ASFui/Resources/refresh.png differ diff --git a/ASFui/Resources/settings.png b/ASFui/Resources/settings.png new file mode 100644 index 0000000..c3bba3a Binary files /dev/null and b/ASFui/Resources/settings.png differ diff --git a/version.txt b/version.txt index e9763c9..508d0fe 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.3.3.0 \ No newline at end of file +0.3.4.0 \ No newline at end of file