├── wowthing-sync.suo ├── WoWthing Sync ├── Resources │ ├── angry.ico │ └── laughing.ico ├── packages.config ├── WoWthing Sync.csproj.user ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.settings │ ├── Resources.Designer.cs │ ├── Settings.Designer.cs │ └── Resources.resx ├── CompressedContent.cs ├── app.config ├── SyncForm.resx ├── WoWthing Sync.csproj ├── SyncForm.Designer.cs └── SyncForm.cs ├── README.md ├── wowthing-sync.sln ├── LICENSE └── .gitignore /wowthing-sync.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThingEngineering/wowthing-sync/HEAD/wowthing-sync.suo -------------------------------------------------------------------------------- /WoWthing Sync/Resources/angry.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThingEngineering/wowthing-sync/HEAD/WoWthing Sync/Resources/angry.ico -------------------------------------------------------------------------------- /WoWthing Sync/Resources/laughing.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThingEngineering/wowthing-sync/HEAD/WoWthing Sync/Resources/laughing.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | wowthing-sync 2 | ============= 3 | 4 | Client to automatically upload WoWthing_Collector data files. It's written in C# using Visual Studio 2010, 5 | I have no idea how easy/difficult it will be to compile yourself. I make no claims about my ability to write 6 | competent C# code. 7 | -------------------------------------------------------------------------------- /WoWthing Sync/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WoWthing Sync/WoWthing Sync.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ShowAllFiles 5 | publish\ 6 | 7 | 8 | 9 | 10 | 11 | en-US 12 | false 13 | 14 | -------------------------------------------------------------------------------- /WoWthing Sync/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Windows.Forms; 6 | 7 | namespace WoWthing_Sync 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | #if DEBUG 18 | // dev has an invalid cert, ignore it in debug builds 19 | ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; 20 | #endif 21 | 22 | Application.EnableVisualStyles(); 23 | Application.SetCompatibleTextRenderingDefault(false); 24 | Application.Run(new SyncForm()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /wowthing-sync.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WoWthing Sync", "WoWthing Sync\WoWthing Sync.csproj", "{855B8C77-2852-4AAB-9CC5-1EDF485097A1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {855B8C77-2852-4AAB-9CC5-1EDF485097A1}.Debug|x86.ActiveCfg = Debug|x86 13 | {855B8C77-2852-4AAB-9CC5-1EDF485097A1}.Debug|x86.Build.0 = Debug|x86 14 | {855B8C77-2852-4AAB-9CC5-1EDF485097A1}.Release|x86.ActiveCfg = Release|x86 15 | {855B8C77-2852-4AAB-9CC5-1EDF485097A1}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Freddie 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /WoWthing Sync/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("WoWthing Sync")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WoWthing Sync")] 13 | [assembly: AssemblyCopyright("Copyright © Freddie 2015-2022")] 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("703aa41f-6a76-47fb-8199-95ba972927a8")] 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("0.6.3.0")] 36 | [assembly: AssemblyFileVersion("0.6.3.0")] 37 | -------------------------------------------------------------------------------- /WoWthing Sync/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 7 | 8 | 9 | 0 10 | 11 | 12 | 0 13 | 14 | 15 | 16 | 17 | 18 | True 19 | 20 | 21 | 22 | 23 | 24 | False 25 | 26 | 27 | False 28 | 29 | 30 | False 31 | 32 | 33 | -------------------------------------------------------------------------------- /WoWthing Sync/CompressedContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.IO.Compression; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Net.Http; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace WoWthing_Sync 12 | { 13 | // https://programmer.help/blogs/httpclient-and-aps.net-web-api-compression-and-decompression-of-request-content.html 14 | public class CompressedContent : HttpContent 15 | { 16 | private readonly HttpContent _originalContent; 17 | 18 | public CompressedContent(HttpContent content) 19 | { 20 | if (content == null) 21 | { 22 | throw new ArgumentNullException(nameof(content)); 23 | } 24 | 25 | _originalContent = content; 26 | 27 | foreach (KeyValuePair> header in _originalContent.Headers) 28 | { 29 | Headers.TryAddWithoutValidation(header.Key, header.Value); 30 | } 31 | 32 | Headers.ContentEncoding.Add("gzip"); 33 | } 34 | 35 | protected override bool TryComputeLength(out long length) 36 | { 37 | length = -1; 38 | return false; 39 | } 40 | 41 | protected async override Task SerializeToStreamAsync(Stream stream, TransportContext context) 42 | { 43 | using (var gzipStream = new GZipStream(stream, CompressionMode.Compress, leaveOpen: true)) 44 | { 45 | await _originalContent.CopyToAsync(gzipStream); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WoWthing Sync/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 29 | 30 | 31 | True 32 | 33 | 34 | 35 | 36 | 37 | False 38 | 39 | 40 | False 41 | 42 | 43 | False 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /WoWthing Sync/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 WoWthing_Sync.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", "17.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("WoWthing_Sync.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 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 65 | /// 66 | internal static System.Drawing.Icon ActiveIcon { 67 | get { 68 | object obj = ResourceManager.GetObject("ActiveIcon", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 75 | /// 76 | internal static System.Drawing.Icon PausedIcon { 77 | get { 78 | object obj = ResourceManager.GetObject("PausedIcon", resourceCulture); 79 | return ((System.Drawing.Icon)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /WoWthing Sync/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 WoWthing_Sync.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.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("0")] 29 | public double WindowX { 30 | get { 31 | return ((double)(this["WindowX"])); 32 | } 33 | set { 34 | this["WindowX"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 41 | public double WindowY { 42 | get { 43 | return ((double)(this["WindowY"])); 44 | } 45 | set { 46 | this["WindowY"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 53 | public double WindowH { 54 | get { 55 | return ((double)(this["WindowH"])); 56 | } 57 | set { 58 | this["WindowH"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("")] 65 | public string WatchFolder { 66 | get { 67 | return ((string)(this["WatchFolder"])); 68 | } 69 | set { 70 | this["WatchFolder"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 77 | public bool UpgradeRequired { 78 | get { 79 | return ((bool)(this["UpgradeRequired"])); 80 | } 81 | set { 82 | this["UpgradeRequired"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("")] 89 | public string ApiKey { 90 | get { 91 | return ((string)(this["ApiKey"])); 92 | } 93 | set { 94 | this["ApiKey"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 101 | public bool StartMinimized { 102 | get { 103 | return ((bool)(this["StartMinimized"])); 104 | } 105 | set { 106 | this["StartMinimized"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 113 | public bool StartOnStartup { 114 | get { 115 | return ((bool)(this["StartOnStartup"])); 116 | } 117 | set { 118 | this["StartOnStartup"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 125 | public bool CloseMinimizes { 126 | get { 127 | return ((bool)(this["CloseMinimizes"])); 128 | } 129 | set { 130 | this["CloseMinimizes"] = value; 131 | } 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /WoWthing Sync/SyncForm.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 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /WoWthing Sync/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\laughing.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\angry.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /.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 | 56 | # StyleCop 57 | StyleCopReport.xml 58 | 59 | # Files built by Visual Studio 60 | *_i.c 61 | *_p.c 62 | *_i.h 63 | *.ilk 64 | *.meta 65 | *.obj 66 | *.iobj 67 | *.pch 68 | *.pdb 69 | *.ipdb 70 | *.pgc 71 | *.pgd 72 | *.rsp 73 | *.sbr 74 | *.tlb 75 | *.tli 76 | *.tlh 77 | *.tmp 78 | *.tmp_proj 79 | *.log 80 | *.vspscc 81 | *.vssscc 82 | .builds 83 | *.pidb 84 | *.svclog 85 | *.scc 86 | 87 | # Chutzpah Test files 88 | _Chutzpah* 89 | 90 | # Visual C++ cache files 91 | ipch/ 92 | *.aps 93 | *.ncb 94 | *.opendb 95 | *.opensdf 96 | *.sdf 97 | *.cachefile 98 | *.VC.db 99 | *.VC.VC.opendb 100 | 101 | # Visual Studio profiler 102 | *.psess 103 | *.vsp 104 | *.vspx 105 | *.sap 106 | 107 | # Visual Studio Trace Files 108 | *.e2e 109 | 110 | # TFS 2012 Local Workspace 111 | $tf/ 112 | 113 | # Guidance Automation Toolkit 114 | *.gpState 115 | 116 | # ReSharper is a .NET coding add-in 117 | _ReSharper*/ 118 | *.[Rr]e[Ss]harper 119 | *.DotSettings.user 120 | 121 | # JustCode is a .NET coding add-in 122 | .JustCode 123 | 124 | # TeamCity is a build add-in 125 | _TeamCity* 126 | 127 | # DotCover is a Code Coverage Tool 128 | *.dotCover 129 | 130 | # AxoCover is a Code Coverage Tool 131 | .axoCover/* 132 | !.axoCover/settings.json 133 | 134 | # Visual Studio code coverage results 135 | *.coverage 136 | *.coveragexml 137 | 138 | # NCrunch 139 | _NCrunch_* 140 | .*crunch*.local.xml 141 | nCrunchTemp_* 142 | 143 | # MightyMoose 144 | *.mm.* 145 | AutoTest.Net/ 146 | 147 | # Web workbench (sass) 148 | .sass-cache/ 149 | 150 | # Installshield output folder 151 | [Ee]xpress/ 152 | 153 | # DocProject is a documentation generator add-in 154 | DocProject/buildhelp/ 155 | DocProject/Help/*.HxT 156 | DocProject/Help/*.HxC 157 | DocProject/Help/*.hhc 158 | DocProject/Help/*.hhk 159 | DocProject/Help/*.hhp 160 | DocProject/Help/Html2 161 | DocProject/Help/html 162 | 163 | # Click-Once directory 164 | publish/ 165 | 166 | # Publish Web Output 167 | *.[Pp]ublish.xml 168 | *.azurePubxml 169 | # Note: Comment the next line if you want to checkin your web deploy settings, 170 | # but database connection strings (with potential passwords) will be unencrypted 171 | *.pubxml 172 | *.publishproj 173 | 174 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 175 | # checkin your Azure Web App publish settings, but sensitive information contained 176 | # in these scripts will be unencrypted 177 | PublishScripts/ 178 | 179 | # NuGet Packages 180 | *.nupkg 181 | # The packages folder can be ignored because of Package Restore 182 | **/[Pp]ackages/* 183 | # except build/, which is used as an MSBuild target. 184 | !**/[Pp]ackages/build/ 185 | # Uncomment if necessary however generally it will be regenerated when needed 186 | #!**/[Pp]ackages/repositories.config 187 | # NuGet v3's project.json files produces more ignorable files 188 | *.nuget.props 189 | *.nuget.targets 190 | 191 | # Microsoft Azure Build Output 192 | csx/ 193 | *.build.csdef 194 | 195 | # Microsoft Azure Emulator 196 | ecf/ 197 | rcf/ 198 | 199 | # Windows Store app package directories and files 200 | AppPackages/ 201 | BundleArtifacts/ 202 | Package.StoreAssociation.xml 203 | _pkginfo.txt 204 | *.appx 205 | 206 | # Visual Studio cache files 207 | # files ending in .cache can be ignored 208 | *.[Cc]ache 209 | # but keep track of directories ending in .cache 210 | !*.[Cc]ache/ 211 | 212 | # Others 213 | ClientBin/ 214 | ~$* 215 | *~ 216 | *.dbmdl 217 | *.dbproj.schemaview 218 | *.jfm 219 | *.pfx 220 | *.publishsettings 221 | orleans.codegen.cs 222 | 223 | # Including strong name files can present a security risk 224 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 225 | #*.snk 226 | 227 | # Since there are multiple workflows, uncomment next line to ignore bower_components 228 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 229 | #bower_components/ 230 | 231 | # RIA/Silverlight projects 232 | Generated_Code/ 233 | 234 | # Backup & report files from converting an old project file 235 | # to a newer Visual Studio version. Backup files are not needed, 236 | # because we have git ;-) 237 | _UpgradeReport_Files/ 238 | Backup*/ 239 | UpgradeLog*.XML 240 | UpgradeLog*.htm 241 | ServiceFabricBackup/ 242 | *.rptproj.bak 243 | 244 | # SQL Server files 245 | *.mdf 246 | *.ldf 247 | *.ndf 248 | 249 | # Business Intelligence projects 250 | *.rdl.data 251 | *.bim.layout 252 | *.bim_*.settings 253 | *.rptproj.rsuser 254 | 255 | # Microsoft Fakes 256 | FakesAssemblies/ 257 | 258 | # GhostDoc plugin setting file 259 | *.GhostDoc.xml 260 | 261 | # Node.js Tools for Visual Studio 262 | .ntvs_analysis.dat 263 | node_modules/ 264 | 265 | # Visual Studio 6 build log 266 | *.plg 267 | 268 | # Visual Studio 6 workspace options file 269 | *.opt 270 | 271 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 272 | *.vbw 273 | 274 | # Visual Studio LightSwitch build output 275 | **/*.HTMLClient/GeneratedArtifacts 276 | **/*.DesktopClient/GeneratedArtifacts 277 | **/*.DesktopClient/ModelManifest.xml 278 | **/*.Server/GeneratedArtifacts 279 | **/*.Server/ModelManifest.xml 280 | _Pvt_Extensions 281 | 282 | # Paket dependency manager 283 | .paket/paket.exe 284 | paket-files/ 285 | 286 | # FAKE - F# Make 287 | .fake/ 288 | 289 | # JetBrains Rider 290 | .idea/ 291 | *.sln.iml 292 | 293 | # CodeRush 294 | .cr/ 295 | 296 | # Python Tools for Visual Studio (PTVS) 297 | __pycache__/ 298 | *.pyc 299 | 300 | # Cake - Uncomment if you are using it 301 | # tools/** 302 | # !tools/packages.config 303 | 304 | # Tabs Studio 305 | *.tss 306 | 307 | # Telerik's JustMock configuration file 308 | *.jmconfig 309 | 310 | # BizTalk build output 311 | *.btp.cs 312 | *.btm.cs 313 | *.odx.cs 314 | *.xsd.cs 315 | 316 | # OpenCover UI analysis results 317 | OpenCover/ 318 | 319 | # Azure Stream Analytics local run output 320 | ASALocalRun/ 321 | 322 | # MSBuild Binary and Structured Log 323 | *.binlog 324 | 325 | # NVidia Nsight GPU debugger configuration file 326 | *.nvuser 327 | 328 | # MFractors (Xamarin productivity tool) working folder 329 | .mfractor/ 330 | -------------------------------------------------------------------------------- /WoWthing Sync/WoWthing Sync.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {855B8C77-2852-4AAB-9CC5-1EDF485097A1} 9 | WinExe 10 | Properties 11 | WoWthing_Sync 12 | WoWthing Sync 13 | v4.6.1 14 | 15 | 16 | 512 17 | publish\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 1.0.0.%2a 29 | false 30 | false 31 | true 32 | 33 | 34 | 35 | 36 | x86 37 | true 38 | full 39 | false 40 | bin\Debug\ 41 | DEBUG;TRACE 42 | prompt 43 | 4 44 | false 45 | 46 | 47 | AnyCPU 48 | pdbonly 49 | true 50 | bin\Release\ 51 | TRACE 52 | prompt 53 | 4 54 | false 55 | 56 | 57 | Resources\laughing.ico 58 | 59 | 60 | 61 | ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll 62 | 63 | 64 | 65 | 66 | 67 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll 68 | 69 | 70 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Form 86 | 87 | 88 | SyncForm.cs 89 | 90 | 91 | 92 | 93 | SyncForm.cs 94 | 95 | 96 | ResXFileCodeGenerator 97 | Resources.Designer.cs 98 | Designer 99 | 100 | 101 | True 102 | Resources.resx 103 | True 104 | 105 | 106 | 107 | 108 | SettingsSingleFileGenerator 109 | Settings.Designer.cs 110 | 111 | 112 | True 113 | Settings.settings 114 | True 115 | 116 | 117 | 118 | 119 | False 120 | Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 121 | true 122 | 123 | 124 | False 125 | .NET Framework 3.5 SP1 126 | false 127 | 128 | 129 | False 130 | Windows Installer 4.5 131 | true 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 145 | 146 | 147 | 148 | 155 | -------------------------------------------------------------------------------- /WoWthing Sync/SyncForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WoWthing_Sync 2 | { 3 | partial class SyncForm 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 | this.components = new System.ComponentModel.Container(); 32 | this.textLog = new System.Windows.Forms.TextBox(); 33 | this.textFolder = new System.Windows.Forms.TextBox(); 34 | this.btnChooseFolder = new System.Windows.Forms.Button(); 35 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 36 | this.checkCloseMinimizes = new System.Windows.Forms.CheckBox(); 37 | this.checkStartOnStartup = new System.Windows.Forms.CheckBox(); 38 | this.checkStartMinimized = new System.Windows.Forms.CheckBox(); 39 | this.textApiKey = new System.Windows.Forms.TextBox(); 40 | this.label1 = new System.Windows.Forms.Label(); 41 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 42 | this.btnManualUpload = new System.Windows.Forms.Button(); 43 | this.textStatus = new System.Windows.Forms.TextBox(); 44 | this.btnStart = new System.Windows.Forms.Button(); 45 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 46 | this.groupBox2.SuspendLayout(); 47 | this.groupBox1.SuspendLayout(); 48 | this.SuspendLayout(); 49 | // 50 | // textLog 51 | // 52 | this.textLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | | System.Windows.Forms.AnchorStyles.Left) 54 | | System.Windows.Forms.AnchorStyles.Right))); 55 | this.textLog.BackColor = System.Drawing.SystemColors.ControlLightLight; 56 | this.textLog.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 57 | this.textLog.Location = new System.Drawing.Point(10, 198); 58 | this.textLog.Multiline = true; 59 | this.textLog.Name = "textLog"; 60 | this.textLog.ReadOnly = true; 61 | this.textLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 62 | this.textLog.Size = new System.Drawing.Size(393, 186); 63 | this.textLog.TabIndex = 4; 64 | this.textLog.TabStop = false; 65 | // 66 | // textFolder 67 | // 68 | this.textFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 69 | | System.Windows.Forms.AnchorStyles.Right))); 70 | this.textFolder.BackColor = System.Drawing.SystemColors.Control; 71 | this.textFolder.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 72 | this.textFolder.Location = new System.Drawing.Point(122, 20); 73 | this.textFolder.Name = "textFolder"; 74 | this.textFolder.ReadOnly = true; 75 | this.textFolder.Size = new System.Drawing.Size(263, 25); 76 | this.textFolder.TabIndex = 1; 77 | this.textFolder.TabStop = false; 78 | // 79 | // btnChooseFolder 80 | // 81 | this.btnChooseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 82 | | System.Windows.Forms.AnchorStyles.Right))); 83 | this.btnChooseFolder.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 84 | this.btnChooseFolder.Location = new System.Drawing.Point(5, 19); 85 | this.btnChooseFolder.Name = "btnChooseFolder"; 86 | this.btnChooseFolder.Size = new System.Drawing.Size(109, 26); 87 | this.btnChooseFolder.TabIndex = 3; 88 | this.btnChooseFolder.Text = "Select Folder..."; 89 | this.btnChooseFolder.UseVisualStyleBackColor = true; 90 | this.btnChooseFolder.Click += new System.EventHandler(this.btnChooseFolder_Click); 91 | // 92 | // groupBox2 93 | // 94 | this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 95 | | System.Windows.Forms.AnchorStyles.Right))); 96 | this.groupBox2.Controls.Add(this.checkCloseMinimizes); 97 | this.groupBox2.Controls.Add(this.checkStartOnStartup); 98 | this.groupBox2.Controls.Add(this.checkStartMinimized); 99 | this.groupBox2.Controls.Add(this.btnChooseFolder); 100 | this.groupBox2.Controls.Add(this.textFolder); 101 | this.groupBox2.Controls.Add(this.textApiKey); 102 | this.groupBox2.Controls.Add(this.label1); 103 | this.groupBox2.Location = new System.Drawing.Point(10, 10); 104 | this.groupBox2.Name = "groupBox2"; 105 | this.groupBox2.Size = new System.Drawing.Size(394, 123); 106 | this.groupBox2.TabIndex = 4; 107 | this.groupBox2.TabStop = false; 108 | this.groupBox2.Text = "Settings"; 109 | // 110 | // checkCloseMinimizes 111 | // 112 | this.checkCloseMinimizes.AutoSize = true; 113 | this.checkCloseMinimizes.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 114 | this.checkCloseMinimizes.Location = new System.Drawing.Point(274, 91); 115 | this.checkCloseMinimizes.Name = "checkCloseMinimizes"; 116 | this.checkCloseMinimizes.Size = new System.Drawing.Size(120, 21); 117 | this.checkCloseMinimizes.TabIndex = 6; 118 | this.checkCloseMinimizes.Text = "Close minimizes"; 119 | this.checkCloseMinimizes.UseVisualStyleBackColor = true; 120 | this.checkCloseMinimizes.CheckedChanged += new System.EventHandler(this.checkCloseMinimizes_CheckedChanged); 121 | // 122 | // checkStartOnStartup 123 | // 124 | this.checkStartOnStartup.AutoSize = true; 125 | this.checkStartOnStartup.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 126 | this.checkStartOnStartup.Location = new System.Drawing.Point(130, 91); 127 | this.checkStartOnStartup.Name = "checkStartOnStartup"; 128 | this.checkStartOnStartup.Size = new System.Drawing.Size(138, 21); 129 | this.checkStartOnStartup.TabIndex = 5; 130 | this.checkStartOnStartup.Text = "Start with Windows"; 131 | this.checkStartOnStartup.UseVisualStyleBackColor = true; 132 | this.checkStartOnStartup.CheckedChanged += new System.EventHandler(this.checkStartOnStartup_CheckedChanged); 133 | // 134 | // checkStartMinimized 135 | // 136 | this.checkStartMinimized.AutoSize = true; 137 | this.checkStartMinimized.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 138 | this.checkStartMinimized.Location = new System.Drawing.Point(7, 91); 139 | this.checkStartMinimized.Name = "checkStartMinimized"; 140 | this.checkStartMinimized.Size = new System.Drawing.Size(117, 21); 141 | this.checkStartMinimized.TabIndex = 4; 142 | this.checkStartMinimized.Text = "Start minimized"; 143 | this.checkStartMinimized.UseVisualStyleBackColor = true; 144 | this.checkStartMinimized.CheckedChanged += new System.EventHandler(this.checkStartMinimized_CheckedChanged); 145 | // 146 | // textApiKey 147 | // 148 | this.textApiKey.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 149 | this.textApiKey.Location = new System.Drawing.Point(122, 50); 150 | this.textApiKey.Name = "textApiKey"; 151 | this.textApiKey.PasswordChar = '*'; 152 | this.textApiKey.Size = new System.Drawing.Size(263, 25); 153 | this.textApiKey.TabIndex = 1; 154 | this.textApiKey.TextChanged += new System.EventHandler(this.textApiKey_TextChanged); 155 | // 156 | // label1 157 | // 158 | this.label1.AutoSize = true; 159 | this.label1.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 160 | this.label1.Location = new System.Drawing.Point(63, 53); 161 | this.label1.Name = "label1"; 162 | this.label1.Size = new System.Drawing.Size(51, 17); 163 | this.label1.TabIndex = 0; 164 | this.label1.Text = "API Key"; 165 | // 166 | // groupBox1 167 | // 168 | this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 169 | | System.Windows.Forms.AnchorStyles.Right))); 170 | this.groupBox1.Controls.Add(this.btnManualUpload); 171 | this.groupBox1.Controls.Add(this.textStatus); 172 | this.groupBox1.Controls.Add(this.btnStart); 173 | this.groupBox1.Location = new System.Drawing.Point(10, 139); 174 | this.groupBox1.Name = "groupBox1"; 175 | this.groupBox1.Size = new System.Drawing.Size(393, 53); 176 | this.groupBox1.TabIndex = 5; 177 | this.groupBox1.TabStop = false; 178 | this.groupBox1.Text = "Status"; 179 | // 180 | // btnManualUpload 181 | // 182 | this.btnManualUpload.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 183 | this.btnManualUpload.Location = new System.Drawing.Point(260, 19); 184 | this.btnManualUpload.Name = "btnManualUpload"; 185 | this.btnManualUpload.Size = new System.Drawing.Size(127, 26); 186 | this.btnManualUpload.TabIndex = 1; 187 | this.btnManualUpload.Text = "Manual Upload"; 188 | this.btnManualUpload.UseVisualStyleBackColor = true; 189 | this.btnManualUpload.Click += new System.EventHandler(this.btnManualUpload_Click); 190 | // 191 | // textStatus 192 | // 193 | this.textStatus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 194 | this.textStatus.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 195 | this.textStatus.Location = new System.Drawing.Point(6, 19); 196 | this.textStatus.Name = "textStatus"; 197 | this.textStatus.ReadOnly = true; 198 | this.textStatus.Size = new System.Drawing.Size(70, 26); 199 | this.textStatus.TabIndex = 0; 200 | this.textStatus.Text = "PAUSED"; 201 | this.textStatus.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 202 | // 203 | // btnStart 204 | // 205 | this.btnStart.Enabled = false; 206 | this.btnStart.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 207 | this.btnStart.Location = new System.Drawing.Point(82, 19); 208 | this.btnStart.Name = "btnStart"; 209 | this.btnStart.Size = new System.Drawing.Size(89, 26); 210 | this.btnStart.TabIndex = 1; 211 | this.btnStart.Text = "Start"; 212 | this.btnStart.UseVisualStyleBackColor = true; 213 | this.btnStart.Click += new System.EventHandler(this.btnStart_Click); 214 | // 215 | // notifyIcon 216 | // 217 | this.notifyIcon.BalloonTipText = "WoWthing Sync has minimised to the system tray"; 218 | this.notifyIcon.Icon = global::WoWthing_Sync.Properties.Resources.PausedIcon; 219 | this.notifyIcon.Text = "WoWthing Sync"; 220 | this.notifyIcon.Visible = true; 221 | this.notifyIcon.DoubleClick += new System.EventHandler(this.notifyIcon_DoubleClick); 222 | // 223 | // SyncForm 224 | // 225 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 226 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 227 | this.ClientSize = new System.Drawing.Size(415, 394); 228 | this.Controls.Add(this.groupBox1); 229 | this.Controls.Add(this.groupBox2); 230 | this.Controls.Add(this.textLog); 231 | this.Icon = global::WoWthing_Sync.Properties.Resources.PausedIcon; 232 | this.MaximizeBox = false; 233 | this.MaximumSize = new System.Drawing.Size(431, 872); 234 | this.MinimumSize = new System.Drawing.Size(431, 352); 235 | this.Name = "SyncForm"; 236 | this.Text = "WoWthing Sync"; 237 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SyncForm_FormClosing); 238 | this.Load += new System.EventHandler(this.SyncForm_Load); 239 | this.Resize += new System.EventHandler(this.SyncForm_Resize); 240 | this.groupBox2.ResumeLayout(false); 241 | this.groupBox2.PerformLayout(); 242 | this.groupBox1.ResumeLayout(false); 243 | this.groupBox1.PerformLayout(); 244 | this.ResumeLayout(false); 245 | this.PerformLayout(); 246 | 247 | } 248 | 249 | #endregion 250 | 251 | private System.Windows.Forms.TextBox textLog; 252 | private System.Windows.Forms.TextBox textFolder; 253 | private System.Windows.Forms.Button btnChooseFolder; 254 | private System.Windows.Forms.GroupBox groupBox2; 255 | private System.Windows.Forms.TextBox textApiKey; 256 | private System.Windows.Forms.Label label1; 257 | private System.Windows.Forms.GroupBox groupBox1; 258 | private System.Windows.Forms.Button btnStart; 259 | private System.Windows.Forms.TextBox textStatus; 260 | private System.Windows.Forms.NotifyIcon notifyIcon; 261 | private System.Windows.Forms.Button btnManualUpload; 262 | private System.Windows.Forms.CheckBox checkStartOnStartup; 263 | private System.Windows.Forms.CheckBox checkStartMinimized; 264 | private System.Windows.Forms.CheckBox checkCloseMinimizes; 265 | } 266 | } 267 | 268 | -------------------------------------------------------------------------------- /WoWthing Sync/SyncForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.IO; 5 | using System.IO.Compression; 6 | using System.Linq; 7 | using System.Net.Http; 8 | using System.Reflection; 9 | using System.Text; 10 | using System.Windows.Forms; 11 | using Microsoft.Win32; 12 | using Newtonsoft.Json; 13 | using Newtonsoft.Json.Serialization; 14 | 15 | namespace WoWthing_Sync 16 | { 17 | public partial class SyncForm : Form 18 | { 19 | private const string STARTUP_KEY = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; 20 | 21 | #if DEBUG 22 | private const string STARTUP_NAME = "WoWthingDebug"; 23 | private const string UPLOAD_HOST = "https://localhost:55501/"; 24 | #else 25 | private const string STARTUP_NAME = "WoWthingRelease"; 26 | private const string UPLOAD_HOST = "https://wowthing.org/"; 27 | #endif 28 | 29 | private bool isPaused = false; 30 | private bool isUploading = false; 31 | 32 | private List watchedPaths = new List(); 33 | private readonly Dictionary lastUpdated = new Dictionary(); 34 | private readonly Dictionary changedFiles = new Dictionary(); 35 | private readonly HttpClient client = new HttpClient(); 36 | private readonly System.Timers.Timer _timer = new System.Timers.Timer(500); 37 | private readonly TimeSpan waitInterval = TimeSpan.FromMilliseconds(2000); 38 | private int counter = 0; 39 | 40 | public SyncForm() 41 | { 42 | InitializeComponent(); 43 | 44 | Version version = Assembly.GetExecutingAssembly().GetName().Version; 45 | Text = string.Format("WoWthing Sync {0}.{1}.{2}", version.Major, version.Minor, version.Build); 46 | } 47 | 48 | private void SyncForm_Load(object sender, EventArgs e) 49 | { 50 | Log("WoWthing Sync started"); 51 | 52 | LoadSettings(); 53 | Pause(); 54 | 55 | // Auto-start if the Start button is enabled 56 | if (btnStart.Enabled) 57 | { 58 | btnStart.PerformClick(); 59 | } 60 | 61 | // HttpClient setup 62 | client.BaseAddress = new Uri(UPLOAD_HOST); 63 | client.DefaultRequestHeaders.Add("User-Agent", "WoWthing Sync"); 64 | client.Timeout = new System.TimeSpan(0, 0, 20); 65 | 66 | // Timer setup 67 | _timer.Elapsed += _timer_Elapsed; 68 | _timer.SynchronizingObject = this; 69 | _timer.Enabled = true; 70 | } 71 | 72 | private delegate void LogCallback(string text, string[] args); 73 | 74 | private void Log(string text, params string[] args) 75 | { 76 | // Invoke magic if accessing from another thread 77 | if (textLog.InvokeRequired) 78 | { 79 | LogCallback ltc = new LogCallback(Log); 80 | Invoke(ltc, new object[] { text, args }); 81 | } 82 | else 83 | { 84 | if (args.Length > 0) 85 | { 86 | text = String.Format(text, args); 87 | } 88 | textLog.AppendText(String.Format("[{0}] {1}\r\n", DateTime.Now.ToString("HH:mm:ss"), text)); 89 | } 90 | } 91 | 92 | private void LogDebug(string text, params string[] args) 93 | { 94 | #if DEBUG 95 | Log(text, args); 96 | #endif 97 | } 98 | 99 | private void Pause() 100 | { 101 | if (!isPaused) 102 | { 103 | Log("Paused"); 104 | } 105 | 106 | btnStart.Text = "Start"; 107 | btnStart.Enabled = textApiKey.Text != "" && textFolder.Text != ""; 108 | textStatus.Text = "PAUSED"; 109 | 110 | Icon = notifyIcon.Icon = Properties.Resources.PausedIcon; 111 | 112 | isPaused = true; 113 | } 114 | 115 | private void Start() 116 | { 117 | watchedPaths = new List(); 118 | 119 | // Get a list of account directories 120 | string wtfPath = Path.Combine(textFolder.Text, @"WTF\Account"); 121 | if (!Directory.Exists(wtfPath)) 122 | { 123 | Log("ERROR! Path does not exist: {0}", wtfPath); 124 | return; 125 | } 126 | 127 | string[] dirs = Directory.GetDirectories(wtfPath); 128 | 129 | for (int i = 0; i < dirs.Length; i++) 130 | { 131 | // Check to see if our Lua file exists 132 | string svPath = Path.Combine(dirs[i], "SavedVariables"); 133 | if (Directory.Exists(svPath)) 134 | { 135 | string luaPath = Path.Combine(svPath, "WoWthing_Collector.lua"); 136 | if (File.Exists(luaPath)) 137 | { 138 | lastUpdated[luaPath] = File.GetLastWriteTimeUtc(luaPath); 139 | } 140 | 141 | watchedPaths.Add(luaPath); 142 | Log("Watching {0}", dirs[i]); 143 | } 144 | } 145 | 146 | // Update button 147 | textStatus.Text = "ACTIVE"; 148 | btnStart.Text = "Pause"; 149 | 150 | isPaused = false; 151 | 152 | Icon = notifyIcon.Icon = Properties.Resources.ActiveIcon; 153 | 154 | // Minimize on startup 155 | if (checkStartMinimized.Checked) 156 | { 157 | this.WindowState = FormWindowState.Minimized; 158 | } 159 | } 160 | 161 | private void LoadSettings() 162 | { 163 | // Check if an upgrade is required 164 | if (Properties.Settings.Default.UpgradeRequired) 165 | { 166 | Properties.Settings.Default.Upgrade(); 167 | Properties.Settings.Default.UpgradeRequired = false; 168 | Properties.Settings.Default.Save(); 169 | } 170 | 171 | // Restore window size and position 172 | if (Properties.Settings.Default.WindowH < 100 || 173 | Properties.Settings.Default.WindowX < 0 || 174 | Properties.Settings.Default.WindowY < 0) 175 | { 176 | if (Properties.Settings.Default.WindowH < 100) 177 | { 178 | Properties.Settings.Default.WindowH = 400; 179 | } 180 | 181 | if (Properties.Settings.Default.WindowX < 0) 182 | { 183 | Properties.Settings.Default.WindowX = 0; 184 | } 185 | 186 | if (Properties.Settings.Default.WindowY < 0) 187 | { 188 | Properties.Settings.Default.WindowY = 0; 189 | } 190 | 191 | Properties.Settings.Default.Save(); 192 | } 193 | 194 | Height = (int)Properties.Settings.Default.WindowH; 195 | Left = (int)Properties.Settings.Default.WindowX; 196 | Top = (int)Properties.Settings.Default.WindowY; 197 | 198 | // Restore our settings 199 | textApiKey.Text = Properties.Settings.Default.ApiKey; 200 | textFolder.Text = Properties.Settings.Default.WatchFolder; 201 | checkCloseMinimizes.Checked = Properties.Settings.Default.CloseMinimizes; 202 | checkStartMinimized.Checked = Properties.Settings.Default.StartMinimized; 203 | checkStartOnStartup.Checked = Properties.Settings.Default.StartOnStartup; 204 | } 205 | 206 | private byte[] ReadAllGZip(string filePath) 207 | { 208 | using (FileStream src = System.IO.File.OpenRead(filePath)) 209 | { 210 | using (MemoryStream memory = new MemoryStream()) 211 | { 212 | using (GZipStream gzip = new GZipStream(memory, CompressionMode.Compress, true)) 213 | { 214 | src.CopyTo(gzip); 215 | } 216 | return memory.ToArray(); 217 | } 218 | } 219 | } 220 | 221 | private void Upload(string filePath) 222 | { 223 | isUploading = true; 224 | 225 | var upload = new ApiUpload 226 | { 227 | ApiKey = textApiKey.Text, 228 | LuaFile = File.ReadAllText(filePath, Encoding.UTF8), 229 | }; 230 | var json = JsonConvert.SerializeObject(upload, new JsonSerializerSettings 231 | { 232 | ContractResolver = new DefaultContractResolver 233 | { 234 | NamingStrategy = new CamelCaseNamingStrategy(), 235 | }, 236 | }); 237 | 238 | //var content = new StringContent(json, Encoding.UTF8, "application/json"); 239 | var content = new CompressedContent(new StringContent(json, Encoding.UTF8, "application/json")); 240 | 241 | Log("Uploading {0}...", filePath); 242 | client.PostAsync("/api/upload/", content).ContinueWith( 243 | (postTask) => 244 | { 245 | try 246 | { 247 | var result = postTask.Result; 248 | if (result.IsSuccessStatusCode) 249 | { 250 | Log("Upload successful."); 251 | } 252 | else 253 | { 254 | var errorMessage = result.Content.ReadAsStringAsync().Result; 255 | Log("Upload failed: {0}", errorMessage); 256 | } 257 | } 258 | catch (AggregateException aex) 259 | { 260 | foreach (Exception ex in aex.InnerExceptions) 261 | { 262 | Log("EXCEPTION: {0}", ex.Message); 263 | if (ex.InnerException != null) 264 | { 265 | Log(" - {0}", ex.InnerException.Message); 266 | } 267 | } 268 | } 269 | 270 | isUploading = false; 271 | } 272 | ); 273 | } 274 | 275 | #region Events 276 | // Save our settings when the window closes 277 | private void SyncForm_FormClosing(object sender, FormClosingEventArgs e) 278 | { 279 | Properties.Settings.Default.WindowX = Left; 280 | Properties.Settings.Default.WindowY = Top; 281 | Properties.Settings.Default.WindowH = Height; 282 | Properties.Settings.Default.Save(); 283 | 284 | if (Properties.Settings.Default.CloseMinimizes && e.CloseReason == CloseReason.UserClosing) 285 | { 286 | MinimizeWindow(); 287 | e.Cancel = true; 288 | } 289 | } 290 | 291 | private void textApiKey_TextChanged(object sender, EventArgs e) 292 | { 293 | Properties.Settings.Default.ApiKey = textApiKey.Text; 294 | Properties.Settings.Default.Save(); 295 | Pause(); 296 | } 297 | 298 | private void checkStartMinimized_CheckedChanged(object sender, EventArgs e) 299 | { 300 | Properties.Settings.Default.StartMinimized = checkStartMinimized.Checked; 301 | Properties.Settings.Default.Save(); 302 | } 303 | 304 | private void checkCloseMinimizes_CheckedChanged(object sender, EventArgs e) 305 | { 306 | Properties.Settings.Default.CloseMinimizes = checkCloseMinimizes.Checked; 307 | Properties.Settings.Default.Save(); 308 | } 309 | 310 | private void checkStartOnStartup_CheckedChanged(object sender, EventArgs e) 311 | { 312 | Properties.Settings.Default.StartOnStartup = checkStartOnStartup.Checked; 313 | Properties.Settings.Default.Save(); 314 | 315 | RegistryKey key = Registry.CurrentUser.OpenSubKey(STARTUP_KEY, true); 316 | if (checkStartOnStartup.Checked) 317 | { 318 | key.SetValue(STARTUP_NAME, Application.ExecutablePath.ToString()); 319 | } 320 | else 321 | { 322 | var existing = key.GetValue(STARTUP_NAME); 323 | if (existing != null) 324 | { 325 | key.DeleteValue(STARTUP_NAME); 326 | } 327 | } 328 | } 329 | 330 | private void btnChooseFolder_Click(object sender, EventArgs e) 331 | { 332 | FolderBrowserDialog fbd = new FolderBrowserDialog(); 333 | fbd.RootFolder = Environment.SpecialFolder.MyComputer; 334 | 335 | if (!string.IsNullOrWhiteSpace(textFolder.Text) && Directory.Exists(textFolder.Text)) 336 | { 337 | fbd.SelectedPath = textFolder.Text; 338 | } 339 | 340 | if (fbd.ShowDialog() == DialogResult.OK) 341 | { 342 | string retailFolder = Path.Combine(fbd.SelectedPath, "_retail_"); 343 | textFolder.Text = Directory.Exists(retailFolder) ? retailFolder : fbd.SelectedPath; 344 | Properties.Settings.Default.WatchFolder = textFolder.Text; 345 | Properties.Settings.Default.Save(); 346 | Pause(); 347 | } 348 | } 349 | 350 | private void btnManualUpload_Click(object sender, EventArgs e) 351 | { 352 | if (!isUploading) 353 | { 354 | foreach (string luaPath in watchedPaths) 355 | { 356 | if (File.Exists(luaPath)) 357 | { 358 | Upload(luaPath); 359 | } 360 | } 361 | } 362 | } 363 | 364 | private void btnStart_Click(object sender, EventArgs e) 365 | { 366 | if (isPaused) 367 | { 368 | Start(); 369 | } 370 | else 371 | { 372 | Pause(); 373 | } 374 | } 375 | 376 | private void MinimizeWindow() 377 | { 378 | notifyIcon.Visible = true; 379 | notifyIcon.ShowBalloonTip(3000); 380 | ShowInTaskbar = false; 381 | Hide(); 382 | } 383 | 384 | private void RestoreWindow() 385 | { 386 | notifyIcon.Visible = false; 387 | ShowInTaskbar = true; 388 | Show(); 389 | } 390 | 391 | private void SyncForm_Resize(object sender, EventArgs e) 392 | { 393 | if (WindowState == FormWindowState.Minimized) 394 | { 395 | MinimizeWindow(); 396 | } 397 | else if (WindowState == FormWindowState.Normal) 398 | { 399 | RestoreWindow(); 400 | } 401 | } 402 | 403 | private void notifyIcon_DoubleClick(object sender, EventArgs e) 404 | { 405 | RestoreWindow(); 406 | WindowState = FormWindowState.Normal; 407 | } 408 | 409 | private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) 410 | { 411 | if (!isUploading) 412 | { 413 | lock (changedFiles) 414 | { 415 | counter = (counter + 1) % 4; 416 | if (counter == 0) 417 | { 418 | foreach (string luaPath in watchedPaths) 419 | { 420 | if (File.Exists(luaPath)) 421 | { 422 | DateTime newMtime = File.GetLastWriteTimeUtc(luaPath); 423 | lastUpdated.TryGetValue(luaPath, out DateTime oldMtime); 424 | 425 | if (newMtime > oldMtime) 426 | { 427 | changedFiles[luaPath] = DateTime.Now; 428 | lastUpdated[luaPath] = newMtime; 429 | } 430 | } 431 | } 432 | } 433 | 434 | foreach (var kvp in changedFiles.Where(x => DateTime.Now - x.Value > waitInterval)) 435 | { 436 | changedFiles.Remove(kvp.Key); 437 | Upload(kvp.Key); 438 | break; 439 | } 440 | } 441 | } 442 | } 443 | #endregion 444 | } 445 | 446 | public class ApiUpload 447 | { 448 | public string ApiKey { get; set; } 449 | public string LuaFile { get; set; } 450 | } 451 | } 452 | --------------------------------------------------------------------------------