├── .gitignore ├── IdleMaster ├── IdleMaster.sln └── IdleMaster │ ├── AlwaysIdleList.Designer.cs │ ├── AlwaysIdleList.cs │ ├── AlwaysIdleList.resx │ ├── AvgValues.cs │ ├── Badge.cs │ ├── CookieClient.cs │ ├── IdleMaster.csproj │ ├── Logger.cs │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ ├── Settings.settings │ └── app.manifest │ ├── Resources │ ├── Changelog.rtf │ ├── JackMythSq_128x128.jpg │ ├── NoImage.png │ ├── Steamworks.NET.dll │ ├── ban-2x.png │ ├── bar-chart-2x.png │ ├── btnBack.png │ ├── btnImport.png │ ├── btnSave.png │ ├── check-2x.png │ ├── cog-2x.png │ ├── document-2x.png │ ├── eye-2x.png │ ├── globe-2x.png │ ├── info-2x.png │ ├── lock-locked-2x.png │ ├── media-pause-2x.png │ ├── media-pause.png │ ├── media-play-2x.png │ ├── media-play.png │ ├── media-step-forward-2x.png │ ├── media-step-forward.png │ ├── neko.ico │ ├── power-standby-2x.png │ ├── select2-spinner.gif │ ├── stcn.png │ ├── steam-idle.exe │ ├── steam_api.dll │ ├── trash-2x.png │ └── x-2x.png │ ├── Statistics.cs │ ├── SteamProfile.cs │ ├── app.config │ ├── frmAbout.Designer.cs │ ├── frmAbout.cs │ ├── frmAbout.resx │ ├── frmBlacklist.Designer.cs │ ├── frmBlacklist.cs │ ├── frmBlacklist.resx │ ├── frmBrowser.Designer.cs │ ├── frmBrowser.cs │ ├── frmBrowser.resx │ ├── frmChangelog.Designer.cs │ ├── frmChangelog.cs │ ├── frmChangelog.resx │ ├── frmMain.Designer.cs │ ├── frmMain.cs │ ├── frmMain.resx │ ├── frmSettings.Designer.cs │ ├── frmSettings.cs │ ├── frmSettings.resx │ ├── frmSettingsAdvanced.Designer.cs │ ├── frmSettingsAdvanced.cs │ ├── frmSettingsAdvanced.resx │ ├── frmStatistics.Designer.cs │ ├── frmStatistics.cs │ ├── frmStatistics.resx │ ├── frmWagaSettings.Designer.cs │ ├── frmWagaSettings.cs │ ├── frmWagaSettings.resx │ ├── localization │ ├── strings.Designer.cs │ ├── strings.cs.resx │ ├── strings.de.resx │ ├── strings.el.resx │ ├── strings.es.resx │ ├── strings.fi.resx │ ├── strings.fr.resx │ ├── strings.hu.resx │ ├── strings.it.resx │ ├── strings.ja.resx │ ├── strings.ko.resx │ ├── strings.nl.resx │ ├── strings.no.resx │ ├── strings.pl.resx │ ├── strings.pt-BR.resx │ ├── strings.pt.resx │ ├── strings.resx │ ├── strings.ro.resx │ ├── strings.ru.resx │ ├── strings.sv.resx │ ├── strings.th.resx │ ├── strings.tr.resx │ ├── strings.uk.resx │ ├── strings.zh-TW.resx │ └── strings.zh.resx │ ├── logo1.ico │ └── packages.config ├── LICENSE ├── Preview ├── FreeIdleMode.jpg └── Preview.jpg ├── README.md ├── Steamworks.NET.dll ├── setup.exe └── steam-idle Source ├── steam-idle.sln └── steam-idle ├── Fakes └── Steamworks.NET.fakes ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── frmMain.Designer.cs ├── frmMain.cs ├── frmMain.resx ├── icon.ico └── steam-idle.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdleMaster", "IdleMaster\IdleMaster.csproj", "{D26CAFBB-F684-4E53-BE38-60AAD2531893}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D26CAFBB-F684-4E53-BE38-60AAD2531893}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D26CAFBB-F684-4E53-BE38-60AAD2531893}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D26CAFBB-F684-4E53-BE38-60AAD2531893}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D26CAFBB-F684-4E53-BE38-60AAD2531893}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/AvgValues.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IdleMaster 4 | { 5 | public class EnhancedsteamHelper 6 | { 7 | // ReSharper disable once InconsistentNaming 8 | public List Avg_Values { get; set; } 9 | } 10 | 11 | public class Avg 12 | { 13 | public int AppId { get; set; } 14 | 15 | // ReSharper disable once InconsistentNaming 16 | public double Avg_Price { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Badge.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Globalization; 4 | using System.Text.RegularExpressions; 5 | using System.Threading.Tasks; 6 | using HtmlAgilityPack; 7 | using IdleMaster.Properties; 8 | 9 | namespace IdleMaster 10 | { 11 | public class Badge 12 | { 13 | public double AveragePrice { get; set; } 14 | 15 | public int AppId { get; set; } 16 | 17 | public string Name { get; set; } 18 | 19 | public string StringId 20 | { 21 | get { return AppId.ToString(); } 22 | set { AppId = string.IsNullOrWhiteSpace(value) ? 0 : int.Parse(value); } 23 | } 24 | 25 | public int RemainingCard { get; set; } 26 | 27 | public double HoursPlayed { get; set; } 28 | 29 | 30 | private Process idleProcess; 31 | 32 | public bool InIdle { get { return idleProcess != null && !idleProcess.HasExited; } } 33 | 34 | public Process Idle() 35 | { 36 | if (InIdle) 37 | return idleProcess; 38 | 39 | idleProcess = Process.Start(new ProcessStartInfo("steam-idle.exe", AppId.ToString()) { WindowStyle = ProcessWindowStyle.Hidden }); 40 | return idleProcess; 41 | } 42 | 43 | public void StopIdle() 44 | { 45 | if (InIdle) 46 | idleProcess.Kill(); 47 | } 48 | 49 | public async Task CanCardDrops() 50 | { 51 | try 52 | { 53 | var document = new HtmlDocument(); 54 | var response = await CookieClient.GetHttpAsync(Settings.Default.myProfileURL + "/gamecards/" + StringId); 55 | // Response should be empty. User should be unauthorised. 56 | if (string.IsNullOrEmpty(response)) 57 | { 58 | return false; 59 | } 60 | document.LoadHtml(response); 61 | 62 | var hoursNode = document.DocumentNode.SelectSingleNode("//div[@class=\"badge_title_stats_playtime\"]"); 63 | var hours = Regex.Match(hoursNode.InnerText, @"[0-9\.,]+").Value; 64 | 65 | var cardNode = hoursNode.ParentNode.SelectSingleNode(".//span[@class=\"progress_info_bold\"]"); 66 | var cards = cardNode == null ? string.Empty : Regex.Match(cardNode.InnerText, @"[0-9]+").Value; 67 | 68 | UpdateStats(cards, hours); 69 | return RemainingCard != 0; 70 | } 71 | catch (Exception ex) 72 | { 73 | Logger.Exception(ex, "Badge -> CanCardDrops, for id = " + AppId); 74 | } 75 | return false; 76 | } 77 | 78 | public void UpdateStats(string remaining, string hours) 79 | { 80 | //RemainingCard = 1; 81 | //HoursPlayed = 5; 82 | RemainingCard = string.IsNullOrWhiteSpace(remaining) ? 0 : int.Parse(remaining); 83 | HoursPlayed = string.IsNullOrWhiteSpace(hours) ? 0 : double.Parse(hours, new NumberFormatInfo()); 84 | 85 | } 86 | 87 | public override bool Equals(object obj) 88 | { 89 | var badge = obj as Badge; 90 | return badge != null && Equals(AppId, badge.AppId); 91 | } 92 | 93 | public override int GetHashCode() 94 | { 95 | return AppId.GetHashCode(); 96 | } 97 | 98 | public override string ToString() 99 | { 100 | return string.IsNullOrWhiteSpace(Name) ? StringId : Name; 101 | } 102 | 103 | public Badge(string id, string name, string remaining, string hours) 104 | : this() 105 | { 106 | StringId = id; 107 | Name = name; 108 | UpdateStats(remaining, hours); 109 | } 110 | 111 | public Badge() 112 | { } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/CookieClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Sockets; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using HtmlAgilityPack; 7 | using IdleMaster.Properties; 8 | 9 | namespace IdleMaster 10 | { 11 | public class CookieClient : WebClient 12 | { 13 | internal CookieContainer Cookie = new CookieContainer(); 14 | 15 | internal Uri ResponseUri; 16 | 17 | protected override WebRequest GetWebRequest(Uri address) 18 | { 19 | var request = base.GetWebRequest(address); 20 | if (request is HttpWebRequest) 21 | (request as HttpWebRequest).CookieContainer = Cookie; 22 | return request; 23 | } 24 | 25 | protected override WebResponse GetWebResponse(WebRequest request, System.IAsyncResult result) 26 | { 27 | try 28 | { 29 | var baseResponse = base.GetWebResponse(request); 30 | 31 | var cookies = (baseResponse as HttpWebResponse).Cookies; 32 | 33 | // Check, if cookie should be deleted. This means that sessionID is now invalid and user has to log in again. 34 | // Maybe this shoud be done other way (authenticate exception), but because of shared settings and timers in frmMain... 35 | if (cookies.Count > 0) 36 | { 37 | if (cookies["steamLoginSecure"] != null && cookies["steamLoginSecure"].Value == "deleted") 38 | { 39 | Settings.Default.sessionid = string.Empty; 40 | Settings.Default.steamLogin = string.Empty; 41 | Settings.Default.steamLoginSecure = string.Empty; 42 | Settings.Default.steamMachineAuth = string.Empty; 43 | Settings.Default.steamRememberLogin = string.Empty; 44 | Settings.Default.steamparental = string.Empty; 45 | Settings.Default.Save(); 46 | } 47 | } 48 | 49 | this.ResponseUri = baseResponse.ResponseUri; 50 | return baseResponse; 51 | } 52 | catch (Exception) 53 | { 54 | 55 | } 56 | return null; 57 | } 58 | 59 | public static CookieContainer GenerateCookies() 60 | { 61 | var cookies = new CookieContainer(); 62 | var target = new Uri("https://steamcommunity.com"); 63 | cookies.Add(new Cookie("sessionid", Settings.Default.sessionid) { Domain = target.Host }); 64 | //cookies.Add(new Cookie("steamLogin", Settings.Default.steamLogin) { Domain = target.Host }); 65 | cookies.Add(new Cookie("steamLoginSecure", Settings.Default.steamLoginSecure) { Domain = target.Host }); 66 | cookies.Add(new Cookie("steamRememberLogin", Settings.Default.steamRememberLogin) { Domain = target.Host }); 67 | cookies.Add(new Cookie(GetSteamMachineAuthCookieName(), Settings.Default.steamMachineAuth) { Domain = target.Host }); 68 | //Check Steam parental 69 | if (Settings.Default.steamparental != "") 70 | cookies.Add(new Cookie("steamparental", Settings.Default.steamparental) { Domain = target.Host }); 71 | return cookies; 72 | } 73 | 74 | public static string GetSteamMachineAuthCookieName() 75 | { 76 | if (Settings.Default.steamLoginSecure != null && Settings.Default.steamLoginSecure.Length > 17) 77 | return string.Format("steamMachineAuth{0}", Settings.Default.steamLoginSecure.Substring(0, 17)); 78 | return "steamMachineAuth"; 79 | } 80 | 81 | public static async Task GetHttpAsync(string url, int count = 3,bool IgnoreCookieState=false) 82 | { 83 | System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; 84 | while (true) 85 | { 86 | var client = new CookieClient(); 87 | var content = string.Empty; 88 | try 89 | { 90 | // If user is NOT authenticated (cookie got deleted in GetWebResponse()), return empty result 91 | if (IgnoreCookieState==false&&String.IsNullOrEmpty(Settings.Default.sessionid)) 92 | { 93 | return string.Empty; 94 | } 95 | System.Net.ServicePointManager.ServerCertificateValidationCallback += 96 | delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, 97 | System.Security.Cryptography.X509Certificates.X509Chain chain, 98 | System.Net.Security.SslPolicyErrors sslPolicyErrors) 99 | { 100 | return true; // **** Always accept 101 | }; 102 | System.Net.ServicePointManager.Expect100Continue = false; 103 | url=url.Replace("http://", "https://"); 104 | content = await client.DownloadStringTaskAsync(url); 105 | 106 | } 107 | catch (Exception ex) 108 | { 109 | Logger.Exception(ex, "CookieClient -> GetHttpAsync, for url = " + url); 110 | } 111 | 112 | if (!string.IsNullOrWhiteSpace(content) || count == 0) 113 | return content; 114 | 115 | count = count - 1; 116 | } 117 | } 118 | 119 | public static async Task IsLogined() 120 | { 121 | var response = await GetHttpAsync(Settings.Default.myProfileURL); 122 | var document = new HtmlDocument(); 123 | document.LoadHtml(response); 124 | return document.DocumentNode.SelectSingleNode("//a[(@class=\"global_action_link\") and not(@id)]") == null; 125 | } 126 | 127 | public CookieClient() 128 | { 129 | Cookie = GenerateCookies(); 130 | Encoding = Encoding.UTF8; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | namespace IdleMaster 9 | { 10 | public static class Logger 11 | { 12 | private static readonly object LogLock = new object(); 13 | 14 | private static readonly string ExceptionPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @".\error.log"; 15 | 16 | public static void Exception(Exception ex, params string[] messages) 17 | { 18 | var contents = string.Concat(DateTime.Now, " ", string.Join(Environment.NewLine, messages), 19 | Environment.NewLine, ex.ToString(), Environment.NewLine); 20 | Write(contents, ExceptionPath); 21 | } 22 | 23 | private static void Write(string contents, string path) 24 | { 25 | Console.WriteLine(contents); 26 | using (TimedLock.Lock(LogLock)) 27 | { 28 | File.AppendAllText(path, contents, Encoding.UTF8); 29 | } 30 | } 31 | } 32 | 33 | 34 | // Thanks to Eric Gunnerson for recommending this be a struct rather 35 | // than a class - avoids a heap allocation. 36 | // Thanks to Change Gillespie and Jocelyn Coulmance for pointing out 37 | // the bugs that then crept in when I changed it to use struct... 38 | // Thanks to John Sands for providing the necessary incentive to make 39 | // me invent a way of using a struct in both release and debug builds 40 | // without losing the debug leak tracking. 41 | 42 | public struct TimedLock : IDisposable 43 | { 44 | public static TimedLock Lock(object o) 45 | { 46 | return Lock(o, TimeSpan.FromSeconds(10)); 47 | } 48 | 49 | public static TimedLock Lock(object o, TimeSpan timeout) 50 | { 51 | var tl = new TimedLock(o); 52 | if (!Monitor.TryEnter(o, timeout)) 53 | { 54 | #if DEBUG 55 | GC.SuppressFinalize(tl.leakDetector); 56 | #endif 57 | throw new LockTimeoutException(); 58 | } 59 | 60 | return tl; 61 | } 62 | 63 | private TimedLock(object o) 64 | { 65 | target = o; 66 | #if DEBUG 67 | leakDetector = new Sentinel(); 68 | #endif 69 | } 70 | private object target; 71 | 72 | public void Dispose() 73 | { 74 | Monitor.Exit(target); 75 | 76 | // It's a bad error if someone forgets to call Dispose, 77 | // so in Debug builds, we put a finalizer in to detect 78 | // the error. If Dispose is called, we suppress the 79 | // finalizer. 80 | #if DEBUG 81 | GC.SuppressFinalize(leakDetector); 82 | #endif 83 | } 84 | 85 | #if DEBUG 86 | // (In Debug mode, we make it a class so that we can add a finalizer 87 | // in order to detect when the object is not freed.) 88 | private class Sentinel 89 | { 90 | ~Sentinel() 91 | { 92 | // If this finalizer runs, someone somewhere failed to 93 | // call Dispose, which means we've failed to leave 94 | // a monitor! 95 | Debug.Fail("Undisposed lock"); 96 | } 97 | } 98 | private Sentinel leakDetector; 99 | #endif 100 | 101 | } 102 | public class LockTimeoutException : ApplicationException 103 | { 104 | public LockTimeoutException() 105 | : base("Timeout waiting for lock") 106 | { 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.IO; 4 | using System.Windows.Forms; 5 | 6 | namespace IdleMaster 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | /// 14 | static public int Mode = 0; 15 | [STAThread] 16 | static void Main() 17 | { 18 | // Set the Browser emulation version for embedded browser control 19 | try 20 | { 21 | RegistryKey ie_root = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION"); 22 | RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true); 23 | String programName = Path.GetFileName(Environment.GetCommandLineArgs()[0]); 24 | key.SetValue(programName, (int)10001, RegistryValueKind.DWord); 25 | } 26 | catch (Exception) 27 | { 28 | 29 | } 30 | 31 | Application.ThreadException += (o, a) => Logger.Exception(a.Exception); 32 | Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); 33 | Application.EnableVisualStyles(); 34 | Application.SetCompatibleTextRenderingDefault(false); 35 | while (true) 36 | { 37 | int LastMode = Mode; 38 | switch (Mode) 39 | { 40 | case 0: 41 | Application.Run(new frmMain()); 42 | break; 43 | case 1: 44 | Application.Run(new AlwaysIdleList()); 45 | break; 46 | } 47 | if (LastMode == Mode) 48 | break; 49 | } 50 | 51 | } 52 | 53 | public static DialogResult ShowInputDialog(ref string input,string Title="Input",IWin32Window owner=null) 54 | { 55 | System.Drawing.Size size = new System.Drawing.Size(300, 70); 56 | Form inputBox = new Form(); 57 | 58 | inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 59 | inputBox.StartPosition = FormStartPosition.CenterParent; 60 | inputBox.ClientSize = size; 61 | inputBox.Text = Title; 62 | inputBox.MinimizeBox = false; 63 | inputBox.MaximizeBox = false; 64 | 65 | System.Windows.Forms.TextBox textBox = new TextBox(); 66 | textBox.Size = new System.Drawing.Size(size.Width - 10, 23); 67 | textBox.Location = new System.Drawing.Point(5, 5); 68 | textBox.Text = input; 69 | inputBox.Controls.Add(textBox); 70 | 71 | Button okButton = new Button(); 72 | okButton.DialogResult = System.Windows.Forms.DialogResult.OK; 73 | okButton.Name = "okButton"; 74 | okButton.Size = new System.Drawing.Size(75, 23); 75 | okButton.Text = "&OK"; 76 | okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39); 77 | inputBox.Controls.Add(okButton); 78 | 79 | Button cancelButton = new Button(); 80 | cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 81 | cancelButton.Name = "cancelButton"; 82 | cancelButton.Size = new System.Drawing.Size(75, 23); 83 | cancelButton.Text = "&Cancel"; 84 | cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39); 85 | inputBox.Controls.Add(cancelButton); 86 | 87 | inputBox.AcceptButton = okButton; 88 | inputBox.CancelButton = cancelButton; 89 | DialogResult result = inputBox.ShowDialog(owner); 90 | input = textBox.Text; 91 | return result; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("IdleMaster")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("IdleMaster")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("351d8228-4284-4c00-9526-7039b81b771b")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.4.1.0")] 35 | [assembly: AssemblyFileVersion("1.4.1.0")] 36 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\media-play-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\check-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\globe-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\document-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\trash-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\bar-chart-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\cog-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\media-play.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\Resources\ban-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | 149 | ..\Resources\media-pause.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\Resources\info-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | 155 | ..\Resources\Changelog.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 156 | 157 | 158 | ..\Resources\power-standby-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 159 | 160 | 161 | ..\Resources\select2-spinner.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 162 | 163 | 164 | ..\Resources\x-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 165 | 166 | 167 | ..\Resources\eye-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 168 | 169 | 170 | ..\Resources\media-pause-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 171 | 172 | 173 | ..\Resources\media-step-forward-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 174 | 175 | 176 | ..\Resources\media-step-forward.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 177 | 178 | 179 | ..\Resources\lock-locked-2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 180 | 181 | 182 | ..\Resources\neko.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 183 | 184 | 185 | ..\Resources\NoImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 186 | 187 | 188 | ..\Resources\stcn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 189 | 190 | 191 | ..\Resources\JackMythSq_128x128.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 192 | 193 | 194 | ..\Resources\btnBack.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 195 | 196 | 197 | ..\Resources\btnImport.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 198 | 199 | 200 | ..\Resources\btnSave.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 201 | 202 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IdleMaster.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string sessionid { 30 | get { 31 | return ((string)(this["sessionid"])); 32 | } 33 | set { 34 | this["sessionid"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("")] 41 | public string steamLogin { 42 | get { 43 | return ((string)(this["steamLogin"])); 44 | } 45 | set { 46 | this["steamLogin"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("")] 53 | public string myProfileURL { 54 | get { 55 | return ((string)(this["myProfileURL"])); 56 | } 57 | set { 58 | this["myProfileURL"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("")] 65 | public string steamLoginSecure { 66 | get { 67 | return ((string)(this["steamLoginSecure"])); 68 | } 69 | set { 70 | this["steamLoginSecure"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("")] 77 | public string sort { 78 | get { 79 | return ((string)(this["sort"])); 80 | } 81 | set { 82 | this["sort"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 89 | public bool minToTray { 90 | get { 91 | return ((bool)(this["minToTray"])); 92 | } 93 | set { 94 | this["minToTray"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 101 | public bool updateNeeded { 102 | get { 103 | return ((bool)(this["updateNeeded"])); 104 | } 105 | set { 106 | this["updateNeeded"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 113 | public bool ignoreclient { 114 | get { 115 | return ((bool)(this["ignoreclient"])); 116 | } 117 | set { 118 | this["ignoreclient"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 125 | public bool showUsername { 126 | get { 127 | return ((bool)(this["showUsername"])); 128 | } 129 | set { 130 | this["showUsername"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n \r\n")] 139 | public global::System.Collections.Specialized.StringCollection blacklist { 140 | get { 141 | return ((global::System.Collections.Specialized.StringCollection)(this["blacklist"])); 142 | } 143 | set { 144 | this["blacklist"] = value; 145 | } 146 | } 147 | 148 | [global::System.Configuration.UserScopedSettingAttribute()] 149 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 150 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 151 | public bool OnlyOneGameIdle { 152 | get { 153 | return ((bool)(this["OnlyOneGameIdle"])); 154 | } 155 | set { 156 | this["OnlyOneGameIdle"] = value; 157 | } 158 | } 159 | 160 | [global::System.Configuration.UserScopedSettingAttribute()] 161 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 162 | [global::System.Configuration.DefaultSettingValueAttribute("")] 163 | public string steamRememberLogin { 164 | get { 165 | return ((string)(this["steamRememberLogin"])); 166 | } 167 | set { 168 | this["steamRememberLogin"] = value; 169 | } 170 | } 171 | 172 | [global::System.Configuration.UserScopedSettingAttribute()] 173 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 174 | [global::System.Configuration.DefaultSettingValueAttribute("")] 175 | public string steamMachineAuth { 176 | get { 177 | return ((string)(this["steamMachineAuth"])); 178 | } 179 | set { 180 | this["steamMachineAuth"] = value; 181 | } 182 | } 183 | 184 | [global::System.Configuration.UserScopedSettingAttribute()] 185 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 186 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 187 | public uint totalCardIdled { 188 | get { 189 | return ((uint)(this["totalCardIdled"])); 190 | } 191 | set { 192 | this["totalCardIdled"] = value; 193 | } 194 | } 195 | 196 | [global::System.Configuration.UserScopedSettingAttribute()] 197 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 198 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 199 | public uint totalMinutesIdled { 200 | get { 201 | return ((uint)(this["totalMinutesIdled"])); 202 | } 203 | set { 204 | this["totalMinutesIdled"] = value; 205 | } 206 | } 207 | 208 | [global::System.Configuration.UserScopedSettingAttribute()] 209 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 210 | [global::System.Configuration.DefaultSettingValueAttribute("")] 211 | public string language { 212 | get { 213 | return ((string)(this["language"])); 214 | } 215 | set { 216 | this["language"] = value; 217 | } 218 | } 219 | 220 | [global::System.Configuration.UserScopedSettingAttribute()] 221 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 222 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 223 | public bool OneThenMany { 224 | get { 225 | return ((bool)(this["OneThenMany"])); 226 | } 227 | set { 228 | this["OneThenMany"] = value; 229 | } 230 | } 231 | 232 | [global::System.Configuration.UserScopedSettingAttribute()] 233 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 234 | [global::System.Configuration.DefaultSettingValueAttribute("1")] 235 | public int LoginTimeout { 236 | get { 237 | return ((int)(this["LoginTimeout"])); 238 | } 239 | set { 240 | this["LoginTimeout"] = value; 241 | } 242 | } 243 | 244 | [global::System.Configuration.UserScopedSettingAttribute()] 245 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 246 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 247 | public int LoginPageRedirect { 248 | get { 249 | return ((int)(this["LoginPageRedirect"])); 250 | } 251 | set { 252 | this["LoginPageRedirect"] = value; 253 | } 254 | } 255 | 256 | [global::System.Configuration.UserScopedSettingAttribute()] 257 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 258 | [global::System.Configuration.DefaultSettingValueAttribute("30")] 259 | public int MaxIdleCount { 260 | get { 261 | return ((int)(this["MaxIdleCount"])); 262 | } 263 | set { 264 | this["MaxIdleCount"] = value; 265 | } 266 | } 267 | 268 | [global::System.Configuration.UserScopedSettingAttribute()] 269 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 270 | [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] 272 | public global::System.Collections.Specialized.StringCollection AlwaysIdleList { 273 | get { 274 | return ((global::System.Collections.Specialized.StringCollection)(this["AlwaysIdleList"])); 275 | } 276 | set { 277 | this["AlwaysIdleList"] = value; 278 | } 279 | } 280 | 281 | [global::System.Configuration.UserScopedSettingAttribute()] 282 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 283 | [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] 285 | public global::System.Collections.Specialized.StringCollection EnabledAlwaysIdleList { 286 | get { 287 | return ((global::System.Collections.Specialized.StringCollection)(this["EnabledAlwaysIdleList"])); 288 | } 289 | set { 290 | this["EnabledAlwaysIdleList"] = value; 291 | } 292 | } 293 | 294 | [global::System.Configuration.UserScopedSettingAttribute()] 295 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 296 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 297 | public bool IdleSpecified { 298 | get { 299 | return ((bool)(this["IdleSpecified"])); 300 | } 301 | set { 302 | this["IdleSpecified"] = value; 303 | } 304 | } 305 | 306 | [global::System.Configuration.UserScopedSettingAttribute()] 307 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 308 | [global::System.Configuration.DefaultSettingValueAttribute("")] 309 | public string steamparental { 310 | get { 311 | return ((string)(this["steamparental"])); 312 | } 313 | set { 314 | this["steamparental"] = value; 315 | } 316 | } 317 | } 318 | } 319 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | False 22 | 23 | 24 | True 25 | 26 | 27 | False 28 | 29 | 30 | False 31 | 32 | 33 | <?xml version="1.0" encoding="utf-16"?> 34 | <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 35 | <string /> 36 | </ArrayOfString> 37 | 38 | 39 | False 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 0 49 | 50 | 51 | 0 52 | 53 | 54 | 55 | 56 | 57 | True 58 | 59 | 60 | 1 61 | 62 | 63 | 0 64 | 65 | 66 | 30 67 | 68 | 69 | <?xml version="1.0" encoding="utf-16"?> 70 | <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> 71 | 72 | 73 | <?xml version="1.0" encoding="utf-16"?> 74 | <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> 75 | 76 | 77 | False 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Properties/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 54 | 55 | 69 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/JackMythSq_128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/JackMythSq_128x128.jpg -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/NoImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/NoImage.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/Steamworks.NET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/Steamworks.NET.dll -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/ban-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/ban-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/bar-chart-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/bar-chart-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/btnBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/btnBack.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/btnImport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/btnImport.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/btnSave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/btnSave.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/check-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/check-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/cog-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/cog-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/document-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/document-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/eye-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/eye-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/globe-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/globe-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/info-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/info-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/lock-locked-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/lock-locked-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-pause-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-pause-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-pause.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-play-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-play-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-play.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-step-forward-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-step-forward-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/media-step-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/media-step-forward.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/neko.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/neko.ico -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/power-standby-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/power-standby-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/select2-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/select2-spinner.gif -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/stcn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/stcn.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/steam-idle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/steam-idle.exe -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/steam_api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/steam_api.dll -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/trash-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/trash-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Resources/x-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/Resources/x-2x.png -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/Statistics.cs: -------------------------------------------------------------------------------- 1 | namespace IdleMaster 2 | { 3 | public class Statistics 4 | { 5 | private uint sessionMinutesIdled = 0; 6 | private uint sessionCardIdled = 0; 7 | private uint remainingCards = 0; 8 | 9 | public uint getSessionMinutesIdled() 10 | { 11 | return sessionMinutesIdled; 12 | } 13 | 14 | public uint getSessionCardIdled() 15 | { 16 | return sessionCardIdled; 17 | } 18 | 19 | public uint getRemainingCards() 20 | { 21 | return remainingCards; 22 | } 23 | 24 | public void setRemainingCards(uint remainingCards) 25 | { 26 | this.remainingCards = remainingCards; 27 | } 28 | 29 | public void checkCardRemaining(uint actualCardRemaining) 30 | { 31 | if (actualCardRemaining < remainingCards) 32 | { 33 | increaseCardIdled(remainingCards - actualCardRemaining); 34 | remainingCards = actualCardRemaining; 35 | } 36 | else if (actualCardRemaining > remainingCards) 37 | { 38 | remainingCards = actualCardRemaining; 39 | } 40 | 41 | } 42 | 43 | public void increaseCardIdled(uint number) 44 | { 45 | Properties.Settings.Default.totalCardIdled+=number; 46 | Properties.Settings.Default.Save(); 47 | sessionCardIdled+=number; 48 | } 49 | 50 | public void increaseMinutesIdled() 51 | { 52 | Properties.Settings.Default.totalMinutesIdled++; 53 | Properties.Settings.Default.Save(); 54 | sessionMinutesIdled++; 55 | } 56 | 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/SteamProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Text; 4 | using System.Xml; 5 | using IdleMaster.Properties; 6 | 7 | namespace IdleMaster 8 | { 9 | internal class SteamProfile 10 | { 11 | internal static string GetSteamId() 12 | { 13 | var steamid = WebUtility.UrlDecode(Settings.Default.steamLoginSecure); 14 | var index = steamid.IndexOfAny(new[] { '|' }, 0); 15 | return index != -1 ? steamid.Remove(index) : steamid; 16 | } 17 | 18 | internal static string GetSteamUrl() 19 | { 20 | return "https://steamcommunity.com/profiles/" + GetSteamId(); 21 | } 22 | 23 | internal static string GetSignedAs() 24 | { 25 | var steamUrl = GetSteamUrl(); 26 | var userName = "User " + GetSteamId(); 27 | try 28 | { 29 | var xmlRaw = new WebClient() { Encoding = Encoding.UTF8 }.DownloadString(string.Format("{0}/?xml=1", steamUrl)); 30 | var xml = new XmlDocument(); 31 | xml.LoadXml(xmlRaw); 32 | var nameNode = xml.SelectSingleNode("//steamID"); 33 | if (nameNode != null) 34 | userName = WebUtility.HtmlDecode(nameNode.InnerText); 35 | } 36 | catch (Exception ex) 37 | { 38 | Console.WriteLine(ex.Message); 39 | Logger.Exception(ex, "frmMain -> GetSignedAs, for steamUrl = " + steamUrl); 40 | } 41 | return localization.strings.signed_in_as + " " + userName; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | False 27 | 28 | 29 | True 30 | 31 | 32 | False 33 | 34 | 35 | False 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | False 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 0 56 | 57 | 58 | 0 59 | 60 | 61 | 62 | 63 | 64 | True 65 | 66 | 67 | 1 68 | 69 | 70 | 0 71 | 72 | 73 | 30 74 | 75 | 76 | 77 | 79 | 80 | 81 | 82 | 83 | 85 | 86 | 87 | 88 | False 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmAbout.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | partial class frmAbout 7 | { 8 | /// 9 | /// Required designer variable. 10 | /// 11 | private IContainer components = null; 12 | 13 | /// 14 | /// Clean up any resources being used. 15 | /// 16 | /// true if managed resources should be disposed; otherwise, false. 17 | protected override void Dispose(bool disposing) 18 | { 19 | if (disposing && (components != null)) 20 | { 21 | components.Dispose(); 22 | } 23 | base.Dispose(disposing); 24 | } 25 | 26 | #region Windows Form Designer generated code 27 | 28 | /// 29 | /// Required method for Designer support - do not modify 30 | /// the contents of this method with the code editor. 31 | /// 32 | private void InitializeComponent() 33 | { 34 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAbout)); 35 | this.btnOK = new System.Windows.Forms.Button(); 36 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 37 | this.lblVersion = new System.Windows.Forms.Label(); 38 | this.label2 = new System.Windows.Forms.Label(); 39 | this.label1 = new System.Windows.Forms.Label(); 40 | this.label3 = new System.Windows.Forms.Label(); 41 | this.pictureBox2 = new System.Windows.Forms.PictureBox(); 42 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 43 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); 44 | this.SuspendLayout(); 45 | // 46 | // btnOK 47 | // 48 | this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 49 | this.btnOK.Location = new System.Drawing.Point(302, 147); 50 | this.btnOK.Name = "btnOK"; 51 | this.btnOK.Size = new System.Drawing.Size(75, 21); 52 | this.btnOK.TabIndex = 0; 53 | this.btnOK.Text = "&OK"; 54 | this.btnOK.UseVisualStyleBackColor = true; 55 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 56 | // 57 | // pictureBox1 58 | // 59 | this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 60 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 61 | this.pictureBox1.Location = new System.Drawing.Point(12, 11); 62 | this.pictureBox1.Name = "pictureBox1"; 63 | this.pictureBox1.Size = new System.Drawing.Size(255, 103); 64 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 65 | this.pictureBox1.TabIndex = 1; 66 | this.pictureBox1.TabStop = false; 67 | // 68 | // lblVersion 69 | // 70 | this.lblVersion.AutoSize = true; 71 | this.lblVersion.Location = new System.Drawing.Point(13, 120); 72 | this.lblVersion.Name = "lblVersion"; 73 | this.lblVersion.Size = new System.Drawing.Size(71, 12); 74 | this.lblVersion.TabIndex = 2; 75 | this.lblVersion.Text = "Idle Master"; 76 | // 77 | // label2 78 | // 79 | this.label2.AutoSize = true; 80 | this.label2.Location = new System.Drawing.Point(13, 132); 81 | this.label2.Name = "label2"; 82 | this.label2.Size = new System.Drawing.Size(77, 12); 83 | this.label2.TabIndex = 3; 84 | this.label2.Text = "by jshackles"; 85 | // 86 | // label1 87 | // 88 | this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 89 | this.label1.AutoSize = true; 90 | this.label1.Location = new System.Drawing.Point(246, 121); 91 | this.label1.Name = "label1"; 92 | this.label1.Size = new System.Drawing.Size(131, 12); 93 | this.label1.TabIndex = 4; 94 | this.label1.Text = "Idle Master HTTPS Fix"; 95 | // 96 | // label3 97 | // 98 | this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 99 | this.label3.AutoSize = true; 100 | this.label3.Location = new System.Drawing.Point(306, 132); 101 | this.label3.Name = "label3"; 102 | this.label3.Size = new System.Drawing.Size(71, 12); 103 | this.label3.TabIndex = 4; 104 | this.label3.Text = "By JackMyth"; 105 | // 106 | // pictureBox2 107 | // 108 | this.pictureBox2.BackgroundImage = global::IdleMaster.Properties.Resources.JackMythSq; 109 | this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 110 | this.pictureBox2.Location = new System.Drawing.Point(274, 11); 111 | this.pictureBox2.Name = "pictureBox2"; 112 | this.pictureBox2.Size = new System.Drawing.Size(103, 103); 113 | this.pictureBox2.TabIndex = 5; 114 | this.pictureBox2.TabStop = false; 115 | // 116 | // frmAbout 117 | // 118 | this.AcceptButton = this.btnOK; 119 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 120 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 121 | this.ClientSize = new System.Drawing.Size(385, 180); 122 | this.Controls.Add(this.pictureBox2); 123 | this.Controls.Add(this.label3); 124 | this.Controls.Add(this.label1); 125 | this.Controls.Add(this.label2); 126 | this.Controls.Add(this.lblVersion); 127 | this.Controls.Add(this.pictureBox1); 128 | this.Controls.Add(this.btnOK); 129 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 130 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 131 | this.MaximizeBox = false; 132 | this.Name = "frmAbout"; 133 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 134 | this.Text = "About Idle Master"; 135 | this.Load += new System.EventHandler(this.frmAbout_Load); 136 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 137 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); 138 | this.ResumeLayout(false); 139 | this.PerformLayout(); 140 | 141 | } 142 | 143 | #endregion 144 | 145 | private Button btnOK; 146 | private PictureBox pictureBox1; 147 | private Label lblVersion; 148 | private Label label2; 149 | private Label label1; 150 | private Label label3; 151 | private PictureBox pictureBox2; 152 | } 153 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Deployment.Application; 3 | using System.Reflection; 4 | using System.Windows.Forms; 5 | 6 | namespace IdleMaster 7 | { 8 | public partial class frmAbout : Form 9 | { 10 | public frmAbout() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void btnOK_Click(object sender, EventArgs e) 16 | { 17 | Close(); 18 | } 19 | 20 | private void frmAbout_Load(object sender, EventArgs e) 21 | { 22 | // Localize the form 23 | btnOK.Text = localization.strings.ok; 24 | 25 | if (ApplicationDeployment.IsNetworkDeployed) 26 | { 27 | var version = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); 28 | lblVersion.Text = "Idle Master v" + version; 29 | } 30 | else 31 | { 32 | var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); 33 | lblVersion.Text = "Idle Master v" + version; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmBlacklist.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | partial class frmBlacklist 7 | { 8 | /// 9 | /// Required designer variable. 10 | /// 11 | private IContainer components = null; 12 | 13 | /// 14 | /// Clean up any resources being used. 15 | /// 16 | /// true if managed resources should be disposed; otherwise, false. 17 | protected override void Dispose(bool disposing) 18 | { 19 | if (disposing && (components != null)) 20 | { 21 | components.Dispose(); 22 | } 23 | base.Dispose(disposing); 24 | } 25 | 26 | #region Windows Form Designer generated code 27 | 28 | /// 29 | /// Required method for Designer support - do not modify 30 | /// the contents of this method with the code editor. 31 | /// 32 | private void InitializeComponent() 33 | { 34 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmBlacklist)); 35 | this.lstBlacklist = new System.Windows.Forms.ListBox(); 36 | this.grpAdd = new System.Windows.Forms.GroupBox(); 37 | this.btnAdd = new System.Windows.Forms.Button(); 38 | this.txtAppid = new System.Windows.Forms.TextBox(); 39 | this.label1 = new System.Windows.Forms.Label(); 40 | this.btnSave = new System.Windows.Forms.Button(); 41 | this.btnRemove = new System.Windows.Forms.Button(); 42 | this.grpAdd.SuspendLayout(); 43 | this.SuspendLayout(); 44 | // 45 | // lstBlacklist 46 | // 47 | this.lstBlacklist.FormattingEnabled = true; 48 | this.lstBlacklist.Location = new System.Drawing.Point(13, 13); 49 | this.lstBlacklist.Name = "lstBlacklist"; 50 | this.lstBlacklist.Size = new System.Drawing.Size(270, 316); 51 | this.lstBlacklist.Sorted = true; 52 | this.lstBlacklist.TabIndex = 0; 53 | // 54 | // grpAdd 55 | // 56 | this.grpAdd.Controls.Add(this.btnAdd); 57 | this.grpAdd.Controls.Add(this.txtAppid); 58 | this.grpAdd.Controls.Add(this.label1); 59 | this.grpAdd.Location = new System.Drawing.Point(13, 336); 60 | this.grpAdd.Name = "grpAdd"; 61 | this.grpAdd.Size = new System.Drawing.Size(181, 76); 62 | this.grpAdd.TabIndex = 1; 63 | this.grpAdd.TabStop = false; 64 | this.grpAdd.Text = "Add Game to Blacklist"; 65 | // 66 | // btnAdd 67 | // 68 | this.btnAdd.Location = new System.Drawing.Point(100, 43); 69 | this.btnAdd.Name = "btnAdd"; 70 | this.btnAdd.Size = new System.Drawing.Size(75, 23); 71 | this.btnAdd.TabIndex = 3; 72 | this.btnAdd.Text = "&Add"; 73 | this.btnAdd.UseVisualStyleBackColor = true; 74 | this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); 75 | // 76 | // txtAppid 77 | // 78 | this.txtAppid.Location = new System.Drawing.Point(56, 17); 79 | this.txtAppid.Name = "txtAppid"; 80 | this.txtAppid.Size = new System.Drawing.Size(119, 20); 81 | this.txtAppid.TabIndex = 0; 82 | // 83 | // label1 84 | // 85 | this.label1.AutoSize = true; 86 | this.label1.Location = new System.Drawing.Point(7, 20); 87 | this.label1.Name = "label1"; 88 | this.label1.Size = new System.Drawing.Size(43, 13); 89 | this.label1.TabIndex = 0; 90 | this.label1.Text = "App ID:"; 91 | // 92 | // btnSave 93 | // 94 | this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 95 | this.btnSave.Location = new System.Drawing.Point(237, 383); 96 | this.btnSave.Name = "btnSave"; 97 | this.btnSave.Size = new System.Drawing.Size(75, 23); 98 | this.btnSave.TabIndex = 3; 99 | this.btnSave.Text = "&Save"; 100 | this.btnSave.UseVisualStyleBackColor = true; 101 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click); 102 | // 103 | // btnRemove 104 | // 105 | this.btnRemove.Image = global::IdleMaster.Properties.Resources.imgTrash; 106 | this.btnRemove.Location = new System.Drawing.Point(289, 13); 107 | this.btnRemove.Name = "btnRemove"; 108 | this.btnRemove.Size = new System.Drawing.Size(28, 28); 109 | this.btnRemove.TabIndex = 2; 110 | this.btnRemove.UseVisualStyleBackColor = true; 111 | this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); 112 | // 113 | // frmBlacklist 114 | // 115 | this.AcceptButton = this.btnAdd; 116 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 117 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 118 | this.ClientSize = new System.Drawing.Size(324, 418); 119 | this.Controls.Add(this.btnSave); 120 | this.Controls.Add(this.btnRemove); 121 | this.Controls.Add(this.grpAdd); 122 | this.Controls.Add(this.lstBlacklist); 123 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 124 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 125 | this.MaximizeBox = false; 126 | this.MinimizeBox = false; 127 | this.Name = "frmBlacklist"; 128 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 129 | this.Text = "Manage Idle Master Blacklist"; 130 | this.Load += new System.EventHandler(this.frmBlacklist_Load); 131 | this.grpAdd.ResumeLayout(false); 132 | this.grpAdd.PerformLayout(); 133 | this.ResumeLayout(false); 134 | 135 | } 136 | 137 | #endregion 138 | 139 | private ListBox lstBlacklist; 140 | private GroupBox grpAdd; 141 | private Button btnRemove; 142 | private Button btnSave; 143 | private Button btnAdd; 144 | private TextBox txtAppid; 145 | private Label label1; 146 | } 147 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmBlacklist.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | using IdleMaster.Properties; 5 | 6 | namespace IdleMaster 7 | { 8 | public partial class frmBlacklist : Form 9 | { 10 | public frmBlacklist() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | public void SaveBlacklist() 16 | { 17 | Settings.Default.blacklist.Clear(); 18 | Settings.Default.blacklist.AddRange(lstBlacklist.Items.Cast().ToArray()); 19 | Settings.Default.Save(); 20 | } 21 | 22 | private void frmBlacklist_Load(object sender, EventArgs e) 23 | { 24 | // Localize form 25 | btnAdd.Text = localization.strings.add; 26 | btnSave.Text = localization.strings.save; 27 | this.Text = localization.strings.manage_blacklist; 28 | grpAdd.Text = localization.strings.add_game_blacklist; 29 | 30 | lstBlacklist.Items.AddRange(Settings.Default.blacklist.Cast().ToArray()); 31 | } 32 | 33 | private void btnSave_Click(object sender, EventArgs e) 34 | { 35 | SaveBlacklist(); 36 | Close(); 37 | } 38 | 39 | private void btnAdd_Click(object sender, EventArgs e) 40 | { 41 | int result; 42 | if (int.TryParse(txtAppid.Text, out result)) 43 | { 44 | if (lstBlacklist.Items.Cast().All(blApp => blApp != txtAppid.Text)) 45 | lstBlacklist.Items.Add(txtAppid.Text); 46 | } 47 | txtAppid.Text = string.Empty; 48 | txtAppid.Focus(); 49 | } 50 | 51 | private void btnRemove_Click(object sender, EventArgs e) 52 | { 53 | lstBlacklist.Items.Remove(lstBlacklist.SelectedItem); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmBrowser.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | partial class frmBrowser 7 | { 8 | /// 9 | /// Required designer variable. 10 | /// 11 | private IContainer components = null; 12 | 13 | /// 14 | /// Clean up any resources being used. 15 | /// 16 | /// true if managed resources should be disposed; otherwise, false. 17 | protected override void Dispose(bool disposing) 18 | { 19 | if (disposing && (components != null)) 20 | { 21 | components.Dispose(); 22 | } 23 | base.Dispose(disposing); 24 | } 25 | 26 | #region Windows Form Designer generated code 27 | 28 | /// 29 | /// Required method for Designer support - do not modify 30 | /// the contents of this method with the code editor. 31 | /// 32 | private void InitializeComponent() 33 | { 34 | this.components = new System.ComponentModel.Container(); 35 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmBrowser)); 36 | this.wbAuth = new System.Windows.Forms.WebBrowser(); 37 | this.lblSaving = new System.Windows.Forms.Label(); 38 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 39 | this.tmrCheck = new System.Windows.Forms.Timer(this.components); 40 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 41 | this.SuspendLayout(); 42 | // 43 | // wbAuth 44 | // 45 | this.wbAuth.AllowWebBrowserDrop = false; 46 | this.wbAuth.Dock = System.Windows.Forms.DockStyle.Fill; 47 | this.wbAuth.Location = new System.Drawing.Point(0, 0); 48 | this.wbAuth.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 49 | this.wbAuth.MinimumSize = new System.Drawing.Size(27, 23); 50 | this.wbAuth.Name = "wbAuth"; 51 | this.wbAuth.ScriptErrorsSuppressed = true; 52 | this.wbAuth.ScrollBarsEnabled = false; 53 | this.wbAuth.Size = new System.Drawing.Size(1301, 921); 54 | this.wbAuth.TabIndex = 0; 55 | this.wbAuth.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.wbAuth_DocumentCompleted); 56 | this.wbAuth.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.wbAuth_Navigating); 57 | // 58 | // lblSaving 59 | // 60 | this.lblSaving.AutoSize = true; 61 | this.lblSaving.Location = new System.Drawing.Point(45, 13); 62 | this.lblSaving.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 63 | this.lblSaving.Name = "lblSaving"; 64 | this.lblSaving.Size = new System.Drawing.Size(311, 15); 65 | this.lblSaving.TabIndex = 1; 66 | this.lblSaving.Text = "Idle Master is saving your information"; 67 | // 68 | // pictureBox1 69 | // 70 | this.pictureBox1.Image = global::IdleMaster.Properties.Resources.imgSpin; 71 | this.pictureBox1.Location = new System.Drawing.Point(17, 10); 72 | this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 73 | this.pictureBox1.Name = "pictureBox1"; 74 | this.pictureBox1.Size = new System.Drawing.Size(21, 18); 75 | this.pictureBox1.TabIndex = 2; 76 | this.pictureBox1.TabStop = false; 77 | // 78 | // tmrCheck 79 | // 80 | this.tmrCheck.Interval = 1000; 81 | this.tmrCheck.Tick += new System.EventHandler(this.tmrCheck_Tick); 82 | // 83 | // frmBrowser 84 | // 85 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); 86 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 87 | this.ClientSize = new System.Drawing.Size(1301, 921); 88 | this.Controls.Add(this.wbAuth); 89 | this.Controls.Add(this.pictureBox1); 90 | this.Controls.Add(this.lblSaving); 91 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 92 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 93 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 94 | this.MaximizeBox = false; 95 | this.Name = "frmBrowser"; 96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 97 | this.Text = "Please Login to Steam"; 98 | this.Load += new System.EventHandler(this.frmBrowser_Load); 99 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 100 | this.ResumeLayout(false); 101 | this.PerformLayout(); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private WebBrowser wbAuth; 108 | private Label lblSaving; 109 | private PictureBox pictureBox1; 110 | private Timer tmrCheck; 111 | } 112 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmBrowser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | using IdleMaster.Properties; 7 | 8 | namespace IdleMaster 9 | { 10 | public partial class frmBrowser : Form 11 | { 12 | 13 | public int SecondsWaiting = GetMaxTimeout(); 14 | 15 | [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)] 16 | private static extern bool InternetSetOption(int hInternet, int dwOption, string lpBuffer, int dwBufferLength); 17 | 18 | [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)] 19 | private static extern bool InternetSetCookie(string lpszUrlName, string lpszCookieName, string lpszCookieData); 20 | 21 | public frmBrowser() 22 | { 23 | // This initializes the components on the form 24 | InitializeComponent(); 25 | } 26 | 27 | public static int GetMaxTimeout() 28 | { 29 | int[] tmpTimeList = { 15, 30, 60, 90, 125800 }; 30 | return tmpTimeList[Settings.Default.LoginTimeout]; 31 | } 32 | 33 | private void frmBrowser_Load(object sender, EventArgs e) 34 | { 35 | // Remove any existing session state data 36 | InternetSetOption(0, 42, null, 0); 37 | 38 | // Localize form 39 | this.Text = localization.strings.please_login; 40 | lblSaving.Text = localization.strings.saving_info; 41 | 42 | // Delete Steam cookie data from the browser control 43 | InternetSetCookie("https://steamcommunity.com", "sessionid", ";expires=Mon, 01 Jan 0001 00:00:00 GMT"); 44 | InternetSetCookie("https://steamcommunity.com", "steamLoginSecure", ";expires=Mon, 01 Jan 0001 00:00:00 GMT"); 45 | InternetSetCookie("https://steamcommunity.com", "steamRememberLogin", ";expires=Mon, 01 Jan 0001 00:00:00 GMT"); 46 | 47 | // When the form is loaded, navigate to the Steam login page using the web browser control 48 | //个人主页(默认) 49 | //徽章页面 50 | //库存页面(不推荐) 51 | //截图页面(不推荐) 52 | //评测页面 53 | //组页面 54 | string[] PageStr = new string[] { "profile", "badges", "inventory", "screenshots", "recommended", "groups" }; 55 | wbAuth.Navigate("https://steamcommunity.com/login/home/?goto=my/" + PageStr[Settings.Default.LoginPageRedirect], "_self", null, "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"); 56 | } 57 | 58 | // This code block executes each time a new document is loaded into the web browser control 59 | private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) 60 | { 61 | // Find the page header, and remove it. This gives the login form a more streamlined look. 62 | dynamic htmldoc = wbAuth.Document.DomDocument; 63 | try 64 | { 65 | dynamic globalHeader = htmldoc.GetElementById("global_header"); 66 | if (globalHeader != null) 67 | { 68 | globalHeader.parentNode.removeChild(globalHeader); 69 | } 70 | } 71 | catch (Exception) 72 | { 73 | } 74 | 75 | // Get the URL of the page that just finished loading 76 | var url = wbAuth.Url.AbsoluteUri; 77 | 78 | // If the page it just finished loading is the login page 79 | //if (url == "https://steamcommunity.com/login/home/?goto=my/profile" || 80 | if (url.StartsWith("https://steamcommunity.com/login/home/?goto=my/") || 81 | url == "https://store.steampowered.com/login/transfer" || 82 | url == "https://store.steampowered.com//login/transfer") 83 | { 84 | // Get a list of cookies from the current page 85 | CookieContainer container = GetUriCookieContainer(wbAuth.Url); 86 | var cookies = container.GetCookies(wbAuth.Url); 87 | foreach (Cookie cookie in cookies) 88 | { 89 | if (cookie.Name.StartsWith("steamMachineAuth")) 90 | Settings.Default.steamMachineAuth = cookie.Value; 91 | } 92 | } 93 | // If the page it just finished loading isn't the login page 94 | else if (url.StartsWith("javascript:") == false && url.StartsWith("about:") == false) 95 | { 96 | 97 | try 98 | { 99 | dynamic parentalNotice = htmldoc.GetElementById("parental_notice"); 100 | if (parentalNotice != null) 101 | { 102 | if (parentalNotice.OuterHtml != "") 103 | { 104 | // Steam family options enabled 105 | wbAuth.Show(); 106 | Width = 1000; 107 | Height = 350; 108 | return; 109 | } 110 | } 111 | } 112 | catch (Exception) 113 | { 114 | 115 | } 116 | 117 | // Get a list of cookies from the current page 118 | var container = GetUriCookieContainer(wbAuth.Url); 119 | var cookies = container.GetCookies(wbAuth.Url); 120 | 121 | // Go through the cookie data so that we can extract the cookies we are looking for 122 | foreach (Cookie cookie in cookies) 123 | { 124 | // Save the "sessionid" cookie 125 | if (cookie.Name == "sessionid") 126 | { 127 | Settings.Default.sessionid = cookie.Value; 128 | } 129 | 130 | // Save the "steamLogin" cookie and construct and save the user's profile link 131 | // steamLogin is now Change to steamLoginSecure 132 | /*else if (cookie.Name == "steamLogin") 133 | { 134 | Settings.Default.steamLogin = cookie.Value; 135 | Settings.Default.myProfileURL = SteamProfile.GetSteamUrl(); 136 | }*/ 137 | 138 | // Save the "steamLogin" cookie and construct and save the user's profile link 139 | else if (cookie.Name == "steamLoginSecure") 140 | { 141 | Settings.Default.steamLoginSecure = cookie.Value; 142 | Settings.Default.myProfileURL = SteamProfile.GetSteamUrl(); 143 | } 144 | 145 | else if (cookie.Name == "steamRememberLogin") 146 | { 147 | Settings.Default.steamRememberLogin = cookie.Value; 148 | } 149 | else if (cookie.Name == "steamparental") 150 | { 151 | Settings.Default.steamparental = cookie.Value; 152 | } 153 | } 154 | 155 | // Save all of the data to the program settings file, and close this form 156 | Settings.Default.Save(); 157 | tmrCheck.Enabled = false; 158 | Close(); 159 | } 160 | } 161 | 162 | // Imports the InternetGetCookieEx function from wininet.dll which allows the application to access the cookie data from the web browser control 163 | // Reference: http://stackoverflow.com/questions/3382498/is-it-possible-to-transfer-authentication-from-webbrowser-to-webrequest 164 | [DllImport("wininet.dll", SetLastError = true)] 165 | public static extern bool InternetGetCookieEx( 166 | string url, 167 | string cookieName, 168 | StringBuilder cookieData, 169 | ref int size, 170 | int dwFlags, 171 | IntPtr lpReserved); 172 | 173 | // Assigns the hex value for the DLL flag that allows Idle Master to be able to access cookie data marked as "HTTP Only" 174 | private const int InternetCookieHttponly = 0x2000; 175 | 176 | // This function returns cookie data based on a uniform resource identifier 177 | public static CookieContainer GetUriCookieContainer(Uri uri) 178 | { 179 | // First, create a null cookie container 180 | CookieContainer cookies = null; 181 | 182 | // Determine the size of the cookie 183 | var datasize = 8192 * 16; 184 | var cookieData = new StringBuilder(datasize); 185 | 186 | // Call InternetGetCookieEx from wininet.dll 187 | if (!InternetGetCookieEx(uri.ToString(), null, cookieData, ref datasize, InternetCookieHttponly, IntPtr.Zero)) 188 | { 189 | if (datasize < 0) 190 | return null; 191 | // Allocate stringbuilder large enough to hold the cookie 192 | cookieData = new StringBuilder(datasize); 193 | if (!InternetGetCookieEx( 194 | uri.ToString(), 195 | null, cookieData, 196 | ref datasize, 197 | InternetCookieHttponly, 198 | IntPtr.Zero)) 199 | return null; 200 | } 201 | 202 | // If the cookie contains data, add it to the cookie container 203 | if (cookieData.Length > 0) 204 | { 205 | cookies = new CookieContainer(); 206 | cookies.SetCookies(uri, cookieData.ToString().Replace(';', ',')); 207 | } 208 | 209 | // Return the cookie container 210 | return cookies; 211 | } 212 | 213 | // This code executes each time the web browser control is in the process of navigating 214 | private void wbAuth_Navigating(object sender, WebBrowserNavigatingEventArgs e) 215 | { 216 | // Get the url that's being navigated to 217 | var url = e.Url.AbsoluteUri; 218 | 219 | // Check to see if the page it's navigating to isn't the Steam login page or related calls 220 | //if (url != "https://steamcommunity.com/login/home/?goto=my/profile" 221 | if (!url.StartsWith("https://steamcommunity.com/login/home/?goto=my/") 222 | && url != "https://store.steampowered.com/login/transfer" && url != "https://store.steampowered.com//login/transfer" && url.StartsWith("javascript:") == false && url.StartsWith("about:") == false) 223 | { 224 | // start the sanity check timer 225 | tmrCheck.Enabled = true; 226 | 227 | // If it's navigating to a page other than the Steam login page, hide the browser control and resize the form 228 | wbAuth.Visible = false; 229 | 230 | // Scale the form based on the user's DPI settings 231 | var graphics = CreateGraphics(); 232 | var scaleY = graphics.DpiY * 0.84375; 233 | var scaleX = graphics.DpiX * 2.84; 234 | Height = Convert.ToInt32(scaleY); 235 | Width = Convert.ToInt32(scaleX); 236 | } 237 | } 238 | 239 | private void tmrCheck_Tick(object sender, EventArgs e) 240 | { 241 | // Prevents the application from "saving" for more than 30 seconds and will attempt to save the cookie data after that time 242 | if (SecondsWaiting > 0) 243 | { 244 | SecondsWaiting = SecondsWaiting - 1; 245 | } 246 | else 247 | { 248 | tmrCheck.Enabled = false; 249 | //MessageBox.Show("等待超时,退出"); 250 | Close(); 251 | } 252 | } 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmChangelog.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | partial class frmChangelog 7 | { 8 | /// 9 | /// Required designer variable. 10 | /// 11 | private IContainer components = null; 12 | 13 | /// 14 | /// Clean up any resources being used. 15 | /// 16 | /// true if managed resources should be disposed; otherwise, false. 17 | protected override void Dispose(bool disposing) 18 | { 19 | if (disposing && (components != null)) 20 | { 21 | components.Dispose(); 22 | } 23 | base.Dispose(disposing); 24 | } 25 | 26 | #region Windows Form Designer generated code 27 | 28 | /// 29 | /// Required method for Designer support - do not modify 30 | /// the contents of this method with the code editor. 31 | /// 32 | private void InitializeComponent() 33 | { 34 | var resources = new System.ComponentModel.ComponentResourceManager(typeof(frmChangelog)); 35 | this.rtbChangelog = new System.Windows.Forms.RichTextBox(); 36 | this.SuspendLayout(); 37 | // 38 | // rtbChangelog 39 | // 40 | this.rtbChangelog.BackColor = System.Drawing.Color.White; 41 | this.rtbChangelog.Dock = System.Windows.Forms.DockStyle.Fill; 42 | this.rtbChangelog.Location = new System.Drawing.Point(0, 0); 43 | this.rtbChangelog.Name = "rtbChangelog"; 44 | this.rtbChangelog.ReadOnly = true; 45 | this.rtbChangelog.Size = new System.Drawing.Size(564, 578); 46 | this.rtbChangelog.TabIndex = 0; 47 | this.rtbChangelog.Text = ""; 48 | // 49 | // frmChangelog 50 | // 51 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 52 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 53 | this.ClientSize = new System.Drawing.Size(564, 578); 54 | this.Controls.Add(this.rtbChangelog); 55 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 56 | this.Name = "frmChangelog"; 57 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 58 | this.Text = "Idle Master Release Notes"; 59 | this.Load += new System.EventHandler(this.frmChangelog_Load); 60 | this.ResumeLayout(false); 61 | 62 | } 63 | 64 | #endregion 65 | 66 | private RichTextBox rtbChangelog; 67 | } 68 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmChangelog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using IdleMaster.Properties; 4 | 5 | namespace IdleMaster 6 | { 7 | public partial class frmChangelog : Form 8 | { 9 | public frmChangelog() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | private void frmChangelog_Load(object sender, EventArgs e) 15 | { 16 | // Localize Form 17 | this.Text = localization.strings.release_notes_title; 18 | 19 | rtbChangelog.Rtf = Resources.Changelog; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using IdleMaster.Properties; 4 | using System.Threading; 5 | using System.Text.RegularExpressions; 6 | using System.Runtime.InteropServices; 7 | using System.Text; 8 | 9 | namespace IdleMaster 10 | { 11 | public partial class frmSettings : Form 12 | { 13 | [DllImport("kernel32")] 14 | private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); 15 | public frmSettings() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void btnCancel_Click(object sender, EventArgs e) 21 | { 22 | Close(); 23 | } 24 | 25 | private void btnOK_Click(object sender, EventArgs e) 26 | { 27 | if (radIdleDefault.Checked) 28 | { 29 | Settings.Default.sort = "default"; 30 | } 31 | if (radIdleLeastDrops.Checked) 32 | { 33 | Settings.Default.sort = "leastcards"; 34 | } 35 | if (radIdleMostDrops.Checked) 36 | { 37 | Settings.Default.sort = "mostcards"; 38 | } 39 | if (radIdleMostValue.Checked) 40 | { 41 | Settings.Default.sort = "mostvalue"; 42 | } 43 | 44 | if (cboLanguage.Text != "") 45 | { 46 | if (cboLanguage.Text != Settings.Default.language) 47 | { 48 | MessageBox.Show(localization.strings.please_restart); 49 | } 50 | Settings.Default.language = cboLanguage.Text; 51 | } 52 | 53 | if (radOneThenMany.Checked) 54 | { 55 | Settings.Default.OnlyOneGameIdle = false; 56 | Settings.Default.OneThenMany = true; 57 | } 58 | else 59 | { 60 | Settings.Default.OnlyOneGameIdle = radOneGameOnly.Checked && !radManyThenOne.Checked; 61 | Settings.Default.OneThenMany = false; 62 | } 63 | Settings.Default.minToTray = chkMinToTray.Checked; 64 | Settings.Default.ignoreclient = chkIgnoreClientStatus.Checked; 65 | Settings.Default.showUsername = chkShowUsername.Checked; 66 | Settings.Default.LoginTimeout = Maxtimeout.SelectedIndex; 67 | Settings.Default.LoginPageRedirect = PageRedit.SelectedIndex; 68 | Settings.Default.MaxIdleCount = int.Parse(textBox1.Text); 69 | Settings.Default.Save(); 70 | Close(); 71 | } 72 | //以下为魔改代码 73 | [DllImport("kernel32")] 74 | private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath); 75 | private string MinRuntime_s; 76 | private void LoadForm() 77 | { 78 | try 79 | { 80 | //获取最小运行时间 81 | StringBuilder temp = new StringBuilder(500); 82 | GetPrivateProfileString("AutoNext", "MinRuntime", "2", temp, 500, ".\\Settings.ini"); 83 | if (temp.ToString() == "") 84 | { MinRuntime_s = "2"; } 85 | else 86 | { 87 | MinRuntime_s = temp.ToString(); 88 | } 89 | } 90 | catch (Exception ex) 91 | { 92 | MessageBox.Show("程序发生错误,即将退出!\r\n错误信息:" + ex.Message); 93 | System.Environment.Exit(0); 94 | } 95 | } 96 | 97 | 98 | private void frmSettings_Load(object sender, EventArgs e) 99 | { 100 | LoadForm(); 101 | if (Settings.Default.language != "") 102 | { 103 | cboLanguage.SelectedItem = Settings.Default.language; 104 | } 105 | else 106 | { 107 | switch (Thread.CurrentThread.CurrentUICulture.EnglishName) 108 | { 109 | case "Chinese (Simplified, China)": 110 | case "Chinese (Traditional, China)": 111 | case "Portuguese (Brazil)": 112 | cboLanguage.SelectedItem = Thread.CurrentThread.CurrentUICulture.EnglishName; 113 | break; 114 | default: 115 | cboLanguage.SelectedItem = Regex.Replace(Thread.CurrentThread.CurrentUICulture.EnglishName, @"\(.+\)", "").Trim(); 116 | break; 117 | } 118 | } 119 | 120 | switch (Settings.Default.sort) 121 | { 122 | case "leastcards": 123 | radIdleLeastDrops.Checked = true; 124 | break; 125 | case "mostcards": 126 | radIdleMostDrops.Checked = true; 127 | break; 128 | case "mostvalue": 129 | radIdleMostValue.Checked = true; 130 | break; 131 | default: 132 | break; 133 | } 134 | 135 | // Load translation 136 | this.Text = localization.strings.idle_master_settings; 137 | grpGeneral.Text = localization.strings.general; 138 | grpIdlingQuantity.Text = localization.strings.idling_behavior; 139 | grpPriority.Text = localization.strings.idling_order; 140 | btnOK.Text = localization.strings.accept; 141 | btnCancel.Text = localization.strings.cancel; 142 | ttHints.SetToolTip(btnAdvanced, localization.strings.advanced_auth); 143 | chkMinToTray.Text = localization.strings.minimize_to_tray; 144 | ttHints.SetToolTip(chkMinToTray, localization.strings.minimize_to_tray); 145 | chkIgnoreClientStatus.Text = localization.strings.ignore_client_status; 146 | ttHints.SetToolTip(chkIgnoreClientStatus, localization.strings.ignore_client_status); 147 | chkShowUsername.Text = localization.strings.show_username; 148 | ttHints.SetToolTip(chkShowUsername, localization.strings.show_username); 149 | radOneGameOnly.Text = localization.strings.idle_individual; 150 | ttHints.SetToolTip(radOneGameOnly, localization.strings.idle_individual); 151 | 152 | //以下为魔改代码 153 | //radManyThenOne.Text = localization.strings.idle_simultaneous; 154 | //ttHints.SetToolTip(radManyThenOne, localization.strings.idle_simultaneous); 155 | //radOneThenMany.Text = localization.strings.idle_onethenmany; 156 | //ttHints.SetToolTip(radOneThenMany, localization.strings.idle_onethenmany); 157 | radManyThenOne.Text = localization.strings.idle_simultaneous.Replace("2", MinRuntime_s); 158 | ttHints.SetToolTip(radManyThenOne, localization.strings.idle_simultaneous.Replace("2", MinRuntime_s)); 159 | radOneThenMany.Text = localization.strings.idle_onethenmany.Replace("2", MinRuntime_s); 160 | ttHints.SetToolTip(radOneThenMany, localization.strings.idle_onethenmany.Replace("2", MinRuntime_s)); 161 | 162 | radIdleDefault.Text = localization.strings.order_default; 163 | ttHints.SetToolTip(radIdleDefault, localization.strings.order_default); 164 | radIdleMostValue.Text = localization.strings.order_value; 165 | ttHints.SetToolTip(radIdleMostValue, localization.strings.order_value); 166 | radIdleMostDrops.Text = localization.strings.order_most; 167 | ttHints.SetToolTip(radIdleMostDrops, localization.strings.order_most); 168 | radIdleLeastDrops.Text = localization.strings.order_least; 169 | ttHints.SetToolTip(radIdleLeastDrops, localization.strings.order_least); 170 | lblLanguage.Text = localization.strings.interface_language; 171 | 172 | if (Settings.Default.OneThenMany) 173 | { 174 | radOneThenMany.Checked = true; 175 | } 176 | else 177 | { 178 | radOneGameOnly.Checked = Settings.Default.OnlyOneGameIdle; 179 | radManyThenOne.Checked = !Settings.Default.OnlyOneGameIdle; 180 | } 181 | 182 | if (Settings.Default.minToTray) 183 | { 184 | chkMinToTray.Checked = true; 185 | } 186 | 187 | if (Settings.Default.ignoreclient) 188 | { 189 | chkIgnoreClientStatus.Checked = true; 190 | } 191 | 192 | if (Settings.Default.showUsername) 193 | { 194 | chkShowUsername.Checked = true; 195 | } 196 | 197 | Maxtimeout.SelectedIndex = Settings.Default.LoginTimeout; 198 | PageRedit.SelectedIndex = Settings.Default.LoginPageRedirect; 199 | textBox1.Text = Settings.Default.MaxIdleCount.ToString(); 200 | } 201 | 202 | private void btnAdvanced_Click(object sender, EventArgs e) 203 | { 204 | var frm = new frmSettingsAdvanced(); 205 | frm.ShowDialog(); 206 | } 207 | //以下是魔改代码 208 | private static frmWagaSettings newForm; 209 | private void btnWaga_Click(object sender, EventArgs e) 210 | { 211 | if (newForm == null || newForm.IsDisposed) 212 | { 213 | newForm = new frmWagaSettings(); 214 | newForm.Show(); 215 | } 216 | else 217 | { 218 | newForm.WindowState = FormWindowState.Normal; 219 | newForm.Activate(); 220 | } 221 | } 222 | 223 | private void buttonhs_Click(object sender, EventArgs e) 224 | { 225 | MessageBox.Show("论坛里有人问为什么读取完用户信息之后,对话框消失却什么也没发生\n" + 226 | "我实际使用的时候也发现了这一点,但是在我这里,第二次登陆基本就能够使用了\n" + 227 | "所以,我怀疑这个问题的原因是IdleMaster没能够读取完用户信息,就因为超时而停止了读取。\n" + 228 | "所以这里提供了一个设置值,如果出现网络情况不好而迟迟无法在短时间内读取完成的话,这个设置或许能够有所帮助。", "这是什么选项?"); 229 | } 230 | 231 | private void buttonhs2_Click(object sender, EventArgs e) 232 | { 233 | MessageBox.Show("此设置同样是为了解决登陆问题而设置的。" + 234 | "在Idle Master登陆后,会通过访问Steam的页面来获得Cookie。" + 235 | "这个页面被Idle Master定为用户的个人主页," + 236 | "但是有些大佬的个人主页,特别生动多彩," + 237 | "这就导致这个页面迟迟无法加载完毕,而导致了超时。" + 238 | "这个选项的作用就是让Idle访问其他比较朴实的页面(比如徽章和组)来避免加载大量资源而造成超时。", "这是什么选项?"); 239 | } 240 | 241 | private void textBox1_KeyPress(object sender, KeyPressEventArgs e) 242 | { 243 | if (e.KeyChar != '\b')//这是允许输入退格键 244 | { 245 | if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字 246 | { 247 | e.Handled = true; 248 | } 249 | } 250 | } 251 | 252 | private void button1_Click(object sender, EventArgs e) 253 | { 254 | MessageBox.Show("此处可以设置同时挂卡的最大上限,Idle默认可以同时运行30个游戏,你可以修改这个参数,来限制IdleMaster的运行数量。" + 255 | "但是,由于Steam本身的限制,无论运行多少游戏,最多只有30个游戏会记录时长,请自行斟酌","这是什么?"); 256 | } 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmSettingsAdvanced.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | partial class frmSettingsAdvanced 7 | { 8 | /// 9 | /// Required designer variable. 10 | /// 11 | private IContainer components = null; 12 | 13 | /// 14 | /// Clean up any resources being used. 15 | /// 16 | /// true if managed resources should be disposed; otherwise, false. 17 | protected override void Dispose(bool disposing) 18 | { 19 | if (disposing && (components != null)) 20 | { 21 | components.Dispose(); 22 | } 23 | base.Dispose(disposing); 24 | } 25 | 26 | #region Windows Form Designer generated code 27 | 28 | /// 29 | /// Required method for Designer support - do not modify 30 | /// the contents of this method with the code editor. 31 | /// 32 | private void InitializeComponent() 33 | { 34 | this.components = new System.ComponentModel.Container(); 35 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSettingsAdvanced)); 36 | this.label1 = new System.Windows.Forms.Label(); 37 | this.label2 = new System.Windows.Forms.Label(); 38 | this.label3 = new System.Windows.Forms.Label(); 39 | this.txtSessionID = new System.Windows.Forms.TextBox(); 40 | this.txtsteamMachineAuth = new System.Windows.Forms.TextBox(); 41 | this.txtsteamLoginSecure = new System.Windows.Forms.TextBox(); 42 | this.btnUpdate = new System.Windows.Forms.Button(); 43 | this.btnView = new System.Windows.Forms.Button(); 44 | this.ttHelp = new System.Windows.Forms.ToolTip(this.components); 45 | this.txtSteamparental = new System.Windows.Forms.TextBox(); 46 | this.label4 = new System.Windows.Forms.Label(); 47 | this.noticeBox = new System.Windows.Forms.GroupBox(); 48 | this.NoticeUseCookie = new System.Windows.Forms.Label(); 49 | this.NoticeFamilyView = new System.Windows.Forms.Label(); 50 | this.noticeBox.SuspendLayout(); 51 | this.SuspendLayout(); 52 | // 53 | // label1 54 | // 55 | this.label1.Location = new System.Drawing.Point(25, 12); 56 | this.label1.Name = "label1"; 57 | this.label1.Size = new System.Drawing.Size(85, 21); 58 | this.label1.TabIndex = 0; 59 | this.label1.Text = "sessionid:"; 60 | this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; 61 | // 62 | // label2 63 | // 64 | this.label2.Location = new System.Drawing.Point(3, 33); 65 | this.label2.Name = "label2"; 66 | this.label2.Size = new System.Drawing.Size(107, 21); 67 | this.label2.TabIndex = 1; 68 | this.label2.Text = "steamMachineAuth:"; 69 | this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; 70 | // 71 | // label3 72 | // 73 | this.label3.Location = new System.Drawing.Point(1, 55); 74 | this.label3.Name = "label3"; 75 | this.label3.Size = new System.Drawing.Size(109, 21); 76 | this.label3.TabIndex = 2; 77 | this.label3.Text = "steamLoginSecure:"; 78 | this.label3.TextAlign = System.Drawing.ContentAlignment.TopRight; 79 | // 80 | // txtSessionID 81 | // 82 | this.txtSessionID.Location = new System.Drawing.Point(116, 9); 83 | this.txtSessionID.Name = "txtSessionID"; 84 | this.txtSessionID.PasswordChar = '*'; 85 | this.txtSessionID.Size = new System.Drawing.Size(317, 21); 86 | this.txtSessionID.TabIndex = 3; 87 | this.txtSessionID.TextChanged += new System.EventHandler(this.txtSessionID_TextChanged); 88 | // 89 | // txtsteamMachineAuth 90 | // 91 | this.txtsteamMachineAuth.Location = new System.Drawing.Point(116, 31); 92 | this.txtsteamMachineAuth.Name = "txtsteamMachineAuth"; 93 | this.txtsteamMachineAuth.PasswordChar = '*'; 94 | this.txtsteamMachineAuth.Size = new System.Drawing.Size(317, 21); 95 | this.txtsteamMachineAuth.TabIndex = 4; 96 | this.txtsteamMachineAuth.TextChanged += new System.EventHandler(this.txtSteamLogin_TextChanged); 97 | // 98 | // txtsteamLoginSecure 99 | // 100 | this.txtsteamLoginSecure.Location = new System.Drawing.Point(116, 53); 101 | this.txtsteamLoginSecure.Name = "txtsteamLoginSecure"; 102 | this.txtsteamLoginSecure.PasswordChar = '*'; 103 | this.txtsteamLoginSecure.Size = new System.Drawing.Size(317, 21); 104 | this.txtsteamLoginSecure.TabIndex = 5; 105 | this.txtsteamLoginSecure.TextChanged += new System.EventHandler(this.txtSteamParental_TextChanged); 106 | // 107 | // btnUpdate 108 | // 109 | this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 110 | this.btnUpdate.Location = new System.Drawing.Point(358, 214); 111 | this.btnUpdate.Name = "btnUpdate"; 112 | this.btnUpdate.Size = new System.Drawing.Size(75, 21); 113 | this.btnUpdate.TabIndex = 7; 114 | this.btnUpdate.Text = "&Update"; 115 | this.btnUpdate.UseVisualStyleBackColor = true; 116 | this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click); 117 | // 118 | // btnView 119 | // 120 | this.btnView.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 121 | this.btnView.Image = global::IdleMaster.Properties.Resources.imgView; 122 | this.btnView.Location = new System.Drawing.Point(116, 217); 123 | this.btnView.Name = "btnView"; 124 | this.btnView.Size = new System.Drawing.Size(27, 21); 125 | this.btnView.TabIndex = 6; 126 | this.ttHelp.SetToolTip(this.btnView, "Display information above\r\n\r\n[WARNING] \r\nDo not share this information with anyon" + 127 | "e, \r\nas it could potentially be used by an attacker to log into \r\nyour Steam acc" + 128 | "ount."); 129 | this.btnView.UseVisualStyleBackColor = true; 130 | this.btnView.Click += new System.EventHandler(this.btnView_Click); 131 | // 132 | // ttHelp 133 | // 134 | this.ttHelp.AutoPopDelay = 9000; 135 | this.ttHelp.InitialDelay = 500; 136 | this.ttHelp.ReshowDelay = 100; 137 | // 138 | // txtSteamparental 139 | // 140 | this.txtSteamparental.Location = new System.Drawing.Point(116, 75); 141 | this.txtSteamparental.Name = "txtSteamparental"; 142 | this.txtSteamparental.PasswordChar = '*'; 143 | this.txtSteamparental.Size = new System.Drawing.Size(317, 21); 144 | this.txtSteamparental.TabIndex = 9; 145 | this.txtSteamparental.TextChanged += new System.EventHandler(this.txtSteamparental_TextChanged_1); 146 | // 147 | // label4 148 | // 149 | this.label4.Location = new System.Drawing.Point(1, 77); 150 | this.label4.Name = "label4"; 151 | this.label4.Size = new System.Drawing.Size(109, 21); 152 | this.label4.TabIndex = 8; 153 | this.label4.Text = "steamparental:"; 154 | this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight; 155 | // 156 | // noticeBox 157 | // 158 | this.noticeBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 159 | | System.Windows.Forms.AnchorStyles.Left) 160 | | System.Windows.Forms.AnchorStyles.Right))); 161 | this.noticeBox.Controls.Add(this.NoticeFamilyView); 162 | this.noticeBox.Controls.Add(this.NoticeUseCookie); 163 | this.noticeBox.Location = new System.Drawing.Point(12, 101); 164 | this.noticeBox.Name = "noticeBox"; 165 | this.noticeBox.Size = new System.Drawing.Size(421, 107); 166 | this.noticeBox.TabIndex = 10; 167 | this.noticeBox.TabStop = false; 168 | this.noticeBox.Text = "Notice:"; 169 | // 170 | // NoticeUseCookie 171 | // 172 | this.NoticeUseCookie.Location = new System.Drawing.Point(7, 21); 173 | this.NoticeUseCookie.Name = "NoticeUseCookie"; 174 | this.NoticeUseCookie.Size = new System.Drawing.Size(408, 36); 175 | this.NoticeUseCookie.TabIndex = 0; 176 | this.NoticeUseCookie.Text = "1.Please use the cookie form \"SteamCommunity.com\" instead of \"store.steampowered." + 177 | "com\",or you can\'t login to SteamCommunity."; 178 | // 179 | // NoticeFamilyView 180 | // 181 | this.NoticeFamilyView.Location = new System.Drawing.Point(6, 60); 182 | this.NoticeFamilyView.Name = "NoticeFamilyView"; 183 | this.NoticeFamilyView.Size = new System.Drawing.Size(408, 36); 184 | this.NoticeFamilyView.TabIndex = 1; 185 | this.NoticeFamilyView.Text = "2.Leave steamparental to empty if you don\'t open the Steam Family View."; 186 | // 187 | // frmSettingsAdvanced 188 | // 189 | this.AcceptButton = this.btnUpdate; 190 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 191 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 192 | this.ClientSize = new System.Drawing.Size(446, 244); 193 | this.Controls.Add(this.noticeBox); 194 | this.Controls.Add(this.txtSteamparental); 195 | this.Controls.Add(this.label4); 196 | this.Controls.Add(this.btnUpdate); 197 | this.Controls.Add(this.btnView); 198 | this.Controls.Add(this.txtsteamLoginSecure); 199 | this.Controls.Add(this.txtsteamMachineAuth); 200 | this.Controls.Add(this.txtSessionID); 201 | this.Controls.Add(this.label3); 202 | this.Controls.Add(this.label2); 203 | this.Controls.Add(this.label1); 204 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 205 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 206 | this.MaximizeBox = false; 207 | this.Name = "frmSettingsAdvanced"; 208 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 209 | this.Text = "Idle Master Authentication Data"; 210 | this.Load += new System.EventHandler(this.frmSettingsAdvanced_Load); 211 | this.noticeBox.ResumeLayout(false); 212 | this.ResumeLayout(false); 213 | this.PerformLayout(); 214 | 215 | } 216 | 217 | #endregion 218 | 219 | private Label label1; 220 | private Label label2; 221 | private Label label3; 222 | private TextBox txtSessionID; 223 | private TextBox txtsteamMachineAuth; 224 | private TextBox txtsteamLoginSecure; 225 | private Button btnView; 226 | private Button btnUpdate; 227 | private ToolTip ttHelp; 228 | private TextBox txtSteamparental; 229 | private Label label4; 230 | private GroupBox noticeBox; 231 | private Label NoticeFamilyView; 232 | private Label NoticeUseCookie; 233 | } 234 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmSettingsAdvanced.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using System.Windows.Forms; 4 | using IdleMaster.Properties; 5 | 6 | namespace IdleMaster 7 | { 8 | public partial class frmSettingsAdvanced : Form 9 | { 10 | public frmSettingsAdvanced() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void btnView_Click(object sender, EventArgs e) 16 | { 17 | txtSessionID.PasswordChar = '\0'; 18 | txtsteamMachineAuth.PasswordChar = '\0'; 19 | txtsteamLoginSecure.PasswordChar = '\0'; 20 | txtSteamparental.PasswordChar = '\0'; 21 | 22 | txtSessionID.Enabled = true; 23 | txtsteamMachineAuth.Enabled = true; 24 | txtsteamLoginSecure.Enabled = true; 25 | txtSteamparental.Enabled = true; 26 | 27 | btnView.Visible = false; 28 | } 29 | 30 | private void frmSettingsAdvanced_Load(object sender, EventArgs e) 31 | { 32 | // Localize Form 33 | btnUpdate.Text = localization.strings.update; 34 | this.Text = localization.strings.auth_data; 35 | ttHelp.SetToolTip(btnView, localization.strings.cookie_warning); 36 | noticeBox.Text = localization.strings.notice; 37 | NoticeUseCookie.Text = localization.strings.notice_usecookie; 38 | NoticeFamilyView.Text = localization.strings.notice_familyview; 39 | 40 | 41 | if (!string.IsNullOrWhiteSpace(Settings.Default.sessionid)) 42 | { 43 | txtSessionID.Text = Settings.Default.sessionid; 44 | txtSessionID.Enabled = false; 45 | } 46 | else 47 | { 48 | txtSessionID.PasswordChar = '\0'; 49 | } 50 | 51 | if (!string.IsNullOrWhiteSpace(Settings.Default.steamLogin)) 52 | { 53 | txtsteamMachineAuth.Text = Settings.Default.steamLogin; 54 | txtsteamMachineAuth.Enabled = false; 55 | } 56 | else 57 | { 58 | txtsteamMachineAuth.PasswordChar = '\0'; 59 | } 60 | 61 | if (!string.IsNullOrWhiteSpace(Settings.Default.steamLoginSecure)) 62 | { 63 | txtsteamLoginSecure.Text = Settings.Default.steamLoginSecure; 64 | txtsteamLoginSecure.Enabled = false; 65 | } 66 | else 67 | { 68 | txtsteamLoginSecure.PasswordChar = '\0'; 69 | } 70 | 71 | if (!string.IsNullOrWhiteSpace(Settings.Default.steamparental)) 72 | { 73 | txtSteamparental.Text=Settings.Default.steamparental; 74 | txtSteamparental.Enabled = false; 75 | } 76 | else 77 | { 78 | txtSteamparental.PasswordChar = '\0'; 79 | } 80 | 81 | if (txtSessionID.Enabled && txtsteamMachineAuth.Enabled && txtsteamLoginSecure.Enabled) 82 | { 83 | btnView.Visible = false; 84 | } 85 | 86 | btnUpdate.Enabled = false; 87 | } 88 | 89 | private void txtSessionID_TextChanged(object sender, EventArgs e) 90 | { 91 | btnUpdate.Enabled = true; 92 | } 93 | 94 | private void txtSteamLogin_TextChanged(object sender, EventArgs e) 95 | { 96 | btnUpdate.Enabled = true; 97 | } 98 | 99 | private void txtSteamParental_TextChanged(object sender, EventArgs e) 100 | { 101 | btnUpdate.Enabled = true; 102 | } 103 | 104 | private void txtSteamparental_TextChanged_1(object sender, EventArgs e) 105 | { 106 | btnUpdate.Enabled = true; 107 | } 108 | 109 | private async Task CheckAndSave() 110 | { 111 | try 112 | { 113 | Settings.Default.sessionid = txtSessionID.Text.Trim(); 114 | Settings.Default.steamMachineAuth = txtsteamMachineAuth.Text.Trim(); 115 | Settings.Default.steamLoginSecure = txtsteamLoginSecure.Text.Trim(); 116 | Settings.Default.myProfileURL = SteamProfile.GetSteamUrl(); 117 | Settings.Default.steamparental = txtSteamparental.Text.Trim(); 118 | 119 | if (await CookieClient.IsLogined()) 120 | { 121 | Settings.Default.Save(); 122 | Close(); 123 | return; 124 | } 125 | } 126 | catch (Exception ex) 127 | { 128 | Logger.Exception(ex, "frmSettingsAdvanced -> CheckAndSave"); 129 | } 130 | 131 | // Invalid cookie data, reset the form 132 | btnUpdate.Text = localization.strings.update; 133 | txtSessionID.Text = ""; 134 | txtsteamMachineAuth.Text = ""; 135 | txtsteamLoginSecure.Text = ""; 136 | txtSteamparental.Text = ""; 137 | txtSessionID.PasswordChar = '\0'; 138 | txtsteamMachineAuth.PasswordChar = '\0'; 139 | txtsteamLoginSecure.PasswordChar = '\0'; 140 | txtSteamparental.PasswordChar = '\0'; 141 | txtSessionID.Enabled = true; 142 | txtsteamMachineAuth.Enabled = true; 143 | txtsteamLoginSecure.Enabled = true; 144 | txtSteamparental.Enabled = true; 145 | txtSessionID.Focus(); 146 | MessageBox.Show(localization.strings.validate_failed); 147 | btnUpdate.Enabled = true; 148 | } 149 | 150 | private async void btnUpdate_Click(object sender, EventArgs e) 151 | { 152 | btnUpdate.Enabled = false; 153 | txtSessionID.Enabled = false; 154 | txtsteamMachineAuth.Enabled = false; 155 | txtsteamLoginSecure.Enabled = false; 156 | txtSteamparental.Enabled = false; 157 | btnUpdate.Text = localization.strings.validating; 158 | await CheckAndSave(); 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmStatistics.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IdleMaster 2 | { 3 | partial class frmStatistics 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmStatistics)); 32 | this.btnOK = new System.Windows.Forms.Button(); 33 | this.lblSessionTime = new System.Windows.Forms.Label(); 34 | this.lblSessionCards = new System.Windows.Forms.Label(); 35 | this.lblTotalCards = new System.Windows.Forms.Label(); 36 | this.lblTotalTime = new System.Windows.Forms.Label(); 37 | this.lblSessionHeader = new System.Windows.Forms.Label(); 38 | this.lblTotalHeader = new System.Windows.Forms.Label(); 39 | this.SuspendLayout(); 40 | // 41 | // btnOK 42 | // 43 | this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 44 | this.btnOK.Location = new System.Drawing.Point(175, 129); 45 | this.btnOK.Name = "btnOK"; 46 | this.btnOK.Size = new System.Drawing.Size(75, 23); 47 | this.btnOK.TabIndex = 0; 48 | this.btnOK.Text = "&OK"; 49 | this.btnOK.UseVisualStyleBackColor = true; 50 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 51 | // 52 | // lblSessionTime 53 | // 54 | this.lblSessionTime.AutoSize = true; 55 | this.lblSessionTime.Location = new System.Drawing.Point(12, 29); 56 | this.lblSessionTime.Name = "lblSessionTime"; 57 | this.lblSessionTime.Size = new System.Drawing.Size(65, 13); 58 | this.lblSessionTime.TabIndex = 1; 59 | this.lblSessionTime.Text = "sessionTime"; 60 | // 61 | // lblSessionCards 62 | // 63 | this.lblSessionCards.AutoSize = true; 64 | this.lblSessionCards.Location = new System.Drawing.Point(12, 44); 65 | this.lblSessionCards.Name = "lblSessionCards"; 66 | this.lblSessionCards.Size = new System.Drawing.Size(69, 13); 67 | this.lblSessionCards.TabIndex = 2; 68 | this.lblSessionCards.Text = "sessionCards"; 69 | // 70 | // lblTotalCards 71 | // 72 | this.lblTotalCards.AutoSize = true; 73 | this.lblTotalCards.Location = new System.Drawing.Point(12, 104); 74 | this.lblTotalCards.Name = "lblTotalCards"; 75 | this.lblTotalCards.Size = new System.Drawing.Size(54, 13); 76 | this.lblTotalCards.TabIndex = 3; 77 | this.lblTotalCards.Text = "totalCards"; 78 | // 79 | // lblTotalTime 80 | // 81 | this.lblTotalTime.AutoSize = true; 82 | this.lblTotalTime.Location = new System.Drawing.Point(12, 89); 83 | this.lblTotalTime.Name = "lblTotalTime"; 84 | this.lblTotalTime.Size = new System.Drawing.Size(50, 13); 85 | this.lblTotalTime.TabIndex = 4; 86 | this.lblTotalTime.Text = "totalTime"; 87 | // 88 | // lblSessionHeader 89 | // 90 | this.lblSessionHeader.AutoSize = true; 91 | this.lblSessionHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 92 | this.lblSessionHeader.Location = new System.Drawing.Point(10, 9); 93 | this.lblSessionHeader.Name = "lblSessionHeader"; 94 | this.lblSessionHeader.Size = new System.Drawing.Size(81, 13); 95 | this.lblSessionHeader.TabIndex = 5; 96 | this.lblSessionHeader.Text = "This session:"; 97 | // 98 | // lblTotalHeader 99 | // 100 | this.lblTotalHeader.AutoSize = true; 101 | this.lblTotalHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 102 | this.lblTotalHeader.Location = new System.Drawing.Point(10, 69); 103 | this.lblTotalHeader.Name = "lblTotalHeader"; 104 | this.lblTotalHeader.Size = new System.Drawing.Size(40, 13); 105 | this.lblTotalHeader.TabIndex = 6; 106 | this.lblTotalHeader.Text = "Total:"; 107 | // 108 | // frmStatistics 109 | // 110 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 111 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 112 | this.ClientSize = new System.Drawing.Size(253, 157); 113 | this.Controls.Add(this.lblTotalHeader); 114 | this.Controls.Add(this.lblSessionHeader); 115 | this.Controls.Add(this.lblTotalTime); 116 | this.Controls.Add(this.lblTotalCards); 117 | this.Controls.Add(this.lblSessionCards); 118 | this.Controls.Add(this.lblSessionTime); 119 | this.Controls.Add(this.btnOK); 120 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 121 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 122 | this.MaximizeBox = false; 123 | this.Name = "frmStatistics"; 124 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 125 | this.Text = "Statistics"; 126 | this.Load += new System.EventHandler(this.frmStatistics_Load); 127 | this.ResumeLayout(false); 128 | this.PerformLayout(); 129 | 130 | } 131 | 132 | #endregion 133 | 134 | private System.Windows.Forms.Button btnOK; 135 | private System.Windows.Forms.Label lblSessionTime; 136 | private System.Windows.Forms.Label lblSessionCards; 137 | private System.Windows.Forms.Label lblTotalCards; 138 | private System.Windows.Forms.Label lblTotalTime; 139 | private System.Windows.Forms.Label lblSessionHeader; 140 | private System.Windows.Forms.Label lblTotalHeader; 141 | } 142 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmStatistics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace IdleMaster 5 | { 6 | public partial class frmStatistics : Form 7 | { 8 | private Statistics statistics; 9 | public frmStatistics(Statistics statistics) 10 | { 11 | InitializeComponent(); 12 | this.statistics = statistics; 13 | } 14 | 15 | private void frmStatistics_Load(object sender, EventArgs e) 16 | { 17 | // Localize Form 18 | this.Text = localization.strings.statistics.Replace("&", ""); 19 | btnOK.Text = localization.strings.accept; 20 | lblSessionHeader.Text = localization.strings.this_session + ":"; 21 | lblTotalHeader.Text = localization.strings.total + ":"; 22 | 23 | TimeSpan sessionMinutesIdled = TimeSpan.FromMinutes(statistics.getSessionMinutesIdled()); 24 | TimeSpan totalMinutesIdled = TimeSpan.FromMinutes(Properties.Settings.Default.totalMinutesIdled); 25 | 26 | int sessionHoursIdled = (sessionMinutesIdled.Days * 24) + sessionMinutesIdled.Hours; 27 | int totalHoursIdled = (totalMinutesIdled.Days * 24) + totalMinutesIdled.Hours; 28 | 29 | //Session 30 | if (sessionHoursIdled > 0) 31 | { 32 | lblSessionTime.Text = String.Format("{0} hour{1}, {2} minute{3} idled", 33 | sessionHoursIdled, 34 | sessionHoursIdled == 1 ? "" : "s", 35 | sessionMinutesIdled.Minutes, 36 | sessionMinutesIdled.Minutes == 1 ? "" : "s"); 37 | } 38 | else 39 | { 40 | lblSessionTime.Text = String.Format("{0} minute{1} idled", 41 | sessionMinutesIdled.Minutes, 42 | sessionMinutesIdled.Minutes == 1 ? "" : "s"); 43 | } 44 | lblSessionCards.Text = statistics.getSessionCardIdled().ToString() + " cards idled"; 45 | 46 | //Total 47 | if (totalHoursIdled > 0) 48 | { 49 | lblTotalTime.Text = String.Format("{0} hour{1}, {2} minute{3} idled", 50 | totalHoursIdled, 51 | totalHoursIdled == 1 ? "" : "s", 52 | totalMinutesIdled.Minutes, 53 | totalMinutesIdled.Minutes == 1 ? "" : "s"); 54 | } 55 | else 56 | { 57 | lblTotalTime.Text = String.Format("{0} minute{1} idled", 58 | totalMinutesIdled.Minutes, 59 | totalMinutesIdled.Minutes == 1 ? "" : "s"); 60 | } 61 | lblTotalCards.Text = Properties.Settings.Default.totalCardIdled.ToString() + " cards idled"; 62 | } 63 | 64 | private void btnOK_Click(object sender, EventArgs e) 65 | { 66 | Close(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmWagaSettings.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IdleMaster 2 | { 3 | partial class frmWagaSettings 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmWagaSettings)); 32 | this.changetimegroupBox = new System.Windows.Forms.GroupBox(); 33 | this.mslabel = new System.Windows.Forms.Label(); 34 | this.timebox = new System.Windows.Forms.TextBox(); 35 | this.changeautonextime = new System.Windows.Forms.Button(); 36 | this.aboutlabel = new System.Windows.Forms.Label(); 37 | this.VersionLabel = new System.Windows.Forms.Label(); 38 | this.changeminruntimegroupBox = new System.Windows.Forms.GroupBox(); 39 | this.changeminruntimelabel = new System.Windows.Forms.Label(); 40 | this.changeminruntimetextBox = new System.Windows.Forms.TextBox(); 41 | this.changeminruntimebutton = new System.Windows.Forms.Button(); 42 | this.changetimegroupBox.SuspendLayout(); 43 | this.changeminruntimegroupBox.SuspendLayout(); 44 | this.SuspendLayout(); 45 | // 46 | // changetimegroupBox 47 | // 48 | this.changetimegroupBox.Controls.Add(this.mslabel); 49 | this.changetimegroupBox.Controls.Add(this.timebox); 50 | this.changetimegroupBox.Controls.Add(this.changeautonextime); 51 | this.changetimegroupBox.Location = new System.Drawing.Point(12, 12); 52 | this.changetimegroupBox.Name = "changetimegroupBox"; 53 | this.changetimegroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); 54 | this.changetimegroupBox.Size = new System.Drawing.Size(523, 68); 55 | this.changetimegroupBox.TabIndex = 8; 56 | this.changetimegroupBox.TabStop = false; 57 | this.changetimegroupBox.Text = "修改自动切换游戏时间间隔"; 58 | // 59 | // mslabel 60 | // 61 | this.mslabel.AutoSize = true; 62 | this.mslabel.Location = new System.Drawing.Point(91, 30); 63 | this.mslabel.Name = "mslabel"; 64 | this.mslabel.Size = new System.Drawing.Size(23, 15); 65 | this.mslabel.TabIndex = 2; 66 | this.mslabel.Text = "ms"; 67 | // 68 | // timebox 69 | // 70 | this.timebox.Location = new System.Drawing.Point(11, 24); 71 | this.timebox.Name = "timebox"; 72 | this.timebox.Size = new System.Drawing.Size(73, 25); 73 | this.timebox.TabIndex = 1; 74 | // 75 | // changeautonextime 76 | // 77 | this.changeautonextime.Location = new System.Drawing.Point(119, 24); 78 | this.changeautonextime.Name = "changeautonextime"; 79 | this.changeautonextime.Size = new System.Drawing.Size(100, 27); 80 | this.changeautonextime.TabIndex = 0; 81 | this.changeautonextime.Text = "确定"; 82 | this.changeautonextime.UseVisualStyleBackColor = true; 83 | this.changeautonextime.Click += new System.EventHandler(this.changeautonextime_Click); 84 | // 85 | // aboutlabel 86 | // 87 | this.aboutlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 88 | this.aboutlabel.AutoSize = true; 89 | this.aboutlabel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 90 | this.aboutlabel.Location = new System.Drawing.Point(12, 174); 91 | this.aboutlabel.Name = "aboutlabel"; 92 | this.aboutlabel.Size = new System.Drawing.Size(199, 20); 93 | this.aboutlabel.TabIndex = 9; 94 | this.aboutlabel.Text = "哇嘎吖噜哒 魔改制作"; 95 | // 96 | // VersionLabel 97 | // 98 | this.VersionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 99 | this.VersionLabel.AutoSize = true; 100 | this.VersionLabel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 101 | this.VersionLabel.Location = new System.Drawing.Point(415, 174); 102 | this.VersionLabel.Name = "VersionLabel"; 103 | this.VersionLabel.Size = new System.Drawing.Size(129, 20); 104 | this.VersionLabel.TabIndex = 10; 105 | this.VersionLabel.Text = "V1.3.1(11.7)"; 106 | // 107 | // changeminruntimegroupBox 108 | // 109 | this.changeminruntimegroupBox.Controls.Add(this.changeminruntimelabel); 110 | this.changeminruntimegroupBox.Controls.Add(this.changeminruntimetextBox); 111 | this.changeminruntimegroupBox.Controls.Add(this.changeminruntimebutton); 112 | this.changeminruntimegroupBox.Location = new System.Drawing.Point(12, 86); 113 | this.changeminruntimegroupBox.Name = "changeminruntimegroupBox"; 114 | this.changeminruntimegroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); 115 | this.changeminruntimegroupBox.Size = new System.Drawing.Size(523, 68); 116 | this.changeminruntimegroupBox.TabIndex = 9; 117 | this.changeminruntimegroupBox.TabStop = false; 118 | this.changeminruntimegroupBox.Text = "修改最小运行时间"; 119 | // 120 | // changeminruntimelabel 121 | // 122 | this.changeminruntimelabel.AutoSize = true; 123 | this.changeminruntimelabel.Location = new System.Drawing.Point(91, 30); 124 | this.changeminruntimelabel.Name = "changeminruntimelabel"; 125 | this.changeminruntimelabel.Size = new System.Drawing.Size(15, 15); 126 | this.changeminruntimelabel.TabIndex = 2; 127 | this.changeminruntimelabel.Text = "h"; 128 | // 129 | // changeminruntimetextBox 130 | // 131 | this.changeminruntimetextBox.Location = new System.Drawing.Point(11, 24); 132 | this.changeminruntimetextBox.Name = "changeminruntimetextBox"; 133 | this.changeminruntimetextBox.Size = new System.Drawing.Size(73, 25); 134 | this.changeminruntimetextBox.TabIndex = 1; 135 | // 136 | // changeminruntimebutton 137 | // 138 | this.changeminruntimebutton.Location = new System.Drawing.Point(119, 24); 139 | this.changeminruntimebutton.Name = "changeminruntimebutton"; 140 | this.changeminruntimebutton.Size = new System.Drawing.Size(100, 27); 141 | this.changeminruntimebutton.TabIndex = 0; 142 | this.changeminruntimebutton.Text = "确定"; 143 | this.changeminruntimebutton.UseVisualStyleBackColor = true; 144 | this.changeminruntimebutton.Click += new System.EventHandler(this.changeminruntimebutton_Click); 145 | // 146 | // frmWagaSettings 147 | // 148 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); 149 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 150 | this.ClientSize = new System.Drawing.Size(556, 203); 151 | this.Controls.Add(this.changeminruntimegroupBox); 152 | this.Controls.Add(this.VersionLabel); 153 | this.Controls.Add(this.aboutlabel); 154 | this.Controls.Add(this.changetimegroupBox); 155 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 156 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 157 | this.MaximizeBox = false; 158 | this.Name = "frmWagaSettings"; 159 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 160 | this.Text = "魔改设置"; 161 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmWagaSettings_FormClosed); 162 | this.Load += new System.EventHandler(this.frmWagaSettings_Load); 163 | this.changetimegroupBox.ResumeLayout(false); 164 | this.changetimegroupBox.PerformLayout(); 165 | this.changeminruntimegroupBox.ResumeLayout(false); 166 | this.changeminruntimegroupBox.PerformLayout(); 167 | this.ResumeLayout(false); 168 | this.PerformLayout(); 169 | 170 | } 171 | 172 | #endregion 173 | 174 | private System.Windows.Forms.GroupBox changetimegroupBox; 175 | private System.Windows.Forms.Label mslabel; 176 | private System.Windows.Forms.TextBox timebox; 177 | private System.Windows.Forms.Button changeautonextime; 178 | private System.Windows.Forms.Label aboutlabel; 179 | private System.Windows.Forms.Label VersionLabel; 180 | private System.Windows.Forms.GroupBox changeminruntimegroupBox; 181 | private System.Windows.Forms.Label changeminruntimelabel; 182 | private System.Windows.Forms.TextBox changeminruntimetextBox; 183 | private System.Windows.Forms.Button changeminruntimebutton; 184 | } 185 | } -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmWagaSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace IdleMaster 13 | { 14 | public partial class frmWagaSettings : Form 15 | { 16 | [DllImport("kernel32")] 17 | private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); 18 | public frmWagaSettings() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | private void changeautonextime_Click(object sender, EventArgs e) 24 | { 25 | try 26 | { 27 | if (timebox.Text == "") 28 | { 29 | MessageBox.Show("请输入正确时间!"); 30 | } 31 | else if (Convert.ToInt32(timebox.Text) > 5000) 32 | { 33 | MessageBox.Show("设置间隔最大为5000ms!"); 34 | timebox.Text = "5000"; 35 | } 36 | else if (Convert.ToInt32(timebox.Text) < 500) 37 | { 38 | MessageBox.Show("设置间隔最小为500ms!"); 39 | timebox.Text = "500"; 40 | } 41 | else 42 | { 43 | try 44 | { 45 | WritePrivateProfileString("AutoNext", "Time", timebox.Text, ".\\Settings.ini"); 46 | MessageBox.Show("设置保存成功!"); 47 | } 48 | catch 49 | { 50 | MessageBox.Show("修改失败!"); 51 | } 52 | } 53 | } 54 | catch 55 | { 56 | MessageBox.Show("请输入正确格式!"); 57 | timebox.Text = ""; 58 | } 59 | } 60 | 61 | private void changeminruntimebutton_Click(object sender, EventArgs e) 62 | { 63 | try 64 | { 65 | if (changeminruntimetextBox.Text == "") 66 | { 67 | MessageBox.Show("请输入正确时间!"); 68 | } 69 | else if (Convert.ToInt32(changeminruntimetextBox.Text) > 100) 70 | { 71 | MessageBox.Show("设置时间最大为100小时!"); 72 | changeminruntimetextBox.Text = "100"; 73 | } 74 | else if (Convert.ToInt32(changeminruntimetextBox.Text) < 0) 75 | { 76 | MessageBox.Show("设置时间最小为0小时!"); 77 | changeminruntimetextBox.Text = "0"; 78 | } 79 | else 80 | { 81 | try 82 | { 83 | WritePrivateProfileString("AutoNext", "MinRuntime", changeminruntimetextBox.Text, ".\\Settings.ini"); 84 | MessageBox.Show("设置保存成功!"); 85 | } 86 | catch 87 | { 88 | MessageBox.Show("修改失败!"); 89 | } 90 | } 91 | } 92 | catch 93 | { 94 | MessageBox.Show("请输入正确格式!"); 95 | changeminruntimetextBox.Text = ""; 96 | } 97 | } 98 | 99 | private void frmWagaSettings_FormClosed(object sender, FormClosedEventArgs e) 100 | { 101 | MessageBox.Show("本页设置需要在文件->重新加载或重启程序后生效!","提示"); 102 | } 103 | 104 | [DllImport("kernel32")] 105 | private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath); 106 | 107 | private void frmWagaSettings_Load(object sender, EventArgs e) 108 | { 109 | try 110 | { 111 | //获取自动下一个间隔时间 112 | StringBuilder temp = new StringBuilder(500); 113 | GetPrivateProfileString("AutoNext", "Time", "500", temp, 500, ".\\Settings.ini"); 114 | if (temp.ToString() == "") 115 | { } 116 | else 117 | { 118 | timebox.Text = temp.ToString(); 119 | } 120 | //获取最小运行时间 121 | temp = new StringBuilder(500); 122 | GetPrivateProfileString("AutoNext", "MinRuntime", "2", temp, 500, ".\\Settings.ini"); 123 | if (temp.ToString() == "") 124 | { } 125 | else 126 | { 127 | changeminruntimetextBox.Text =temp.ToString(); 128 | } 129 | } 130 | catch (Exception ex) 131 | { 132 | MessageBox.Show("程序发生错误,即将退出!\r\n错误信息:" + ex.Message); 133 | System.Environment.Exit(0); 134 | } 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/frmWagaSettings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | AAABAAEAICAAAAAAAACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAgAQAAAAAAAAAAAAAAAEAAAAA 124 | AAAAAAAA////AP7//wDQ+P8Az/f+ANH4/wDQ9/4A0fj+AM/3/wDO9v4A0Pf/AM/2/gDM9P4Azvb/AM31 125 | /gDP9v8AzvX+AMvz/gDM8/4AzfT+AMnx/gDK8v4Ay/L+AMfw/gDG7v0AyPD+AMfv/QDD7P0AxO39AMHr 126 | /QDC6/0Aw+v9AMTs/QC+6P0Avef8AL/o/QC+5/wAwOn9ALrk/AC75fwAvOb8AL3n/QC24fwAuOL8ALnj 127 | /ACy3fsAs977ALXg/AC03/sAtd/7ALfh/ACt2fsArNj6AK7a+wCw2/sAsdv7ALHc+wCp1foArNj7AKvX 128 | +gCs1/oAo9D6AKTR+gCm0voAqNT6AJ7L+QCezPkAn8z5AJ7L+ACgzfkAoc75AJPC9wCVxPgAlsT4AJfF 129 | +ACYxvgAmsf4AJrI+ACbyfkAm8j4AJ3K+QCOvfcAjbz1AI++9wCTwfgAk8L4AJLA9wCTwfcAlcP4AGKS 130 | 0wBjk9QAY5TUAGKS0gBnmNoAZpfYAGWV1gBlltYAZJTVAGSV1QBklNQAY5PTAGma3QBnmNkAZpbXAGWV 131 | 1QBrnN8AapveAGma2wBomNkAZ5fYAGaW1gBsneAAbJ3fAGuc3gBqm9wAaprbAGmZ2gBwoeQAb6DjAG+g 132 | 4gByo+YAcaLlAHOk5wB3qe0AdqfqAH2u8QB7rO4AgbL1AICw8QCDtPYAhLX2AIW19gCCsvAAhLTzAIe3 133 | 9gCIuPYAh7b0AIm49gCJufYAirn2AIm49QCIt/MAjLv3AI289wBsneEAapreAGqa3QBpmdwAaZnbAGiY 134 | 2gBvoeYAbp/kAG2e4gBsnN8Aa5veAGub3QBqmtwAcaLoAG+g5QBvoOQAbp/jAG2d4QBtneAAbJzeAHWn 135 | 7gB0pe0AdKbtAHSl7ABzpOsAcqPpAHKi6ABxoecAcaLnAHGh5gBwoOUAcKHlAG+f4gBunuEAeav1AHiq 136 | 8wB4qvIAd6nxAHeo8AB2p+8AdabtAHWl7AB0peoAc6PpAHOk6QByoucAcqLmAHGh5QBxoeQAeqz1AHmq 137 | 8wB4qfEAdqftAHWm6wB0pOkAc6PnAHKi5QB7rPUAe631AHqr9AB5qvEAeavxAHen7QB3qO0AdqbrAHan 138 | 6wB1puoAdKToAHyt9QB8rvUAe6z0AHqr8gB6rPEAearvAHip7QB9rvUAfa/1AHyt9AB7rPIAe6zxAHqq 139 | 8AB6q/AAeanuAHmq7gB3p+oAfq/1AH2u9AB9rvMAfK3yAHqq7QB/sPUAgLH1AH+w9ACBsvYAgbH1AICw 140 | 8wB+rvAAgrL1AIOz9gCEtPYAeqv1AHio8QDw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// 141 | AAD///8AAAAAAAAAAGSb0uHe4r9uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABy4OXl5eXl5eewAAAAAAAA 142 | AFpnX1wAAAAAAAAAAAAAeeXl5eXJy8nB9Nt6AAAAAGR52MuzpnEAAAAAAAAAAHrl5eXJyVNAMS1Q5dTA 143 | AAAA0tTcWD5Ch51kAAAAAAB55eXlsoYtEQ8QCQgs89RrAKPb7TEJDw8ZRp0AAAAAouXl5bJIGAsVFRUV 144 | FQQs5c8A0vQ5BxUVFREIQWUAAG3n5eWyThMMFRUVFRUVFQg99JzO6h4MFRUVFQwf5JUA0OXl9FgTERUV 145 | FRUVFRUVERiBvMbqHQwVFRUVFRWEaZXl5dSDGAwVFRUVFRUVFRUVC0H1o8E/AxUVFRUMHumSduXl9DQL 146 | FRUVFRUVFRUVFRUOL8l0seU3DQkOCQ5MmGPH5duCGhEVFRUVFRUVFRUVFRIb7rEAmsxLMCctR6lcAL7l 147 | yVQQFRUVFRUVFRUVFRUVERSGdQAAY5Gr0p2SXAAAseXBSQkVFRUVFRUVFRUVFRUVEYquAAAAAAAAAAAA 148 | AABf6NWGFBEVFRUVFRUVFRUVFREXg7EAX3CxnGMAAAAAAACx5cE5BhUVFRUVFRUVFRUVEyfVbJnn1PTV 149 | w5BcAAAAAADH2+orCBUVFRUVFRUVFRUIULhw5cmJPCwwTcVjAAAAAAB41OsuCwwVFRUVFRUVCjHbb9nK 150 | jhoIDhALLdpkAAAAAABw19RQJRALDgwMCQ4166+V5coqCxUVFRUKOZ9fAAAAAABjebTrSTomIyQtV9Z2 151 | AHPb7hsRFRUVFREagJAAAAAAWmdjYnCott3r7LWsZwAAYujbIhMVFRUVFRGMlgAAXHffycK5bQBkZ2Zn 152 | XGiUbFkAsPRDAxUVFRUMHn2YAADI29RWUI7LdAAAAGPT5tTJz20Aeds2DxAMEAlNnmAAdOXbMxALEUWk 153 | AABk2tvJhlHytG0Amc1PMiMrSrtkAAB69EEDFRURDI+VAJnb2zkZEhxNt2QAY5KtfLtqXAAAAHvlIwwV 154 | FRULQJgAevQ9BREVDA5VoQAAAAAAAAAAAAAAxIcUFhUVFQ4ulgC67hsMFRUVDiTaAAAAAAAAAAAAAAC9 155 | ixUVFRUVEDiXAKyHFBYVFRUVEYxjAAAAAAAAAAAAAJx/IAwVFRUGQZMAmvEcERUVFRUMUmEAAAAAAAAA 156 | AAAAAKU/BRERCyV+WQBktzsKFRUVEhjwXAAAAAAAAAAAAAAAZ988GRUsiF0AAACUfygKDA4KRaAAAAAA 157 | AAAAAAAAAAAAX6qFjdFeAAAAAACc70AhKUSnZAAAAAAAAAAAAAAAAAAAAFpbAAAAAAAAAABfl+PimGQA 158 | AAAAAAAAAAAAAP4B///8AP4f+AB4D/AAOAPgABADwAAQAYAAAACAAAAAAAAAAAAAAAAAAAQBAAAGAwAA 159 | B/8AAAQfgAAAB8AAAAPgAAAB8AAAAPgAIADwAGAAwEAQAMA4CACAMAQBgBACA4AQA/+AEAP/gBAB/4AQ 160 | Af/AEAH/wDgD/+B8A//5/gf/ 161 | 162 | 163 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/localization/strings.zh-TW.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 關於(&A) 122 | 123 | 124 | 徽章頁沒有載入,將在 __num__ 秒後重試 125 | 126 | 127 | 黑名單(&B) 128 | 129 | 130 | 將目前遊戲加入黑名單(&B) 131 | 132 | 133 | 卡片剩餘 134 | 135 | 136 | 目前正在遊戲內 137 | 138 | 139 | 離開(&X) 140 | 141 | 142 | 檔案(&F) 143 | 144 | 145 | 遊戲(&G) 146 | 147 | 148 | 遊戲尚有未掉落卡片 149 | 150 | 151 | 說明(&H) 152 | 153 | 154 | 時數 155 | 156 | 157 | 小時 158 | 159 | 160 | Idle Master已經連結至Steam 161 | 162 | 163 | Idle Master尚未連結至Steam 164 | 165 | 166 | 現在開始掉落 167 | 168 | 169 | 掉落結束, 沒有可掉落的卡片 170 | 171 | 172 | 掉落已暫停 173 | 174 | 175 | 正在載入下一個遊戲... 176 | 177 | 178 | 名稱 179 | 180 | 181 | 下一次檢查 182 | 183 | 184 | 不在遊戲中 185 | 186 | 187 | 官方群組(&O) 188 | 189 | 190 | 暫停掉落(&P) 191 | 192 | 193 | 請稍候... 194 | 195 | 196 | 讀取徽章頁 197 | 198 | 199 | 版本發佈說明(&R) 200 | 201 | 202 | 繼續(&R) 203 | 204 | 205 | 設定(&S) 206 | 207 | 208 | 登入身分: 209 | 210 | 211 | 登入 212 | 213 | 214 | 登出 215 | 216 | 217 | 跳過目前遊戲(&S) 218 | 219 | 220 | 正在依您的設定進行排序,請稍候... 221 | 222 | 223 | 統計數據(&S) 224 | 225 | 226 | Steam客戶端狀態已忽略 227 | 228 | 229 | Steam 已停止運行 230 | 231 | 232 | Steam 正在運行 233 | 234 | 235 | 更新遊戲狀態 236 | 237 | 238 | 接受(&A) 239 | 240 | 241 | 添加(&A) 242 | 243 | 244 | 將遊戲加到黑名單 245 | 246 | 247 | 顯示進階身份驗證資訊 248 | 249 | 250 | Idle Master認證資料 251 | 252 | 253 | 取消(&C) 254 | 255 | 256 | 顯示資訊 257 | 258 | [WARNING] 259 | 以上資訊請勿與人分享, 260 | 潛在攻擊者可能會用它登入至您的Steam帳戶。 261 | 262 | 263 | 一般 264 | 265 | 266 | 各遊戲卡片分開掉落 267 | 268 | 269 | Idle Master設定 270 | 271 | 272 | 所有遊戲同時等待掉落2小時,然後再分開進行 273 | 274 | 275 | 卡片掉落行為 276 | 277 | 278 | 掉落順序 279 | 280 | 281 | 忽略Steam用戶端狀態 282 | 283 | 284 | 介面語言 285 | 286 | 287 | 管理Idle Master黑名單 288 | 289 | 290 | 將Idle Master縮小至系統工具列 291 | 292 | 293 | 確認(&O) 294 | 295 | 296 | 預設(字母順序) 297 | 298 | 299 | 優先掉落遊戲卡片數量最少的 300 | 301 | 302 | 優先掉落遊戲卡片數量最多的 303 | 304 | 305 | 優先掉落價值最高的卡片 306 | 307 | 308 | 請登入至Steam帳戶 309 | 310 | 311 | 請重新啟動程式,使語言更改生效 312 | 313 | 314 | Idle Master版本發佈說明 315 | 316 | 317 | 儲存(&S) 318 | 319 | 320 | Idle Master正在儲存您的資訊 321 | 322 | 323 | 顯示已登入Steam帳戶的使用者名字 324 | 325 | 326 | 這次使用期間 327 | 328 | 329 | 總計 330 | 331 | 332 | 更新(&U) 333 | 334 | 335 | 您輸入的資料不是有效的。 請再試一次。 336 | 337 | 338 | 驗證中... 339 | 340 | 341 | 同時對遊戲時間超過2小時的遊戲進行掛機 342 | 343 | 344 | -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/logo1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/IdleMaster/IdleMaster/logo1.ico -------------------------------------------------------------------------------- /IdleMaster/IdleMaster/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Preview/FreeIdleMode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/Preview/FreeIdleMode.jpg -------------------------------------------------------------------------------- /Preview/Preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/Preview/Preview.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IdleMaster-HTTPS-Fix 2 | ## A HTTPS Fixed Version Of Idle Master 3 | ![](Preview/Preview.jpg) 4 | 5 | ## About Idle Master HTTPS Fix 6 | This Project is the HTTPS Fixed version of IdleMaster, From [IdleMaster魔改版](https://github.com/wagayaluda/idle)(It is unusable now). 7 | Idle Master HTTPS Fixed version has repaired many Bugs Since IdleMaster is deprecated. It should work fine till the last Update. 8 | And It uses completely HTTPS to connect to Steamcommunity, So Chinese User with Hosts modified can use it freely without vpn. 9 | 10 | ## About Idle Master 11 | The Original Idle Master is developed by [jshackles](https://github.com/jshackles/idle_master) 12 | This program will determine which of your Steam games still have Steam Trading Card drops remaining, 13 | and will go through each application to simulate you being “in-game” so that cards will drop. 14 | It will check periodically to see if the game you’re idling has card drops remaining. 15 | When only one drop remains, it will start checking more frequently. 16 | When the game you’re idling has no more cards, it’ll move on to the next game. 17 | When no more cards are available, the program will terminate. 18 | **The Original IdleMaster project has been discontinued**, no further bug fixes or changes will be made. 19 | 20 | ## Credits 21 | Idle Master was created by jshackles, based on the original code created by Stumpokapow. 22 | Idle Master was writen in C# using Steamworks.NET and CSteamworks by Riley Labrecque (https://github.com/rlabrecque/CSteamworks), and using open source icons from Open Iconic (https://github.com/iconic/open-iconic). 23 | IdleMaster 魔改版 was modified by 哇嘎吖噜哒, based on the original Idle Master. 24 | IdleMaster HTTPS Fix was modified by JackMyth, based on IdleMaster 魔改版. 25 | 26 | License 27 | ------- 28 | 29 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. A copy of the GNU General Public License can be found at http://www.gnu.org/licenses/. For your convenience, a copy of this license is included. 30 | -------------------------------------------------------------------------------- /Steamworks.NET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/Steamworks.NET.dll -------------------------------------------------------------------------------- /setup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/setup.exe -------------------------------------------------------------------------------- /steam-idle Source/steam-idle.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "steam-idle", "steam-idle\steam-idle.csproj", "{E0E49AFD-1101-4815-A1F1-01F65D4D3306}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E0E49AFD-1101-4815-A1F1-01F65D4D3306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E0E49AFD-1101-4815-A1F1-01F65D4D3306}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E0E49AFD-1101-4815-A1F1-01F65D4D3306}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E0E49AFD-1101-4815-A1F1-01F65D4D3306}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Fakes/Steamworks.NET.fakes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/steam-idle Source/steam-idle/Fakes/Steamworks.NET.fakes -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using Steamworks; 7 | 8 | namespace steam_idle 9 | { 10 | 11 | static class Program 12 | { 13 | 14 | [System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize", ExactSpelling = true, CharSet = 15 | System.Runtime.InteropServices.CharSet.Ansi, SetLastError = true)] 16 | private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize); 17 | 18 | 19 | 20 | [STAThread] 21 | static void Main(string[] args) 22 | { 23 | try 24 | { 25 | long appId; 26 | if (args.Length == 0) 27 | { 28 | Application.EnableVisualStyles(); 29 | SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1); 30 | Application.Run(new frmMain()); 31 | } 32 | else 33 | { 34 | appId = long.Parse(args[0]); 35 | Environment.SetEnvironmentVariable("SteamAppId", appId.ToString()); 36 | if (!SteamAPI.Init()) 37 | { 38 | return; 39 | } 40 | SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1); 41 | Application.Run(); 42 | return; 43 | } 44 | } 45 | catch(Exception ex) 46 | { 47 | MessageBox.Show(ex.Message); 48 | return; 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("steam-idle")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("steam-idle")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("95f5c803-be44-47da-9eea-46e6b2fd8ef3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace steam_idle.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("steam_idle.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace steam_idle.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/frmMain.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace steam_idle 2 | { 3 | partial class frmMain 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain)); 32 | this.button1 = new System.Windows.Forms.Button(); 33 | this.textBox1 = new System.Windows.Forms.TextBox(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.panel1 = new System.Windows.Forms.Panel(); 36 | this.picApp = new System.Windows.Forms.PictureBox(); 37 | this.panel1.SuspendLayout(); 38 | ((System.ComponentModel.ISupportInitialize)(this.picApp)).BeginInit(); 39 | this.SuspendLayout(); 40 | // 41 | // button1 42 | // 43 | this.button1.Location = new System.Drawing.Point(199, 38); 44 | this.button1.Name = "button1"; 45 | this.button1.Size = new System.Drawing.Size(56, 24); 46 | this.button1.TabIndex = 1; 47 | this.button1.Text = "挂!"; 48 | this.button1.UseVisualStyleBackColor = true; 49 | this.button1.Click += new System.EventHandler(this.button1_Click); 50 | // 51 | // textBox1 52 | // 53 | this.textBox1.Location = new System.Drawing.Point(56, 38); 54 | this.textBox1.Name = "textBox1"; 55 | this.textBox1.Size = new System.Drawing.Size(137, 21); 56 | this.textBox1.TabIndex = 2; 57 | // 58 | // label1 59 | // 60 | this.label1.AutoSize = true; 61 | this.label1.Location = new System.Drawing.Point(9, 44); 62 | this.label1.Name = "label1"; 63 | this.label1.Size = new System.Drawing.Size(41, 12); 64 | this.label1.TabIndex = 3; 65 | this.label1.Text = "AppID:"; 66 | // 67 | // panel1 68 | // 69 | this.panel1.Controls.Add(this.button1); 70 | this.panel1.Controls.Add(this.label1); 71 | this.panel1.Controls.Add(this.textBox1); 72 | this.panel1.Location = new System.Drawing.Point(12, 14); 73 | this.panel1.Name = "panel1"; 74 | this.panel1.Size = new System.Drawing.Size(267, 100); 75 | this.panel1.TabIndex = 4; 76 | // 77 | // picApp 78 | // 79 | this.picApp.Dock = System.Windows.Forms.DockStyle.Fill; 80 | this.picApp.Location = new System.Drawing.Point(0, 0); 81 | this.picApp.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); 82 | this.picApp.Name = "picApp"; 83 | this.picApp.Size = new System.Drawing.Size(291, 126); 84 | this.picApp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 85 | this.picApp.TabIndex = 0; 86 | this.picApp.TabStop = false; 87 | // 88 | // frmMain 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.ClientSize = new System.Drawing.Size(291, 126); 93 | this.Controls.Add(this.panel1); 94 | this.Controls.Add(this.picApp); 95 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 96 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 97 | this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); 98 | this.MaximizeBox = false; 99 | this.Name = "frmMain"; 100 | this.Text = "输入游戏的AppId"; 101 | this.panel1.ResumeLayout(false); 102 | this.panel1.PerformLayout(); 103 | ((System.ComponentModel.ISupportInitialize)(this.picApp)).EndInit(); 104 | this.ResumeLayout(false); 105 | 106 | } 107 | 108 | #endregion 109 | 110 | private System.Windows.Forms.PictureBox picApp; 111 | private System.Windows.Forms.Button button1; 112 | private System.Windows.Forms.TextBox textBox1; 113 | private System.Windows.Forms.Label label1; 114 | private System.Windows.Forms.Panel panel1; 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/frmMain.cs: -------------------------------------------------------------------------------- 1 | using Steamworks; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace steam_idle 13 | { 14 | public partial class frmMain : Form 15 | { 16 | public frmMain() 17 | { 18 | InitializeComponent(); 19 | System.Net.ServicePointManager.ServerCertificateValidationCallback += 20 | delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, 21 | System.Security.Cryptography.X509Certificates.X509Chain chain, 22 | System.Net.Security.SslPolicyErrors sslPolicyErrors) 23 | { 24 | return true; // **** Always accept 25 | }; 26 | } 27 | 28 | 29 | private void button1_Click(object sender, EventArgs e) 30 | { 31 | long appId = long.Parse(textBox1.Text); 32 | Environment.SetEnvironmentVariable("SteamAppId", appId.ToString()); 33 | if (!SteamAPI.Init()) 34 | { 35 | return; 36 | } 37 | panel1.Hide(); 38 | this.Text = "游戏中..."; 39 | picApp.Load("https://cdn.akamai.steamstatic.com/steam/apps/" + appId.ToString() + "/header_292x136.jpg"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jack-Myth/IdleMaster-HTTPS-Fix/78b759ff53fe17a86df706bb7a804c558bf3145e/steam-idle Source/steam-idle/icon.ico -------------------------------------------------------------------------------- /steam-idle Source/steam-idle/steam-idle.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E0E49AFD-1101-4815-A1F1-01F65D4D3306} 8 | WinExe 9 | Properties 10 | steam_idle 11 | steam-idle 12 | v4.0 13 | 512 14 | 15 | 16 | x86 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | icon.ico 36 | 37 | 38 | 39 | False 40 | 41 | 42 | ..\..\Steamworks.NET.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Form 58 | 59 | 60 | frmMain.cs 61 | 62 | 63 | 64 | 65 | frmMain.cs 66 | 67 | 68 | ResXFileCodeGenerator 69 | Resources.Designer.cs 70 | Designer 71 | 72 | 73 | True 74 | Resources.resx 75 | True 76 | 77 | 78 | 79 | SettingsSingleFileGenerator 80 | Settings.Designer.cs 81 | 82 | 83 | True 84 | Settings.settings 85 | True 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 102 | --------------------------------------------------------------------------------