├── .gitattributes ├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── .vs └── config │ └── applicationhost.config ├── LICENSE.md ├── Packages.mdproj ├── README.md ├── TechnicSolderHelper.sln └── TechnicSolderHelper ├── App.config ├── AsyncOperations.cs ├── Debug.cs ├── FileUpload ├── UploadProgression.Designer.cs ├── UploadProgression.cs ├── UploadProgression.resx ├── ftp.cs ├── ftpInfo.Designer.cs ├── ftpInfo.cs └── ftpInfo.resx ├── FtbStuff.cs ├── Litemod.cs ├── Modlist.cs ├── MoreLinq └── MoreEnumerable.DistinctBy.cs ├── Program.cs ├── Prompt.cs ├── Properties ├── AssemblyInfo.cs ├── Settings.Designer.cs └── Settings.settings ├── ReadOnlyRadioButton.cs ├── Run SolderHelper.sh ├── SQL ├── DatabaseEditor.Designer.cs ├── DatabaseEditor.cs ├── DatabaseEditor.resx ├── FTBPermissionsSQLHelper.cs ├── ModListSQLHelper.cs ├── Mono.Data.Sqlite.dll ├── OwnPermissionsSQLHelper.cs ├── SQLhelper.cs ├── SolderSQLHandler.cs ├── forge │ ├── ForgeVersionSelector.Designer.cs │ ├── ForgeVersionSelector.cs │ ├── ForgeVersionSelector.resx │ ├── forge.cs │ └── forgemaven.cs ├── ftbPermissions.cs ├── liteloader │ └── liteloader.cs ├── sqlInfo.Designer.cs ├── sqlInfo.cs ├── sqlInfo.resx └── workTogether │ └── dataSuggest.cs ├── Settings.cs ├── SmallInterfaces ├── mcselector.Designer.cs ├── mcselector.cs └── mcselector.resx ├── SolderHelper.desktop ├── TechnicSolderHelper.Designer.cs ├── TechnicSolderHelper.cs ├── TechnicSolderHelper.csproj ├── TechnicSolderHelper.pfx ├── TechnicSolderHelper.resx ├── TechnicStuff.cs ├── ZipUtils.cs ├── confighandler └── confighandler.cs ├── cryptography ├── KeyHandler.cs └── crypto.cs ├── globalfunctions.cs ├── install.sh ├── mcmod.cs ├── modinfo.Designer.cs ├── modinfo.cs ├── modinfo.resx ├── modpackhelper.ico ├── modpacks.cs ├── output ├── jquery.min.js └── technicsolderhelper.js ├── packages.config ├── s3 ├── S3.cs ├── S3Info.Designer.cs ├── S3Info.cs └── S3Info.resx ├── sqlite3.def ├── update.sh ├── x64 └── SQLite.Interop.dll └── x86 └── SQLite.Interop.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | build/ 14 | bld/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # MSTest test Results 19 | [Tt]est[Rr]esult*/ 20 | [Bb]uild[Ll]og.* 21 | 22 | #NUNIT 23 | *.VisualState.xml 24 | TestResult.xml 25 | 26 | # Build Results of an ATL Project 27 | [Dd]ebugPS/ 28 | [Rr]eleasePS/ 29 | dlldata.c 30 | 31 | *_i.c 32 | *_p.c 33 | *_i.h 34 | *.ilk 35 | *.meta 36 | *.obj 37 | *.pch 38 | *.pdb 39 | *.pgc 40 | *.pgd 41 | *.rsp 42 | *.sbr 43 | *.tlb 44 | *.tli 45 | *.tlh 46 | *.tmp 47 | *.tmp_proj 48 | *.log 49 | *.vspscc 50 | *.vssscc 51 | .builds 52 | *.pidb 53 | *.svclog 54 | *.scc 55 | 56 | # Chutzpah Test files 57 | _Chutzpah* 58 | 59 | # Visual C++ cache files 60 | ipch/ 61 | *.aps 62 | *.ncb 63 | *.opensdf 64 | *.sdf 65 | *.cachefile 66 | 67 | # Visual Studio profiler 68 | *.psess 69 | *.vsp 70 | *.vspx 71 | 72 | # TFS 2012 Local Workspace 73 | $tf/ 74 | 75 | # Guidance Automation Toolkit 76 | *.gpState 77 | 78 | # ReSharper is a .NET coding add-in 79 | _ReSharper*/ 80 | *.[Rr]e[Ss]harper 81 | *.DotSettings.user 82 | 83 | # JustCode is a .NET coding addin-in 84 | .JustCode 85 | 86 | # TeamCity is a build add-in 87 | _TeamCity* 88 | 89 | # DotCover is a Code Coverage Tool 90 | *.dotCover 91 | 92 | # NCrunch 93 | *.ncrunch* 94 | _NCrunch_* 95 | .*crunch*.local.xml 96 | 97 | # MightyMoose 98 | *.mm.* 99 | AutoTest.Net/ 100 | 101 | # Web workbench (sass) 102 | .sass-cache/ 103 | 104 | # Installshield output folder 105 | [Ee]xpress/ 106 | 107 | # DocProject is a documentation generator add-in 108 | DocProject/buildhelp/ 109 | DocProject/Help/*.HxT 110 | DocProject/Help/*.HxC 111 | DocProject/Help/*.hhc 112 | DocProject/Help/*.hhk 113 | DocProject/Help/*.hhp 114 | DocProject/Help/Html2 115 | DocProject/Help/html 116 | 117 | # Click-Once directory 118 | publish/ 119 | 120 | # Publish Web Output 121 | *.[Pp]ublish.xml 122 | *.azurePubxml 123 | 124 | # NuGet Packages Directory 125 | packages/ 126 | ## TODO: If the tool you use requires repositories.config uncomment the next line 127 | #!packages/repositories.config 128 | 129 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 130 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 131 | !packages/build/ 132 | 133 | # Windows Azure Build Output 134 | csx/ 135 | *.build.csdef 136 | 137 | # Windows Store app package directory 138 | AppPackages/ 139 | 140 | # Others 141 | *.Cache 142 | ClientBin/ 143 | [Ss]tyle[Cc]op.* 144 | ~$* 145 | *~ 146 | *.dbmdl 147 | *.dbproj.schemaview 148 | *.publishsettings 149 | node_modules/ 150 | 151 | # RIA/Silverlight projects 152 | Generated_Code/ 153 | 154 | # Backup & report files from converting an old project file to a newer 155 | # Visual Studio version. Backup files are not needed, because we have git ;-) 156 | _UpgradeReport_Files/ 157 | Backup*/ 158 | UpgradeLog*.XML 159 | UpgradeLog*.htm 160 | 161 | # SQL Server files 162 | *.mdf 163 | *.ldf 164 | 165 | # Business Intelligence projects 166 | *.rdl.data 167 | *.bim.layout 168 | *.bim_*.settings 169 | 170 | # Microsoft Fakes 171 | FakesAssemblies/ 172 | 173 | # ========================= 174 | # Operating System Files 175 | # ========================= 176 | 177 | # OSX 178 | # ========================= 179 | 180 | .DS_Store 181 | .AppleDouble 182 | .LSOverride 183 | 184 | # Icon must ends with two \r. 185 | Icon 186 | 187 | # Thumbnails 188 | ._* 189 | 190 | # Files that might appear on external disk 191 | .Spotlight-V100 192 | .Trashes 193 | 194 | # Windows 195 | # ========================= 196 | 197 | # Windows image file caches 198 | Thumbs.db 199 | ehthumbs.db 200 | 201 | # Folder config file 202 | Desktop.ini 203 | 204 | # Recycle Bin used on file shares 205 | $RECYCLE.BIN/ 206 | 207 | # Windows Installer files 208 | *.cab 209 | *.msi 210 | *.msm 211 | *.msp 212 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/.nuget/NuGet.exe -------------------------------------------------------------------------------- /.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 31 | 32 | 33 | 34 | 35 | $(SolutionDir).nuget 36 | 37 | 38 | 39 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config 40 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config 41 | 42 | 43 | 44 | $(MSBuildProjectDirectory)\packages.config 45 | $(PackagesProjectConfig) 46 | 47 | 48 | 49 | 50 | $(NuGetToolsPath)\NuGet.exe 51 | @(PackageSource) 52 | 53 | "$(NuGetExePath)" 54 | mono --runtime=v4.0.30319 "$(NuGetExePath)" 55 | 56 | $(TargetDir.Trim('\\')) 57 | 58 | -RequireConsent 59 | -NonInteractive 60 | 61 | "$(SolutionDir) " 62 | "$(SolutionDir)" 63 | 64 | 65 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) 66 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols 67 | 68 | 69 | 70 | RestorePackages; 71 | $(BuildDependsOn); 72 | 73 | 74 | 75 | 76 | $(BuildDependsOn); 77 | BuildPackage; 78 | 79 | 80 | 81 | 82 | 83 | 84 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 99 | 100 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2014-2015 Rasmus Hansen 2 | -------------------------------------------------------------------------------- /Packages.mdproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PackagingProject 5 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project has been abandoned 2 | As i no longer play Minecraft, and haven't done for a couple of years, i no longer have any interested on maintaining this. Releases of something like a successor can be found here: https://github.com/zlepper/go-modpack-packer/releases, however that project is not maintained either. 3 | 4 | 5 | TechnicSolderHelper 6 | =================== 7 | 8 | Technic Solder Helper is a tool that helps you pack modpack files in the correct format. 9 | 10 | Supports Technic and FTB packs. AT Launcher are in the works. 11 | 12 | A compiled version of this can be found at: http://zlepper.dk/solderhelper/publish.htm 13 | 14 | For linux run the command 15 | `curl https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/master/TechnicSolderHelper/install.sh | bash`, this will install the program in a subfolder of the current working directory, though it can be changed in the script. 16 | 17 | For Mac I have no idea if this will work or not. I don't have a mac, so I can't test. 18 | 19 | Developing TechnicSolderHelper 20 | ============================== 21 | If you want to contribute to TechnicSolderHelper you need the following things on your machine: 22 | 23 | If you are using Windows to develop i would recommend getting visualstudio: https://www.visualstudio.com/ 24 | 25 | Or if you are using linux or mac monodevelop: http://www.monodevelop.com/download/ (Will also work for Windows) 26 | 27 | Then download the code using your prefered git tool and open the TechnicSolderHelper.sln file with the IDE you just installed. Then tell you IDE to restore packages and you should be good to go. 28 | -------------------------------------------------------------------------------- /TechnicSolderHelper.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}") = "TechnicSolderHelper", "TechnicSolderHelper\TechnicSolderHelper.csproj", "{7DFB4DA0-3155-43B8-BA1E-796C4B05B200}" 7 | EndProject 8 | Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Packages", "Packages.mdproj", "{ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{53F428E4-63EE-4EC8-9FDC-C34D218FBF73}" 11 | ProjectSection(SolutionItems) = preProject 12 | .nuget\NuGet.Config = .nuget\NuGet.Config 13 | .nuget\NuGet.exe = .nuget\NuGet.exe 14 | .nuget\NuGet.targets = .nuget\NuGet.targets 15 | EndProjectSection 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|Any CPU = Debug|Any CPU 20 | Debug|x64 = Debug|x64 21 | Debug|x86 = Debug|x86 22 | DeployClickOnce|Any CPU = DeployClickOnce|Any CPU 23 | DeployClickOnce|x64 = DeployClickOnce|x64 24 | DeployClickOnce|x86 = DeployClickOnce|x86 25 | Release|Any CPU = Release|Any CPU 26 | Release|x64 = Release|x64 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|x64.ActiveCfg = Debug|x64 33 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|x64.Build.0 = Debug|x64 34 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|x86.ActiveCfg = Debug|x86 35 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Debug|x86.Build.0 = Debug|x86 36 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|Any CPU.ActiveCfg = Debug|Any CPU 37 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|Any CPU.Build.0 = Debug|Any CPU 38 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|x64.ActiveCfg = Debug|x64 39 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|x64.Build.0 = Debug|x64 40 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|x86.ActiveCfg = Debug|x86 41 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.DeployClickOnce|x86.Build.0 = Debug|x86 42 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|x64.ActiveCfg = Release|x64 45 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|x64.Build.0 = Release|x64 46 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|x86.ActiveCfg = Release|x86 47 | {7DFB4DA0-3155-43B8-BA1E-796C4B05B200}.Release|x86.Build.0 = Release|x86 48 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Debug|x64.ActiveCfg = Debug|Any CPU 50 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Debug|x86.ActiveCfg = Debug|Any CPU 51 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.DeployClickOnce|Any CPU.ActiveCfg = Debug|Any CPU 52 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.DeployClickOnce|x64.ActiveCfg = Debug|Any CPU 53 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.DeployClickOnce|x86.ActiveCfg = Debug|Any CPU 54 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Release|x64.ActiveCfg = Release|Any CPU 56 | {ACB0CA1A-8E18-4ECB-B3D3-53A1AA94F68B}.Release|x86.ActiveCfg = Release|Any CPU 57 | EndGlobalSection 58 | GlobalSection(SolutionProperties) = preSolution 59 | HideSolutionNode = FALSE 60 | EndGlobalSection 61 | GlobalSection(MonoDevelopProperties) = preSolution 62 | StartupItem = TechnicSolderHelper\TechnicSolderHelper.csproj 63 | Policies = $0 64 | $0.DotNetNamingPolicy = $1 65 | $1.DirectoryNamespaceAssociation = None 66 | $1.ResourceNamePolicy = FileFormatDefault 67 | $0.TextStylePolicy = $2 68 | $2.FileWidth = 120 69 | $2.TabsToSpaces = False 70 | $2.inheritsSet = VisualStudio 71 | $2.inheritsScope = text/plain 72 | $0.StandardHeader = $3 73 | $3.Text = 74 | $3.IncludeInNewFiles = True 75 | $0.NameConventionPolicy = $4 76 | $4.Rules = $5 77 | $5.NamingRule = $25 78 | $6.Name = Namespaces 79 | $6.AffectedEntity = Namespace 80 | $6.VisibilityMask = VisibilityMask 81 | $6.NamingStyle = PascalCase 82 | $6.IncludeInstanceMembers = True 83 | $6.IncludeStaticEntities = True 84 | $7.Name = Types 85 | $7.AffectedEntity = Class, Struct, Enum, Delegate 86 | $7.VisibilityMask = Public 87 | $7.NamingStyle = PascalCase 88 | $7.IncludeInstanceMembers = True 89 | $7.IncludeStaticEntities = True 90 | $8.Name = Interfaces 91 | $8.RequiredPrefixes = $9 92 | $9.String = I 93 | $8.AffectedEntity = Interface 94 | $8.VisibilityMask = Public 95 | $8.NamingStyle = PascalCase 96 | $8.IncludeInstanceMembers = True 97 | $8.IncludeStaticEntities = True 98 | $10.Name = Attributes 99 | $10.RequiredSuffixes = $11 100 | $11.String = Attribute 101 | $10.AffectedEntity = CustomAttributes 102 | $10.VisibilityMask = Public 103 | $10.NamingStyle = PascalCase 104 | $10.IncludeInstanceMembers = True 105 | $10.IncludeStaticEntities = True 106 | $12.Name = Event Arguments 107 | $12.RequiredSuffixes = $13 108 | $13.String = EventArgs 109 | $12.AffectedEntity = CustomEventArgs 110 | $12.VisibilityMask = Public 111 | $12.NamingStyle = PascalCase 112 | $12.IncludeInstanceMembers = True 113 | $12.IncludeStaticEntities = True 114 | $14.Name = Exceptions 115 | $14.RequiredSuffixes = $15 116 | $15.String = Exception 117 | $14.AffectedEntity = CustomExceptions 118 | $14.VisibilityMask = VisibilityMask 119 | $14.NamingStyle = PascalCase 120 | $14.IncludeInstanceMembers = True 121 | $14.IncludeStaticEntities = True 122 | $16.Name = Methods 123 | $16.AffectedEntity = Methods 124 | $16.VisibilityMask = Protected, Public 125 | $16.NamingStyle = PascalCase 126 | $16.IncludeInstanceMembers = True 127 | $16.IncludeStaticEntities = True 128 | $17.Name = Static Readonly Fields 129 | $17.AffectedEntity = ReadonlyField 130 | $17.VisibilityMask = Protected, Public 131 | $17.NamingStyle = PascalCase 132 | $17.IncludeInstanceMembers = False 133 | $17.IncludeStaticEntities = True 134 | $18.Name = Fields 135 | $18.AffectedEntity = Field 136 | $18.VisibilityMask = Protected, Public 137 | $18.NamingStyle = PascalCase 138 | $18.IncludeInstanceMembers = True 139 | $18.IncludeStaticEntities = True 140 | $19.Name = ReadOnly Fields 141 | $19.AffectedEntity = ReadonlyField 142 | $19.VisibilityMask = Protected, Public 143 | $19.NamingStyle = PascalCase 144 | $19.IncludeInstanceMembers = True 145 | $19.IncludeStaticEntities = False 146 | $20.Name = Constant Fields 147 | $20.AffectedEntity = ConstantField 148 | $20.VisibilityMask = Protected, Public 149 | $20.NamingStyle = PascalCase 150 | $20.IncludeInstanceMembers = True 151 | $20.IncludeStaticEntities = True 152 | $21.Name = Properties 153 | $21.AffectedEntity = Property 154 | $21.VisibilityMask = Protected, Public 155 | $21.NamingStyle = PascalCase 156 | $21.IncludeInstanceMembers = True 157 | $21.IncludeStaticEntities = True 158 | $22.Name = Events 159 | $22.AffectedEntity = Event 160 | $22.VisibilityMask = Protected, Public 161 | $22.NamingStyle = PascalCase 162 | $22.IncludeInstanceMembers = True 163 | $22.IncludeStaticEntities = True 164 | $23.Name = Enum Members 165 | $23.AffectedEntity = EnumMember 166 | $23.VisibilityMask = VisibilityMask 167 | $23.NamingStyle = PascalCase 168 | $23.IncludeInstanceMembers = True 169 | $23.IncludeStaticEntities = True 170 | $24.Name = Parameters 171 | $24.AffectedEntity = Parameter 172 | $24.VisibilityMask = VisibilityMask 173 | $24.NamingStyle = CamelCase 174 | $24.IncludeInstanceMembers = True 175 | $24.IncludeStaticEntities = True 176 | $25.Name = Type Parameters 177 | $25.RequiredPrefixes = $26 178 | $26.String = T 179 | $25.AffectedEntity = TypeParameter 180 | $25.VisibilityMask = VisibilityMask 181 | $25.NamingStyle = PascalCase 182 | $25.IncludeInstanceMembers = True 183 | $25.IncludeStaticEntities = True 184 | EndGlobalSection 185 | EndGlobal 186 | -------------------------------------------------------------------------------- /TechnicSolderHelper/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /TechnicSolderHelper/AsyncOperations.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace TechnicSolderHelper 4 | { 5 | public class MessageToUser 6 | { 7 | public void FirstTimeRun() 8 | { 9 | MessageBox.Show("This is the first time you are running SolderHelper so it might take a while to start since it needs to build some databases."); 10 | } 11 | 12 | public void UploadingToFtp() 13 | { 14 | MessageBox.Show("Uploading stuff to FTP"); 15 | } 16 | 17 | public void UploadToS3() 18 | { 19 | MessageBox.Show("Uploading files to s3"); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Debug.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace TechnicSolderHelper 10 | { 11 | public class Debug 12 | { 13 | private static readonly string Output = 14 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), 15 | "DebugFromModpackHelper.txt"); 16 | private static readonly StringBuilder sb = new StringBuilder(); 17 | private static CheckBox _box; 18 | 19 | public static void AssignCheckbox(CheckBox b) 20 | { 21 | _box = b; 22 | } 23 | 24 | public static void WriteLine(string text, bool condition = false) 25 | { 26 | System.Diagnostics.Debug.WriteLine(text); 27 | if (condition || _box != null && _box.Checked) 28 | { 29 | sb.AppendLine(text); 30 | } 31 | } 32 | 33 | public static void WriteLine(object o, bool condition = false) 34 | { 35 | try 36 | { 37 | WriteLine(o.ToString(), condition); 38 | } 39 | catch (Exception) 40 | { 41 | // Ignored 42 | } 43 | } 44 | 45 | public static void Save() 46 | { 47 | if (!string.IsNullOrWhiteSpace(sb.ToString())) 48 | File.AppendAllText(Output, sb.ToString()); 49 | sb.Clear(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/UploadProgression.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.FileUpload 5 | { 6 | partial class UploadProgression 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.FileProgress = new System.Windows.Forms.ProgressBar(); 35 | this.TotalProgress = new System.Windows.Forms.ProgressBar(); 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.CurrentFileName = new System.Windows.Forms.Label(); 40 | this.ProgressPercentage = new System.Windows.Forms.Label(); 41 | this.SuspendLayout(); 42 | // 43 | // FileProgress 44 | // 45 | this.FileProgress.Location = new System.Drawing.Point(12, 72); 46 | this.FileProgress.Name = "FileProgress"; 47 | this.FileProgress.Size = new System.Drawing.Size(260, 23); 48 | this.FileProgress.TabIndex = 0; 49 | // 50 | // TotalProgress 51 | // 52 | this.TotalProgress.Location = new System.Drawing.Point(12, 25); 53 | this.TotalProgress.Name = "TotalProgress"; 54 | this.TotalProgress.Size = new System.Drawing.Size(260, 23); 55 | this.TotalProgress.TabIndex = 1; 56 | // 57 | // label1 58 | // 59 | this.label1.AutoSize = true; 60 | this.label1.Location = new System.Drawing.Point(12, 53); 61 | this.label1.Name = "label1"; 62 | this.label1.Size = new System.Drawing.Size(66, 13); 63 | this.label1.TabIndex = 2; 64 | this.label1.Text = "File progress"; 65 | // 66 | // label2 67 | // 68 | this.label2.AutoSize = true; 69 | this.label2.Location = new System.Drawing.Point(12, 9); 70 | this.label2.Name = "label2"; 71 | this.label2.Size = new System.Drawing.Size(75, 13); 72 | this.label2.TabIndex = 3; 73 | this.label2.Text = "Total Progress"; 74 | // 75 | // label3 76 | // 77 | this.label3.AutoSize = true; 78 | this.label3.Location = new System.Drawing.Point(12, 102); 79 | this.label3.Name = "label3"; 80 | this.label3.Size = new System.Drawing.Size(63, 13); 81 | this.label3.TabIndex = 4; 82 | this.label3.Text = "Current File:"; 83 | // 84 | // CurrentFileName 85 | // 86 | this.CurrentFileName.AutoSize = true; 87 | this.CurrentFileName.Location = new System.Drawing.Point(82, 102); 88 | this.CurrentFileName.Name = "CurrentFileName"; 89 | this.CurrentFileName.Size = new System.Drawing.Size(79, 13); 90 | this.CurrentFileName.TabIndex = 5; 91 | this.CurrentFileName.Text = "Some file name"; 92 | // 93 | // ProgressPercentage 94 | // 95 | this.ProgressPercentage.AutoSize = true; 96 | this.ProgressPercentage.Location = new System.Drawing.Point(85, 55); 97 | this.ProgressPercentage.Name = "ProgressPercentage"; 98 | this.ProgressPercentage.Size = new System.Drawing.Size(35, 13); 99 | this.ProgressPercentage.TabIndex = 6; 100 | this.ProgressPercentage.Text = "label4"; 101 | // 102 | // UploadProgression 103 | // 104 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 105 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 106 | this.ClientSize = new System.Drawing.Size(284, 125); 107 | this.Controls.Add(this.ProgressPercentage); 108 | this.Controls.Add(this.CurrentFileName); 109 | this.Controls.Add(this.label3); 110 | this.Controls.Add(this.label2); 111 | this.Controls.Add(this.label1); 112 | this.Controls.Add(this.TotalProgress); 113 | this.Controls.Add(this.FileProgress); 114 | this.MaximizeBox = false; 115 | this.Name = "UploadProgression"; 116 | this.Text = "UploadProgression"; 117 | this.ResumeLayout(false); 118 | this.PerformLayout(); 119 | 120 | } 121 | 122 | #endregion 123 | 124 | private ProgressBar FileProgress; 125 | private ProgressBar TotalProgress; 126 | private Label label1; 127 | private Label label2; 128 | private Label label3; 129 | private Label CurrentFileName; 130 | private Label ProgressPercentage; 131 | private BackgroundWorker uploadWorker; 132 | } 133 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/UploadProgression.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/ftp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Net; 6 | using System.Threading; 7 | using TechnicSolderHelper.cryptography; 8 | using TechnicSolderHelper.Confighandler; 9 | 10 | namespace TechnicSolderHelper.FileUpload 11 | { 12 | public class Ftp 13 | { 14 | private String _userName; 15 | private String _password; 16 | private String _url; 17 | 18 | public Ftp() 19 | { 20 | Crypto crypto = new Crypto(); 21 | ConfigHandler ch = new ConfigHandler(); 22 | _url = ch.GetConfig("ftpUrl"); 23 | try 24 | { 25 | _password = crypto.DecryptString(ch.GetConfig("ftpPassword")); 26 | } 27 | catch (Exception) 28 | { 29 | _password = ""; 30 | } 31 | _userName = ch.GetConfig("ftpUserName"); 32 | if (_url.EndsWith("/")) 33 | { 34 | _url.Remove(_url.Length - 1); 35 | } 36 | if (!_url.StartsWith("ftp://")) 37 | { 38 | _url = "ftp://" + _url; 39 | } 40 | } 41 | 42 | public void UploadFolder(String folderPath) 43 | { 44 | String[] files; 45 | if (Directory.Exists(folderPath)) { 46 | 47 | files = Directory.GetFiles(folderPath, "*.*", SearchOption.AllDirectories); 48 | } 49 | else 50 | { 51 | Debug.WriteLine("No files was created, so no reason to upload anything"); 52 | return; 53 | } 54 | MessageToUser m = new MessageToUser(); 55 | Thread startingThread = new Thread(m.UploadingToFtp); 56 | startingThread.Start(); 57 | 58 | foreach (String file in files) 59 | { 60 | UploadFile(file, file.Replace(folderPath + Globalfunctions.PathSeperator, ""), "mods"); 61 | } 62 | 63 | } 64 | 65 | private List GetDirectoryContent(String location) 66 | { 67 | List folderContent = new List(); 68 | FtpWebRequest request; 69 | if (location == null) 70 | { 71 | request = (FtpWebRequest)WebRequest.Create(_url); 72 | } 73 | else 74 | { 75 | request = (FtpWebRequest)WebRequest.Create(location); 76 | } 77 | request.Method = WebRequestMethods.Ftp.ListDirectory; 78 | 79 | request.Credentials = new NetworkCredential(_userName, _password); 80 | 81 | using (FtpWebResponse responce = (FtpWebResponse)request.GetResponse()) 82 | { 83 | Stream responceStream = responce.GetResponseStream(); 84 | using (StreamReader reader = new StreamReader(responceStream)) 85 | { 86 | while (true) 87 | { 88 | try 89 | { 90 | String s = reader.ReadLine(); 91 | if (s.Contains("/")) 92 | { 93 | s = s.Substring(s.LastIndexOf("/") + 1); 94 | } 95 | folderContent.Add(s); 96 | } 97 | catch (Exception) 98 | { 99 | break; 100 | } 101 | } 102 | } 103 | } 104 | 105 | return folderContent; 106 | } 107 | 108 | private void UploadFile(String fullyQualifiedPathName, String destinationOnServer, String constant) 109 | { 110 | GetDirectoryContent(null); 111 | if (constant != null) 112 | { 113 | destinationOnServer = constant + Globalfunctions.PathSeperator + destinationOnServer; 114 | } 115 | String[] tmp = destinationOnServer.Split(Globalfunctions.PathSeperator); 116 | List folders = new List(tmp); 117 | String fileToUpload = folders[folders.Count - 1]; 118 | folders.Remove(folders[folders.Count - 1]); 119 | for (int i = 0; i < folders.Count; i++) 120 | { 121 | folders[i] = folders[i].Replace(Globalfunctions.PathSeperator.ToString(), ""); 122 | } 123 | FtpWebRequest request = WebRequest.Create(_url) as FtpWebRequest; 124 | request.Credentials = new NetworkCredential(_userName, _password); 125 | foreach (String folder in folders) 126 | { 127 | List directoryContent = GetDirectoryContent(request.RequestUri.ToString()); 128 | if (directoryContent.Contains(folder)) 129 | { 130 | if (request.RequestUri.ToString().EndsWith("/")) 131 | { 132 | request = WebRequest.Create(request.RequestUri + folder) as FtpWebRequest; 133 | } 134 | else 135 | { 136 | request = WebRequest.Create(request.RequestUri + "/" + folder) as FtpWebRequest; 137 | } 138 | } 139 | else 140 | { 141 | if (request.RequestUri.ToString().EndsWith("/")) 142 | { 143 | request = WebRequest.Create(request.RequestUri + folder) as FtpWebRequest; 144 | } 145 | else 146 | { 147 | request = WebRequest.Create(request.RequestUri + "/" + folder) as FtpWebRequest; 148 | } 149 | request.Credentials = new NetworkCredential(_userName, _password); 150 | request.Method = WebRequestMethods.Ftp.MakeDirectory; 151 | try 152 | { 153 | FtpWebResponse responce = (FtpWebResponse)request.GetResponse(); 154 | } 155 | catch (WebException) 156 | { 157 | 158 | } 159 | } 160 | } 161 | 162 | try 163 | { 164 | request = WebRequest.Create(request.RequestUri + "/" + fileToUpload) as FtpWebRequest; 165 | request.Credentials = new NetworkCredential(_userName, _password); 166 | request.Method = WebRequestMethods.Ftp.UploadFile; 167 | request.UseBinary = true; 168 | request.UsePassive = true; 169 | request.KeepAlive = true; 170 | using (FileStream fs = File.OpenRead(fullyQualifiedPathName)) 171 | { 172 | byte[] buffer = new byte[fs.Length]; 173 | fs.Read(buffer, 0, buffer.Length); 174 | fs.Close(); 175 | Stream requestStream = request.GetRequestStream(); 176 | requestStream.Write(buffer, 0, buffer.Length); 177 | requestStream.Close(); 178 | requestStream.Flush(); 179 | } 180 | } 181 | catch (WebException) 182 | { 183 | //Console.WriteLine("error getting responce"); 184 | } 185 | } 186 | 187 | } 188 | } 189 | 190 | -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/ftpInfo.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.FileUpload 5 | { 6 | partial class FtpInfo 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.Username = new System.Windows.Forms.TextBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.Password = new System.Windows.Forms.TextBox(); 37 | this.label2 = new System.Windows.Forms.Label(); 38 | this.Host = new System.Windows.Forms.TextBox(); 39 | this.label3 = new System.Windows.Forms.Label(); 40 | this.Acceptbutton = new System.Windows.Forms.Button(); 41 | this.test = new System.Windows.Forms.Button(); 42 | this.button1 = new System.Windows.Forms.Button(); 43 | this.SuspendLayout(); 44 | // 45 | // Username 46 | // 47 | this.Username.Location = new System.Drawing.Point(12, 27); 48 | this.Username.Name = "Username"; 49 | this.Username.Size = new System.Drawing.Size(179, 20); 50 | this.Username.TabIndex = 0; 51 | // 52 | // label1 53 | // 54 | this.label1.AutoSize = true; 55 | this.label1.Location = new System.Drawing.Point(9, 11); 56 | this.label1.Name = "label1"; 57 | this.label1.Size = new System.Drawing.Size(55, 13); 58 | this.label1.TabIndex = 1; 59 | this.label1.Text = "Username"; 60 | // 61 | // Password 62 | // 63 | this.Password.Location = new System.Drawing.Point(12, 74); 64 | this.Password.Name = "Password"; 65 | this.Password.Size = new System.Drawing.Size(179, 20); 66 | this.Password.TabIndex = 1; 67 | this.Password.UseSystemPasswordChar = true; 68 | // 69 | // label2 70 | // 71 | this.label2.AutoSize = true; 72 | this.label2.Location = new System.Drawing.Point(9, 58); 73 | this.label2.Name = "label2"; 74 | this.label2.Size = new System.Drawing.Size(53, 13); 75 | this.label2.TabIndex = 1; 76 | this.label2.Text = "Password"; 77 | // 78 | // Host 79 | // 80 | this.Host.Location = new System.Drawing.Point(12, 120); 81 | this.Host.Name = "Host"; 82 | this.Host.Size = new System.Drawing.Size(179, 20); 83 | this.Host.TabIndex = 2; 84 | this.Host.Text = "ftp://"; 85 | this.Host.TextChanged += new System.EventHandler(this.Host_TextChanged); 86 | // 87 | // label3 88 | // 89 | this.label3.AutoSize = true; 90 | this.label3.Location = new System.Drawing.Point(9, 104); 91 | this.label3.Name = "label3"; 92 | this.label3.Size = new System.Drawing.Size(29, 13); 93 | this.label3.TabIndex = 1; 94 | this.label3.Text = "Host"; 95 | // 96 | // Acceptbutton 97 | // 98 | this.Acceptbutton.Location = new System.Drawing.Point(12, 146); 99 | this.Acceptbutton.Name = "Acceptbutton"; 100 | this.Acceptbutton.Size = new System.Drawing.Size(52, 26); 101 | this.Acceptbutton.TabIndex = 3; 102 | this.Acceptbutton.Text = "Accept"; 103 | this.Acceptbutton.UseVisualStyleBackColor = true; 104 | this.Acceptbutton.Click += new System.EventHandler(this.Acceptbutton_Click); 105 | // 106 | // test 107 | // 108 | this.test.Location = new System.Drawing.Point(70, 146); 109 | this.test.Name = "test"; 110 | this.test.Size = new System.Drawing.Size(55, 26); 111 | this.test.TabIndex = 4; 112 | this.test.Text = "test"; 113 | this.test.UseVisualStyleBackColor = true; 114 | this.test.Click += new System.EventHandler(this.test_Click); 115 | // 116 | // button1 117 | // 118 | this.button1.Location = new System.Drawing.Point(131, 146); 119 | this.button1.Name = "button1"; 120 | this.button1.Size = new System.Drawing.Size(60, 26); 121 | this.button1.TabIndex = 5; 122 | this.button1.Text = "Cancel"; 123 | this.button1.UseVisualStyleBackColor = true; 124 | this.button1.Click += new System.EventHandler(this.button1_Click); 125 | // 126 | // FtpInfo 127 | // 128 | this.AcceptButton = this.Acceptbutton; 129 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 130 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 131 | this.ClientSize = new System.Drawing.Size(203, 184); 132 | this.Controls.Add(this.button1); 133 | this.Controls.Add(this.test); 134 | this.Controls.Add(this.Acceptbutton); 135 | this.Controls.Add(this.label3); 136 | this.Controls.Add(this.label2); 137 | this.Controls.Add(this.label1); 138 | this.Controls.Add(this.Host); 139 | this.Controls.Add(this.Password); 140 | this.Controls.Add(this.Username); 141 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 142 | this.Name = "FtpInfo"; 143 | this.Text = "ftpInfo"; 144 | this.ResumeLayout(false); 145 | this.PerformLayout(); 146 | 147 | } 148 | 149 | #endregion 150 | 151 | private TextBox Username; 152 | private Label label1; 153 | private TextBox Password; 154 | private Label label2; 155 | private TextBox Host; 156 | private Label label3; 157 | private Button Acceptbutton; 158 | private Button test; 159 | private Button button1; 160 | } 161 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/ftpInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Windows.Forms; 4 | using TechnicSolderHelper.cryptography; 5 | using TechnicSolderHelper.Confighandler; 6 | 7 | namespace TechnicSolderHelper.FileUpload 8 | { 9 | public partial class FtpInfo : Form 10 | { 11 | public FtpInfo() 12 | { 13 | InitializeComponent(); 14 | String url = ""; 15 | String username = ""; 16 | String pass = ""; 17 | Crypto crypto = new Crypto(); 18 | try 19 | { 20 | ConfigHandler ch = new ConfigHandler(); 21 | url = ch.GetConfig("ftpUrl"); 22 | username = ch.GetConfig("ftpUserName"); 23 | pass = crypto.DecryptString(ch.GetConfig("ftpPassword")); 24 | } 25 | catch (Exception) 26 | { 27 | // ignored 28 | } 29 | Username.Text = username; 30 | Password.Text = pass; 31 | Host.Text = url; 32 | } 33 | 34 | private void Acceptbutton_Click(object sender, EventArgs e) 35 | { 36 | if (String.IsNullOrWhiteSpace(Username.Text) || String.IsNullOrWhiteSpace(Password.Text) || String.IsNullOrWhiteSpace(Host.Text)) 37 | { 38 | MessageBox.Show("Please fill out all values"); 39 | } 40 | else 41 | { 42 | String url = Host.Text; 43 | if (Uri.IsWellFormedUriString(url, UriKind.Absolute)) 44 | { 45 | Crypto crypto = new Crypto(); 46 | ConfigHandler ch = new ConfigHandler(); 47 | ch.SetConfig("ftpUserName", Username.Text); 48 | ch.SetConfig("ftpUrl", url); 49 | ch.SetConfig("ftpPassword", crypto.EncryptToString(Password.Text)); 50 | Close(); 51 | } 52 | else 53 | { 54 | MessageBox.Show("Hostname is not valid"); 55 | } 56 | 57 | } 58 | } 59 | 60 | private void test_Click(object sender, EventArgs e) 61 | { 62 | String url = Host.Text; 63 | String name = Username.Text; 64 | String pass = Password.Text; 65 | 66 | MessageBox.Show(IsValidConnection(url, name, pass)); 67 | } 68 | 69 | private String IsValidConnection(string url, string user, string password) 70 | { 71 | if (Uri.IsWellFormedUriString(url, UriKind.Absolute)) 72 | { 73 | try 74 | { 75 | FtpWebRequest request = (FtpWebRequest)WebRequest.Create(url); 76 | request.Method = WebRequestMethods.Ftp.ListDirectory; 77 | request.Credentials = new NetworkCredential(user, password); 78 | request.GetResponse(); 79 | } 80 | catch (WebException ex) 81 | { 82 | return ex.Message; 83 | } 84 | return "All is working fine!!"; 85 | } 86 | return "Invalid hostname"; 87 | } 88 | 89 | private void button1_Click(object sender, EventArgs e) 90 | { 91 | Close(); 92 | } 93 | 94 | private void Host_TextChanged(object sender, EventArgs e) 95 | { 96 | if (!Host.Text.StartsWith("ftp://")) 97 | { 98 | Host.Text = "ftp://" + Host.Text; 99 | } 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /TechnicSolderHelper/FileUpload/ftpInfo.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Litemod.cs: -------------------------------------------------------------------------------- 1 | namespace TechnicSolderHelper 2 | { 3 | public class Litemod 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Mcversion { get; set; } 8 | 9 | public string Version { get; set; } 10 | 11 | public string Revision { get; set; } 12 | 13 | public string Author { get; set; } 14 | 15 | public string Description { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/Modlist.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TechnicSolderHelper 4 | { 5 | public class Modlist 6 | { 7 | public string Modid { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string Description { get; set; } 12 | 13 | public string Version { get; set; } 14 | 15 | public string Mcversion { get; set; } 16 | 17 | public string Url { get; set; } 18 | 19 | public List Authors { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/MoreLinq/MoreEnumerable.DistinctBy.cs: -------------------------------------------------------------------------------- 1 | #region License and Terms 2 | // MoreLINQ - Extensions to LINQ to Objects 3 | // Copyright (c) 2008 Jonathan Skeet. All rights reserved. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | #endregion 17 | 18 | 19 | #if NO_HASHSET 20 | using System.Linq; 21 | #endif 22 | 23 | namespace MoreLinq 24 | { 25 | using System; 26 | using System.Collections.Generic; 27 | 28 | static partial class MoreEnumerable 29 | { 30 | /// 31 | /// Returns all distinct elements of the given source, where "distinctness" 32 | /// is determined via a projection and the default equality comparer for the projected type. 33 | /// 34 | /// 35 | /// This operator uses deferred execution and streams the results, although 36 | /// a set of already-seen keys is retained. If a key is seen multiple times, 37 | /// only the first element with that key is returned. 38 | /// 39 | /// Type of the source sequence 40 | /// Type of the projected element 41 | /// Source sequence 42 | /// Projection for determining "distinctness" 43 | /// A sequence consisting of distinct elements from the source sequence, 44 | /// comparing them by the specified key projection. 45 | 46 | public static IEnumerable DistinctBy(this IEnumerable source, 47 | Func keySelector) 48 | { 49 | return source.DistinctBy(keySelector, null); 50 | } 51 | 52 | /// 53 | /// Returns all distinct elements of the given source, where "distinctness" 54 | /// is determined via a projection and the specified comparer for the projected type. 55 | /// 56 | /// 57 | /// This operator uses deferred execution and streams the results, although 58 | /// a set of already-seen keys is retained. If a key is seen multiple times, 59 | /// only the first element with that key is returned. 60 | /// 61 | /// Type of the source sequence 62 | /// Type of the projected element 63 | /// Source sequence 64 | /// Projection for determining "distinctness" 65 | /// The equality comparer to use to determine whether or not keys are equal. 66 | /// If null, the default equality comparer for TSource is used. 67 | /// A sequence consisting of distinct elements from the source sequence, 68 | /// comparing them by the specified key projection. 69 | 70 | public static IEnumerable DistinctBy(this IEnumerable source, 71 | Func keySelector, IEqualityComparer comparer) 72 | { 73 | if (source == null) throw new ArgumentNullException("source"); 74 | if (keySelector == null) throw new ArgumentNullException("keySelector"); 75 | return DistinctByImpl(source, keySelector, comparer); 76 | } 77 | 78 | private static IEnumerable DistinctByImpl(IEnumerable source, 79 | Func keySelector, IEqualityComparer comparer) 80 | { 81 | #if !NO_HASHSET 82 | var knownKeys = new HashSet(comparer); 83 | foreach (var element in source) 84 | { 85 | if (knownKeys.Add(keySelector(element))) 86 | { 87 | yield return element; 88 | } 89 | } 90 | #else 91 | // 92 | // On platforms where LINQ is available but no HashSet 93 | // (like on Silverlight), implement this operator using 94 | // existing LINQ operators. Using GroupBy is slightly less 95 | // efficient since it has do all the grouping work before 96 | // it can start to yield any one element from the source. 97 | // 98 | 99 | return source.GroupBy(keySelector, comparer).Select(g => g.First()); 100 | #endif 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper 5 | { 6 | class Program 7 | { 8 | [STAThread] 9 | static void Main() 10 | { 11 | Application.EnableVisualStyles(); 12 | Application.SetCompatibleTextRenderingDefault(false); 13 | Application.Run(new SolderHelper()); 14 | 15 | } 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Prompt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper 5 | { 6 | public static class Prompt 7 | { 8 | 9 | 10 | public static string ShowDialog(string text, string caption, Boolean showSkip = true, String extraText = null) 11 | { 12 | Form prompt = new Form 13 | { 14 | Width = 500, 15 | Height = 180, 16 | Text = caption, 17 | StartPosition = FormStartPosition.CenterScreen 18 | }; 19 | Label textLabel = new Label { Left = 50, Top = 20, Text = text, Width = 350, Height = 80 }; 20 | if (extraText != null) 21 | { 22 | Label extraLabel = new Label { Left = 20, Top = 110, Text = extraText, Width = 200 }; 23 | prompt.Controls.Add(extraLabel); 24 | } 25 | TextBox textBox = new TextBox { Left = 50, Top = 80, Width = 400 }; 26 | Button confirmation = new Button { Text = "Ok", Left = 350, Width = 100, Top = 110 }; 27 | confirmation.Click += (sender, e) => prompt.Close(); 28 | prompt.Controls.Add(textBox); 29 | prompt.Controls.Add(confirmation); 30 | prompt.Controls.Add(textLabel); 31 | prompt.AcceptButton = confirmation; 32 | Button skip = new Button { Text = "Skip", Left = 240, Width = 100, Top = 110, Visible = showSkip }; 33 | skip.Click += (sender, e) => 34 | { 35 | textBox.Text = @"skip"; 36 | prompt.Close(); 37 | }; 38 | prompt.Controls.Add(skip); 39 | if (showSkip) 40 | { 41 | prompt.CancelButton = skip; 42 | } 43 | prompt.ShowDialog(); 44 | return textBox.Text; 45 | } 46 | 47 | public static String ModsLeftString(short totalmods, short currentMod) { 48 | return String.Format("You are at mod {0} of {1} mods total", currentMod, totalmods); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /TechnicSolderHelper/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("TechnicSolderHelper")] 8 | [assembly: AssemblyDescription("Helps packing mod files for the Technic Solder")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TechnicSolderHelper")] 12 | [assembly: AssemblyCopyright("Copyright © Rasmus Hansen 2015")] 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("2d2fed2a-b6a2-4a88-9d00-cfeee2eb07a0")] 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.0.*")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System.CodeDom.Compiler; 12 | using System.Configuration; 13 | using System.Runtime.CompilerServices; 14 | 15 | namespace TechnicSolderHelper.Properties { 16 | 17 | 18 | [CompilerGenerated()] 19 | [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 20 | internal sealed partial class Settings : ApplicationSettingsBase { 21 | 22 | private static Settings defaultInstance = ((Settings)(Synchronized(new Settings()))); 23 | 24 | public static Settings Default { 25 | get { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TechnicSolderHelper/ReadOnlyRadioButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper 5 | { 6 | public class ReadOnlyRadioButton : RadioButton 7 | { 8 | protected override void OnClick(EventArgs e) 9 | { 10 | // pass the event up only if its not readlonly 11 | if (!ReadOnly) base.OnClick(e); 12 | } 13 | 14 | public bool ReadOnly { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Run SolderHelper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh technicsolderhelper -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/DatabaseEditor.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.SQL 5 | { 6 | partial class DatabaseEditor 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.data = new System.Windows.Forms.DataGridView(); 35 | this.Save = new System.Windows.Forms.Button(); 36 | this.Cancel = new System.Windows.Forms.Button(); 37 | this.SaveAndExit = new System.Windows.Forms.Button(); 38 | this.highLightVerBtn = new System.Windows.Forms.Button(); 39 | ((System.ComponentModel.ISupportInitialize)(this.data)).BeginInit(); 40 | this.SuspendLayout(); 41 | // 42 | // data 43 | // 44 | this.data.AllowUserToAddRows = false; 45 | this.data.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 46 | | System.Windows.Forms.AnchorStyles.Left) 47 | | System.Windows.Forms.AnchorStyles.Right))); 48 | this.data.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader; 49 | this.data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 50 | this.data.Location = new System.Drawing.Point(13, 13); 51 | this.data.Name = "data"; 52 | this.data.Size = new System.Drawing.Size(672, 533); 53 | this.data.TabIndex = 0; 54 | this.data.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.data_CellContentClick); 55 | // 56 | // Save 57 | // 58 | this.Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 59 | this.Save.Location = new System.Drawing.Point(16, 564); 60 | this.Save.Name = "Save"; 61 | this.Save.Size = new System.Drawing.Size(121, 28); 62 | this.Save.TabIndex = 1; 63 | this.Save.Text = "Save"; 64 | this.Save.UseVisualStyleBackColor = true; 65 | this.Save.Click += new System.EventHandler(this.Save_Click); 66 | // 67 | // Cancel 68 | // 69 | this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 70 | this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 71 | this.Cancel.Location = new System.Drawing.Point(567, 562); 72 | this.Cancel.Name = "Cancel"; 73 | this.Cancel.Size = new System.Drawing.Size(118, 32); 74 | this.Cancel.TabIndex = 2; 75 | this.Cancel.Text = "Cancel"; 76 | this.Cancel.UseVisualStyleBackColor = true; 77 | this.Cancel.Click += new System.EventHandler(this.Cancel_Click); 78 | // 79 | // SaveAndExit 80 | // 81 | this.SaveAndExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 82 | this.SaveAndExit.Location = new System.Drawing.Point(144, 564); 83 | this.SaveAndExit.Name = "SaveAndExit"; 84 | this.SaveAndExit.Size = new System.Drawing.Size(106, 28); 85 | this.SaveAndExit.TabIndex = 3; 86 | this.SaveAndExit.Text = "Save And Exit"; 87 | this.SaveAndExit.UseVisualStyleBackColor = true; 88 | this.SaveAndExit.Click += new System.EventHandler(this.SaveAndExit_Click); 89 | // 90 | // highLightVerBtn 91 | // 92 | this.highLightVerBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 93 | this.highLightVerBtn.Location = new System.Drawing.Point(267, 564); 94 | this.highLightVerBtn.Name = "highLightVerBtn"; 95 | this.highLightVerBtn.Size = new System.Drawing.Size(145, 28); 96 | this.highLightVerBtn.TabIndex = 4; 97 | this.highLightVerBtn.Text = "Highlight Odd ModVersions"; 98 | this.highLightVerBtn.UseVisualStyleBackColor = true; 99 | this.highLightVerBtn.Click += new System.EventHandler(this.highLightVerBtn_Click); 100 | // 101 | // DatabaseEditor 102 | // 103 | this.AcceptButton = this.SaveAndExit; 104 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 105 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 106 | this.CancelButton = this.Cancel; 107 | this.ClientSize = new System.Drawing.Size(691, 608); 108 | this.Controls.Add(this.highLightVerBtn); 109 | this.Controls.Add(this.SaveAndExit); 110 | this.Controls.Add(this.Cancel); 111 | this.Controls.Add(this.Save); 112 | this.Controls.Add(this.data); 113 | this.Name = "DatabaseEditor"; 114 | this.Text = "DatabaseEditor"; 115 | ((System.ComponentModel.ISupportInitialize)(this.data)).EndInit(); 116 | this.ResumeLayout(false); 117 | 118 | } 119 | 120 | #endregion 121 | 122 | private DataGridView data; 123 | private Button Save; 124 | private Button Cancel; 125 | private Button SaveAndExit; 126 | private Button highLightVerBtn; 127 | } 128 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/DatabaseEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | 6 | namespace TechnicSolderHelper.SQL 7 | { 8 | public partial class DatabaseEditor : Form 9 | { 10 | public DatabaseEditor() 11 | { 12 | InitializeComponent(); 13 | ModListSqlHelper modListSqlHelper = new ModListSqlHelper(); 14 | data.DataSource = modListSqlHelper.GetTableInfoForEditing(); 15 | if (data.Columns["ID"] != null) 16 | { 17 | data.Columns["ID"].Visible = false; 18 | } 19 | } 20 | 21 | private void Save_Click(object sender, EventArgs e) 22 | { 23 | ModListSqlHelper modListSqlHelper = new ModListSqlHelper(); 24 | modListSqlHelper.SetTableInfoAfterEditing(data.DataSource as DataTable); 25 | } 26 | 27 | private void Cancel_Click(object sender, EventArgs e) 28 | { 29 | Close(); 30 | } 31 | 32 | private void SaveAndExit_Click(object sender, EventArgs e) 33 | { 34 | Save_Click(null, null); 35 | Close(); 36 | } 37 | 38 | private void data_CellContentClick(object sender, DataGridViewCellEventArgs e) 39 | { 40 | 41 | } 42 | 43 | private void highLightVerBtn_Click(object sender, EventArgs e) 44 | { 45 | var dataGridViewColumn = data.Columns["ModVersion"]; 46 | if (dataGridViewColumn == null) return; 47 | int modVersionIndex = dataGridViewColumn.Index; 48 | var gridViewColumn = data.Columns["MinecraftVersion"]; 49 | if (gridViewColumn == null) return; 50 | int minecraftVersionIndex = gridViewColumn.Index; 51 | foreach (DataGridViewRow row in data.Rows) 52 | { 53 | //Here 2 cell is target value and 1 cell is Volume 54 | data.Rows[row.Index].Cells[modVersionIndex].Style.BackColor = row.Cells[modVersionIndex].Value.ToString().Contains(row.Cells[minecraftVersionIndex].Value.ToString()) ? Color.Red : Color.White; 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/DatabaseEditor.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/FTBPermissionsSQLHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SQLite; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.IO.Abstractions; 7 | using System.Linq; 8 | using System.Net.Http; 9 | using Mono.Data.Sqlite; 10 | using Newtonsoft.Json; 11 | 12 | namespace TechnicSolderHelper.SQL 13 | { 14 | public class FtbPermissionsSqlHelper 15 | { 16 | public static readonly string PermissionsFile = 17 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SolderHelper", 18 | "permissions.json"); 19 | 20 | private readonly IFileSystem _fileSystem; 21 | private List _permissions; 22 | 23 | public FtbPermissionsSqlHelper(IFileSystem fileSystem) 24 | { 25 | _fileSystem = fileSystem; 26 | Load(); 27 | } 28 | 29 | public FtbPermissionsSqlHelper() 30 | : this(new FileSystem()) 31 | { 32 | } 33 | 34 | public string GetShortName(string modId) 35 | { 36 | if (string.IsNullOrWhiteSpace(modId)) 37 | { 38 | return ""; 39 | } 40 | else 41 | { 42 | Permission permission = _permissions.SingleOrDefault(p => p.modids.Contains(modId)); 43 | return permission == null ? "" : permission.shortName; 44 | } 45 | } 46 | 47 | public Permission GetPermissionFromShortname(string shortname) 48 | { 49 | return _permissions.SingleOrDefault(p => p.shortName.Equals(shortname)); 50 | } 51 | 52 | public Permission GetPermissionFromModId(string modId) 53 | { 54 | return string.IsNullOrWhiteSpace(modId) ? null : _permissions.FirstOrDefault(p => p.modids.Contains(modId)); 55 | } 56 | 57 | public PermissionPolicy FindPermissionPolicy(string toCheck, bool isPublic) 58 | { 59 | if (string.IsNullOrWhiteSpace(toCheck)) 60 | { 61 | return PermissionPolicy.Unknown; 62 | } 63 | else 64 | { 65 | Permission perm = 66 | _permissions.FirstOrDefault(p => p.modids.Contains(toCheck) || p.shortName.Equals(toCheck)); 67 | if (perm == null) return PermissionPolicy.Unknown; 68 | return isPublic ? perm.publicPolicy : perm.privatePolicy; 69 | } 70 | } 71 | 72 | private void Load() 73 | { 74 | if (_fileSystem.File.Exists(PermissionsFile)) 75 | using (Stream s = _fileSystem.File.OpenRead(PermissionsFile)) 76 | using (StreamReader sr = new StreamReader(s)) 77 | using (JsonReader reader = new JsonTextReader(sr)) 78 | { 79 | JsonSerializer serializer = new JsonSerializer(); 80 | _permissions = serializer.Deserialize>(reader); 81 | } 82 | else 83 | LoadOnlinePermissions(); 84 | } 85 | 86 | private void Save() 87 | { 88 | string json = JsonConvert.SerializeObject(_permissions); 89 | _fileSystem.File.WriteAllText(PermissionsFile, json); 90 | } 91 | 92 | public void LoadOnlinePermissions() 93 | { 94 | List permissions; 95 | HttpClient client = new HttpClient(); 96 | try 97 | { 98 | using (Stream s = client.GetStreamAsync("http://www.feed-the-beast.com/mods/json").Result) 99 | using (StreamReader sr = new StreamReader(s)) 100 | using (JsonReader reader = new JsonTextReader(sr)) 101 | { 102 | JsonSerializer serializer = new JsonSerializer(); 103 | 104 | // read the json from a stream 105 | // json size doesn't matter because only a small piece is read at a time from the HTTP request 106 | permissions = serializer.Deserialize>(reader); 107 | } 108 | _permissions = new List(); 109 | foreach (Permission p in permissions.Where(p => !String.IsNullOrWhiteSpace(p.privateStringPolicy) && 110 | !String.IsNullOrWhiteSpace(p.publicStringPolicy))) 111 | { 112 | PermissionPolicy pp; 113 | bool r = Enum.TryParse(p.privateStringPolicy, out pp); 114 | if (r) 115 | { 116 | p.privatePolicy = pp; 117 | } 118 | r = Enum.TryParse(p.publicStringPolicy, out pp); 119 | if (r) p.publicPolicy = pp; 120 | p.privateStringPolicy = null; 121 | p.publicStringPolicy = null; 122 | _permissions.Add(p); 123 | } 124 | Save(); 125 | } 126 | catch (Exception) 127 | { 128 | _permissions = new List(); 129 | 130 | } 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/Mono.Data.Sqlite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/TechnicSolderHelper/SQL/Mono.Data.Sqlite.dll -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/SQLhelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SQLite; 4 | using System.IO; 5 | using System.Security.Cryptography; 6 | using System.Threading; 7 | using Mono.Data.Sqlite; 8 | 9 | namespace TechnicSolderHelper.SQL 10 | { 11 | public abstract class SqlHelper 12 | { 13 | protected SqlHelper(String tableName) 14 | { 15 | Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SolderHelper")); 16 | String databaseName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SolderHelper", "SolderHelper.db"); 17 | try 18 | { 19 | if (!File.Exists(databaseName)) 20 | { 21 | if (IsUnix()) 22 | { 23 | SqliteConnection.CreateFile(databaseName); 24 | } 25 | else 26 | { 27 | SQLiteConnection.CreateFile(databaseName); 28 | } 29 | } 30 | } 31 | catch (Exception) 32 | { 33 | // ignored 34 | } 35 | if (IsUnix()) 36 | { 37 | SqliteConnectionStringBuilder c = new SqliteConnectionStringBuilder { DataSource = databaseName }; 38 | ConnectionString = c.ConnectionString; 39 | } 40 | else 41 | { 42 | SQLiteConnectionStringBuilder c = new SQLiteConnectionStringBuilder { DataSource = databaseName }; 43 | ConnectionString = c.ConnectionString; 44 | } 45 | TableName = tableName; 46 | } 47 | protected readonly String TableName; 48 | protected readonly String ConnectionString; 49 | 50 | protected static Boolean IsUnix() 51 | { 52 | return Environment.OSVersion.ToString().ToLower().Contains("unix"); 53 | } 54 | 55 | protected void ExecuteDatabaseQuery(String sql, Boolean async = false) 56 | { 57 | if (IsUnix()) 58 | { 59 | try 60 | { 61 | using (SqliteConnection db = new SqliteConnection(ConnectionString)) 62 | { 63 | db.Open(); 64 | using (SqliteCommand cmd = new SqliteCommand(sql, db)) 65 | { 66 | if (async) 67 | { 68 | cmd.ExecuteNonQueryAsync(); 69 | } 70 | else 71 | { 72 | cmd.ExecuteNonQuery(); 73 | } 74 | } 75 | } 76 | } 77 | catch (Exception) 78 | { 79 | // ignored 80 | } 81 | } 82 | else 83 | { 84 | /*try 85 | {*/ 86 | using (SQLiteConnection db = new SQLiteConnection(ConnectionString)) 87 | { 88 | db.Open(); 89 | using (SQLiteCommand cmd = new SQLiteCommand(sql, db)) 90 | { 91 | if (async) 92 | { 93 | cmd.ExecuteNonQueryAsync(); 94 | } 95 | else 96 | { 97 | cmd.ExecuteNonQuery(); 98 | } 99 | } 100 | } 101 | /* } 102 | catch (Exception) 103 | { 104 | // ignored 105 | }*/ 106 | } 107 | } 108 | 109 | public virtual void ResetTable() 110 | { 111 | String sql = String.Format("DROP TABLE {0};", TableName); 112 | ExecuteDatabaseQuery(sql); 113 | } 114 | 115 | 116 | private static Dictionary md5Cache = new Dictionary(); 117 | 118 | public static String CalculateMd5(string file) 119 | { 120 | if (md5Cache.ContainsKey(file)) 121 | { 122 | return md5Cache[file]; 123 | } 124 | using (var md5 = MD5.Create()) 125 | { 126 | while (true) 127 | { 128 | try 129 | { 130 | using (var stream = File.OpenRead(file)) 131 | { 132 | string hash = BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", string.Empty); 133 | md5Cache.Add(file, hash); 134 | return hash; 135 | } 136 | } 137 | catch 138 | { 139 | Thread.Sleep(100); 140 | } 141 | } 142 | } 143 | } 144 | } 145 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/forge/ForgeVersionSelector.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.SQL.forge 5 | { 6 | partial class ForgeVersionSelector 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.label1 = new System.Windows.Forms.Label(); 35 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 36 | this.button1 = new System.Windows.Forms.Button(); 37 | this.SuspendLayout(); 38 | // 39 | // label1 40 | // 41 | this.label1.AutoSize = true; 42 | this.label1.Location = new System.Drawing.Point(12, 9); 43 | this.label1.Name = "label1"; 44 | this.label1.Size = new System.Drawing.Size(239, 26); 45 | this.label1.TabIndex = 0; 46 | this.label1.Text = "Selected forge version could not be downloaded.\r\nPlease select a new version."; 47 | // 48 | // comboBox1 49 | // 50 | this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 51 | this.comboBox1.FormattingEnabled = true; 52 | this.comboBox1.Location = new System.Drawing.Point(66, 38); 53 | this.comboBox1.Name = "comboBox1"; 54 | this.comboBox1.Size = new System.Drawing.Size(121, 21); 55 | this.comboBox1.TabIndex = 1; 56 | // 57 | // button1 58 | // 59 | this.button1.Location = new System.Drawing.Point(66, 66); 60 | this.button1.Name = "button1"; 61 | this.button1.Size = new System.Drawing.Size(121, 23); 62 | this.button1.TabIndex = 2; 63 | this.button1.Text = "Confirm"; 64 | this.button1.UseVisualStyleBackColor = true; 65 | this.button1.Click += new System.EventHandler(this.button1_Click); 66 | // 67 | // ForgeVersionSelector 68 | // 69 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 70 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 71 | this.ClientSize = new System.Drawing.Size(259, 107); 72 | this.Controls.Add(this.button1); 73 | this.Controls.Add(this.comboBox1); 74 | this.Controls.Add(this.label1); 75 | this.Name = "ForgeVersionSelector"; 76 | this.Text = "Forge Version"; 77 | this.ResumeLayout(false); 78 | this.PerformLayout(); 79 | 80 | } 81 | 82 | #endregion 83 | 84 | private Label label1; 85 | private ComboBox comboBox1; 86 | private Button button1; 87 | } 88 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/forge/ForgeVersionSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace TechnicSolderHelper.SQL.forge 6 | { 7 | public partial class ForgeVersionSelector : Form 8 | { 9 | private readonly SolderHelper _solderHelper; 10 | public ForgeVersionSelector(SolderHelper solderHelper) 11 | { 12 | _solderHelper = solderHelper; 13 | InitializeComponent(); 14 | ForgeSqlHelper helper = new ForgeSqlHelper(); 15 | List forgeVersions = helper.GetForgeVersions(solderHelper._currentMcVersion); 16 | comboBox1.Items.AddRange(forgeVersions.ToArray()); 17 | comboBox1.SelectedIndex = comboBox1.Items.Count - 1; 18 | } 19 | 20 | private void button1_Click(object sender, EventArgs e) 21 | { 22 | string version = comboBox1.SelectedItem.ToString(); 23 | _solderHelper.PackForge(version); 24 | Close(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/forge/ForgeVersionSelector.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/forge/forgemaven.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TechnicSolderHelper.SQL.forge 4 | { 5 | public class Forgemaven 6 | { 7 | 8 | public Dictionary Number { get; set; } 9 | 10 | public string Webpath { get; set; } 11 | } 12 | 13 | public class Number 14 | { 15 | 16 | public int Build { get; set; } 17 | 18 | public string Jobver { get; set; } 19 | 20 | public string Mcversion { get; set; } 21 | 22 | public string Version { get; set; } 23 | 24 | public string Downloadurl { get; set; } 25 | 26 | public string Branch { get; set; } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/ftbPermissions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | // ReSharper disable InconsistentNaming 4 | 5 | namespace TechnicSolderHelper.SQL 6 | { 7 | public class Permission 8 | { 9 | public string modName { get; set; } 10 | public string modAuthors { get; set; } 11 | public string licenseLink { get; set; } 12 | public string modLink { get; set; } 13 | public string privateLicenceLink { get; set; } 14 | public string privateStringPolicy { get; set; } 15 | public PermissionPolicy privatePolicy { get; set; } 16 | public string publicStringPolicy { get; set; } 17 | public PermissionPolicy publicPolicy { get; set; } 18 | public string modids { get; set; } 19 | public string customData { get; set; } 20 | public string shortName { get; set; } 21 | } 22 | 23 | public enum PermissionPolicy 24 | { 25 | Open, 26 | Notify, 27 | Request, 28 | Unknown, 29 | FTB, 30 | Closed 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/liteloader/liteloader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SQLite; 4 | using System.Diagnostics; 5 | using Mono.Data.Sqlite; 6 | 7 | namespace TechnicSolderHelper.SQL.liteloader 8 | { 9 | public class Liteloader 10 | { 11 | public Meta Meta { get; set; } 12 | 13 | public Dictionary Versions { get; set; } 14 | } 15 | 16 | public class Meta 17 | { 18 | public String Description { get; set; } 19 | 20 | public String Authors { get; set; } 21 | 22 | public String Url { get; set; } 23 | } 24 | 25 | public class Versions 26 | { 27 | public Dictionary> Artefacts { get; set; } 28 | } 29 | 30 | public class Versionclass 31 | { 32 | public String TweakClass { get; set; } 33 | 34 | public String File { get; set; } 35 | 36 | public String Version { get; set; } 37 | 38 | public String Md5 { get; set; } 39 | 40 | public string Timestamp { get; set; } 41 | } 42 | 43 | public class Liteloaderversion 44 | { 45 | public String File { get; set; } 46 | 47 | public String Version{ get; set; } 48 | 49 | public String Md5{ get; set; } 50 | 51 | public String Mcversion{ get; set; } 52 | 53 | public String TweakClass{ get; set; } 54 | } 55 | 56 | public class LiteloaderSqlHelper : SqlHelper 57 | { 58 | protected readonly String CreateTableString; 59 | 60 | public LiteloaderSqlHelper() 61 | : base("liteloader") 62 | { 63 | CreateTableString = "CREATE TABLE IF NOT EXISTS 'liteloader' (file TEXT, version TEXT, md5 TEXT UNIQUE, mcversion TEXT, tweakClass TEXT, PRIMARY KEY(md5));"; 64 | ExecuteDatabaseQuery(CreateTableString); 65 | } 66 | 67 | public void AddVersion(String file, String version, String md5, String mcversion, String tweakClass) 68 | { 69 | String sql = String.Format("INSERT OR REPLACE INTO {0} ('file', 'version', 'md5', 'mcversion', 'tweakClass') VALUES ('{1}','{2}','{3}','{4}','{5}');", TableName, file, version, md5, mcversion, tweakClass); 70 | Debug.WriteLine(sql); 71 | ExecuteDatabaseQuery(sql); 72 | } 73 | 74 | public Liteloaderversion GetInfo(String md5) 75 | { 76 | String sql = String.Format("SELECT * FROM {0} WHERE md5 LIKE '{1}';", TableName, md5); 77 | Liteloaderversion llversion = new Liteloaderversion(); 78 | if (IsUnix()) 79 | { 80 | using (SqliteConnection db = new SqliteConnection(ConnectionString)) 81 | { 82 | db.Open(); 83 | using (SqliteCommand cmd = new SqliteCommand(sql, db)) 84 | { 85 | using (SqliteDataReader reader = cmd.ExecuteReader()) 86 | { 87 | while (reader.Read()) 88 | { 89 | llversion.Md5 = reader["md5"].ToString(); 90 | llversion.Mcversion = reader["mcversion"].ToString(); 91 | llversion.Version = reader["version"].ToString(); 92 | llversion.File = reader["file"].ToString(); 93 | llversion.TweakClass = reader["tweakClass"].ToString(); 94 | } 95 | 96 | return llversion; 97 | } 98 | } 99 | } 100 | } 101 | using (SQLiteConnection db = new SQLiteConnection(ConnectionString)) 102 | { 103 | db.Open(); 104 | using (SQLiteCommand cmd = new SQLiteCommand(sql, db)) 105 | { 106 | using (SQLiteDataReader reader = cmd.ExecuteReader()) 107 | { 108 | while (reader.Read()) 109 | { 110 | llversion.Md5 = reader["md5"].ToString(); 111 | llversion.Mcversion = reader["mcversion"].ToString(); 112 | llversion.Version = reader["version"].ToString(); 113 | llversion.File = reader["file"].ToString(); 114 | llversion.TweakClass = reader["tweakClass"].ToString(); 115 | } 116 | 117 | return llversion; 118 | } 119 | } 120 | } 121 | } 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/sqlInfo.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.SQL 5 | { 6 | partial class SqlInfo 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.serveraddress = new System.Windows.Forms.TextBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.database = new System.Windows.Forms.TextBox(); 37 | this.label2 = new System.Windows.Forms.Label(); 38 | this.username = new System.Windows.Forms.TextBox(); 39 | this.label3 = new System.Windows.Forms.Label(); 40 | this.password = new System.Windows.Forms.TextBox(); 41 | this.label4 = new System.Windows.Forms.Label(); 42 | this.button1 = new System.Windows.Forms.Button(); 43 | this.button2 = new System.Windows.Forms.Button(); 44 | this.button3 = new System.Windows.Forms.Button(); 45 | this.Prefix = new System.Windows.Forms.TextBox(); 46 | this.label5 = new System.Windows.Forms.Label(); 47 | this.SuspendLayout(); 48 | // 49 | // serveraddress 50 | // 51 | this.serveraddress.Location = new System.Drawing.Point(12, 25); 52 | this.serveraddress.Name = "serveraddress"; 53 | this.serveraddress.Size = new System.Drawing.Size(170, 20); 54 | this.serveraddress.TabIndex = 0; 55 | // 56 | // label1 57 | // 58 | this.label1.AutoSize = true; 59 | this.label1.Location = new System.Drawing.Point(12, 9); 60 | this.label1.Name = "label1"; 61 | this.label1.Size = new System.Drawing.Size(78, 13); 62 | this.label1.TabIndex = 1; 63 | this.label1.Text = "Server address"; 64 | // 65 | // database 66 | // 67 | this.database.Location = new System.Drawing.Point(12, 142); 68 | this.database.Name = "database"; 69 | this.database.Size = new System.Drawing.Size(170, 20); 70 | this.database.TabIndex = 3; 71 | // 72 | // label2 73 | // 74 | this.label2.AutoSize = true; 75 | this.label2.Location = new System.Drawing.Point(12, 126); 76 | this.label2.Name = "label2"; 77 | this.label2.Size = new System.Drawing.Size(53, 13); 78 | this.label2.TabIndex = 1; 79 | this.label2.Text = "Database"; 80 | // 81 | // username 82 | // 83 | this.username.Location = new System.Drawing.Point(12, 64); 84 | this.username.Name = "username"; 85 | this.username.Size = new System.Drawing.Size(170, 20); 86 | this.username.TabIndex = 1; 87 | // 88 | // label3 89 | // 90 | this.label3.AutoSize = true; 91 | this.label3.Location = new System.Drawing.Point(12, 48); 92 | this.label3.Name = "label3"; 93 | this.label3.Size = new System.Drawing.Size(55, 13); 94 | this.label3.TabIndex = 1; 95 | this.label3.Text = "Username"; 96 | // 97 | // password 98 | // 99 | this.password.Location = new System.Drawing.Point(12, 103); 100 | this.password.Name = "password"; 101 | this.password.PasswordChar = '*'; 102 | this.password.Size = new System.Drawing.Size(170, 20); 103 | this.password.TabIndex = 2; 104 | // 105 | // label4 106 | // 107 | this.label4.AutoSize = true; 108 | this.label4.Location = new System.Drawing.Point(12, 87); 109 | this.label4.Name = "label4"; 110 | this.label4.Size = new System.Drawing.Size(53, 13); 111 | this.label4.TabIndex = 1; 112 | this.label4.Text = "Password"; 113 | // 114 | // button1 115 | // 116 | this.button1.Location = new System.Drawing.Point(73, 207); 117 | this.button1.Name = "button1"; 118 | this.button1.Size = new System.Drawing.Size(49, 23); 119 | this.button1.TabIndex = 5; 120 | this.button1.Text = "Test"; 121 | this.button1.UseVisualStyleBackColor = true; 122 | this.button1.Click += new System.EventHandler(this.button1_Click); 123 | // 124 | // button2 125 | // 126 | this.button2.Location = new System.Drawing.Point(12, 207); 127 | this.button2.Name = "button2"; 128 | this.button2.Size = new System.Drawing.Size(55, 23); 129 | this.button2.TabIndex = 6; 130 | this.button2.Text = "Save"; 131 | this.button2.UseVisualStyleBackColor = true; 132 | this.button2.Click += new System.EventHandler(this.button2_Click); 133 | // 134 | // button3 135 | // 136 | this.button3.Location = new System.Drawing.Point(128, 207); 137 | this.button3.Name = "button3"; 138 | this.button3.Size = new System.Drawing.Size(53, 23); 139 | this.button3.TabIndex = 7; 140 | this.button3.Text = "Cancel"; 141 | this.button3.UseVisualStyleBackColor = true; 142 | this.button3.Click += new System.EventHandler(this.button3_Click); 143 | // 144 | // Prefix 145 | // 146 | this.Prefix.Location = new System.Drawing.Point(12, 181); 147 | this.Prefix.Name = "Prefix"; 148 | this.Prefix.Size = new System.Drawing.Size(170, 20); 149 | this.Prefix.TabIndex = 4; 150 | // 151 | // label5 152 | // 153 | this.label5.AutoSize = true; 154 | this.label5.Location = new System.Drawing.Point(12, 165); 155 | this.label5.Name = "label5"; 156 | this.label5.Size = new System.Drawing.Size(33, 13); 157 | this.label5.TabIndex = 1; 158 | this.label5.Text = "Prefix"; 159 | // 160 | // SqlInfo 161 | // 162 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 163 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 164 | this.ClientSize = new System.Drawing.Size(194, 237); 165 | this.Controls.Add(this.button3); 166 | this.Controls.Add(this.button2); 167 | this.Controls.Add(this.button1); 168 | this.Controls.Add(this.label3); 169 | this.Controls.Add(this.label4); 170 | this.Controls.Add(this.label5); 171 | this.Controls.Add(this.label2); 172 | this.Controls.Add(this.username); 173 | this.Controls.Add(this.password); 174 | this.Controls.Add(this.label1); 175 | this.Controls.Add(this.Prefix); 176 | this.Controls.Add(this.database); 177 | this.Controls.Add(this.serveraddress); 178 | this.Name = "SqlInfo"; 179 | this.Text = "sqlInfo"; 180 | this.ResumeLayout(false); 181 | this.PerformLayout(); 182 | 183 | } 184 | 185 | #endregion 186 | 187 | private TextBox serveraddress; 188 | private Label label1; 189 | private TextBox database; 190 | private Label label2; 191 | private TextBox username; 192 | private Label label3; 193 | private TextBox password; 194 | private Label label4; 195 | private Button button1; 196 | private Button button2; 197 | private Button button3; 198 | private TextBox Prefix; 199 | private Label label5; 200 | } 201 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/sqlInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using TechnicSolderHelper.cryptography; 4 | using TechnicSolderHelper.Confighandler; 5 | 6 | namespace TechnicSolderHelper.SQL 7 | { 8 | public partial class SqlInfo : Form 9 | { 10 | public SqlInfo() 11 | { 12 | InitializeComponent(); 13 | Crypto crypto = new Crypto(); 14 | ConfigHandler ch = new ConfigHandler(); 15 | database.Text = ch.GetConfig("mysqlDatabase"); 16 | serveraddress.Text = ch.GetConfig("mysqlAddress"); 17 | password.Text = crypto.DecryptString(ch.GetConfig("mysqlPassword")); 18 | username.Text = ch.GetConfig("mysqlUsername"); 19 | Prefix.Text = ch.GetConfig("mysqlPrefix"); 20 | } 21 | 22 | private void button1_Click(object sender, EventArgs e) 23 | { 24 | if (IsEverythingFilledIn()) 25 | { 26 | SolderSqlHandler sqh = new SolderSqlHandler(serveraddress.Text, username.Text, password.Text, database.Text, Prefix.Text); 27 | sqh.TestConnection(); 28 | } 29 | else 30 | { 31 | MessageBox.Show("Please fill out all the data"); 32 | } 33 | } 34 | 35 | private bool IsEverythingFilledIn() 36 | { 37 | return !String.IsNullOrWhiteSpace(database.Text) && !String.IsNullOrWhiteSpace(serveraddress.Text) && !String.IsNullOrWhiteSpace(username.Text); 38 | } 39 | 40 | private void button2_Click(object sender, EventArgs e) 41 | { 42 | if (IsEverythingFilledIn()) 43 | { 44 | ConfigHandler ch = new ConfigHandler(); 45 | Crypto crypto = new Crypto(); 46 | ch.SetConfig("mysqlUsername", username.Text); 47 | ch.SetConfig("mysqlPassword", crypto.EncryptToString(password.Text)); 48 | ch.SetConfig("mysqlAddress", serveraddress.Text); 49 | ch.SetConfig("mysqlDatabase", database.Text); 50 | ch.SetConfig("mysqlPrefix", Prefix.Text); 51 | Close(); 52 | } 53 | else 54 | { 55 | MessageBox.Show("Please fill out all the data"); 56 | } 57 | } 58 | 59 | private void button3_Click(object sender, EventArgs e) 60 | { 61 | Close(); 62 | } 63 | 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/sqlInfo.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SQL/workTogether/dataSuggest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using MySql.Data.MySqlClient; 6 | 7 | namespace TechnicSolderHelper.SQL.workTogether 8 | { 9 | class DataSuggest 10 | { 11 | private readonly String _connectionStringSuggest; 12 | private readonly String _connectionStringGet; 13 | private const String SuggestDatabase = "solderhelper"; 14 | private const String GetDatabase = "helpersolder"; 15 | 16 | public DataSuggest() 17 | { 18 | _connectionStringSuggest = String.Format("address=zlepper.dk;username=dataSuggester;password=suggest;database={0}", SuggestDatabase); 19 | _connectionStringGet = String.Format("address=zlepper.dk;username=dataSuggester;password=suggest;database={0}", GetDatabase); 20 | } 21 | 22 | public void Suggest(String filename, String mcversion, String modversion, String md5, String modid, String modname, String author = "") 23 | { 24 | try 25 | { 26 | if (!IsModSuggested(md5)) 27 | { 28 | const string sql = 29 | "INSERT INTO solderhelper.new(filename, mcversion, modversion, md5, modid, modname, author) VALUES(@filename, @mcversion, @modversion, @md5, @modid, @modname, @author);"; 30 | using (MySqlConnection connection = new MySqlConnection(_connectionStringSuggest)) 31 | { 32 | connection.OpenAsync(); 33 | using (MySqlCommand command = new MySqlCommand(sql, connection)) 34 | { 35 | command.Parameters.AddWithValue("@filename", filename); 36 | command.Parameters.AddWithValue("@mcversion", mcversion); 37 | command.Parameters.AddWithValue("@modversion", modversion); 38 | command.Parameters.AddWithValue("@md5", md5); 39 | command.Parameters.AddWithValue("@modid", modid); 40 | command.Parameters.AddWithValue("@modname", modname); 41 | command.Parameters.AddWithValue("@author", author); 42 | command.ExecuteNonQueryAsync(); 43 | } 44 | } 45 | } 46 | } 47 | catch (Exception e) 48 | { 49 | Debug.WriteLine(e.Message); 50 | Debug.WriteLine(e.StackTrace); 51 | if (e.InnerException != null) 52 | { 53 | Debug.WriteLine(e.InnerException.Message); 54 | Debug.WriteLine(e.InnerException.StackTrace); 55 | 56 | } 57 | } 58 | } 59 | 60 | public bool IsModSuggested(String md5) 61 | { 62 | try 63 | { 64 | String sql = "SELECT md5 FROM solderhelper.new WHERE md5 LIKE @md5;"; 65 | using (MySqlConnection connection = new MySqlConnection(_connectionStringSuggest)) 66 | { 67 | connection.OpenAsync(); 68 | using (MySqlCommand command = new MySqlCommand(sql, connection)) 69 | { 70 | command.Parameters.AddWithValue("@md5", md5); 71 | using (MySqlDataReader reader = command.ExecuteReader()) 72 | { 73 | while (reader.Read()) 74 | { 75 | if (reader["md5"].Equals(md5)) 76 | return true; 77 | return false; 78 | } 79 | } 80 | } 81 | } 82 | } 83 | catch (Exception e) 84 | { 85 | Debug.WriteLine(e.Message); 86 | Debug.WriteLine(e.StackTrace); 87 | if (e.InnerException != null) 88 | { 89 | Debug.WriteLine(e.InnerException.Message); 90 | Debug.WriteLine(e.InnerException.StackTrace); 91 | 92 | } 93 | } 94 | return false; 95 | } 96 | 97 | public Mcmod GetMcmod(String md5) 98 | { 99 | try 100 | { 101 | String sql = 102 | "SELECT modname, modid, mcversion, modversion, md5, author FROM helpersolder.mods WHERE md5 LIKE @md5;"; 103 | using (MySqlConnection connection = new MySqlConnection(_connectionStringGet)) 104 | { 105 | connection.Open(); 106 | using (MySqlCommand command = new MySqlCommand(sql, connection)) 107 | { 108 | command.Parameters.AddWithValue("@md5", md5); 109 | using (MySqlDataReader reader = command.ExecuteReader()) 110 | { 111 | while (reader.Read()) 112 | { 113 | if (reader["md5"].Equals(md5)) 114 | { 115 | List a = reader["author"].ToString().Split(',').ToList(); 116 | 117 | Mcmod mod = new Mcmod 118 | { 119 | Version = reader["modversion"].ToString(), 120 | Name = reader["modname"].ToString(), 121 | Modid = reader["modid"].ToString(), 122 | Mcversion = reader["mcversion"].ToString(), 123 | Authors = a, 124 | AuthorList = a 125 | 126 | }; 127 | return mod; 128 | } 129 | } 130 | } 131 | } 132 | } 133 | } 134 | catch (Exception e) 135 | { 136 | Debug.WriteLine(e.Message); 137 | Debug.WriteLine(e.StackTrace); 138 | if (e.InnerException != null) 139 | { 140 | Debug.WriteLine(e.InnerException.Message); 141 | Debug.WriteLine(e.InnerException.StackTrace); 142 | 143 | } 144 | } 145 | return null; 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /TechnicSolderHelper/Settings.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Configuration; 3 | 4 | namespace TechnicSolderHelper.Properties { 5 | 6 | 7 | // This class allows you to handle specific events on the settings class: 8 | // The SettingChanging event is raised before a setting'modid value is changed. 9 | // The PropertyChanged event is raised after a setting'modid value is changed. 10 | // The SettingsLoaded event is raised after the setting values are loaded. 11 | // The SettingsSaving event is raised before the setting values are saved. 12 | internal sealed partial class Settings { 13 | 14 | public Settings() { 15 | // // To add event handlers for saving and changing settings, uncomment the lines below: 16 | // 17 | // this.SettingChanging += this.SettingChangingEventHandler; 18 | // 19 | // this.SettingsSaving += this.SettingsSavingEventHandler; 20 | // 21 | } 22 | 23 | private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e) { 24 | // Add code to handle the SettingChangingEvent event here. 25 | } 26 | 27 | private void SettingsSavingEventHandler(object sender, CancelEventArgs e) { 28 | // Add code to handle the SettingsSaving event here. 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SmallInterfaces/mcselector.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace TechnicSolderHelper.SmallInterfaces 5 | { 6 | partial class Mcselector 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.label1 = new System.Windows.Forms.Label(); 35 | this.mcversions = new System.Windows.Forms.ComboBox(); 36 | this.button1 = new System.Windows.Forms.Button(); 37 | this.SuspendLayout(); 38 | // 39 | // label1 40 | // 41 | this.label1.AutoSize = true; 42 | this.label1.Location = new System.Drawing.Point(29, 9); 43 | this.label1.Name = "label1"; 44 | this.label1.Size = new System.Drawing.Size(229, 13); 45 | this.label1.TabIndex = 0; 46 | this.label1.Text = "What is the Minecraft Version of the modpack?"; 47 | // 48 | // mcversions 49 | // 50 | this.mcversions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 51 | this.mcversions.FormattingEnabled = true; 52 | this.mcversions.Location = new System.Drawing.Point(77, 39); 53 | this.mcversions.Name = "mcversions"; 54 | this.mcversions.Size = new System.Drawing.Size(121, 21); 55 | this.mcversions.TabIndex = 1; 56 | // 57 | // button1 58 | // 59 | this.button1.Location = new System.Drawing.Point(102, 66); 60 | this.button1.Name = "button1"; 61 | this.button1.Size = new System.Drawing.Size(75, 23); 62 | this.button1.TabIndex = 2; 63 | this.button1.Text = "Accept"; 64 | this.button1.UseVisualStyleBackColor = true; 65 | this.button1.Click += new System.EventHandler(this.button1_Click); 66 | // 67 | // mcselector 68 | // 69 | this.AcceptButton = this.button1; 70 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 71 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 72 | this.ClientSize = new System.Drawing.Size(284, 103); 73 | this.Controls.Add(this.button1); 74 | this.Controls.Add(this.mcversions); 75 | this.Controls.Add(this.label1); 76 | this.Name = "Mcselector"; 77 | this.Text = "Minecraft Version"; 78 | this.ResumeLayout(false); 79 | this.PerformLayout(); 80 | 81 | } 82 | 83 | #endregion 84 | 85 | private Label label1; 86 | private ComboBox mcversions; 87 | private Button button1; 88 | } 89 | } -------------------------------------------------------------------------------- /TechnicSolderHelper/SmallInterfaces/mcselector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using TechnicSolderHelper.SQL.forge; 4 | 5 | namespace TechnicSolderHelper.SmallInterfaces 6 | { 7 | public partial class Mcselector : Form 8 | { 9 | private readonly SolderHelper _solderHelper; 10 | public Mcselector(SolderHelper sh) 11 | { 12 | _solderHelper = sh; 13 | InitializeComponent(); 14 | ForgeSqlHelper f = new ForgeSqlHelper(); 15 | mcversions.Items.AddRange(f.GetMcVersions().ToArray()); 16 | } 17 | 18 | private void button1_Click(object sender, EventArgs e) 19 | { 20 | int index = mcversions.SelectedIndex; 21 | if (index == -1) 22 | { 23 | MessageBox.Show("You need to select a minecraft version to continue."); 24 | return; 25 | } 26 | String s = mcversions.SelectedItem.ToString(); 27 | _solderHelper._currentMcVersion = s; 28 | Close(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SmallInterfaces/mcselector.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/SolderHelper.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Utility; 3 | Comment[en_GB]= 4 | Comment= 5 | Encoding=UTF-8 6 | Exec=sh technicsolderhelper 7 | GenericName[en_GB]= 8 | GenericName= 9 | MimeType= 10 | Name[en_GB]=SolderHelper 11 | Name=SolderHelper 12 | Path= 13 | StartupNotify=true 14 | Terminal=false 15 | TerminalOptions= 16 | Type=Application 17 | X-DBUS-ServiceName= 18 | X-DBUS-StartupType= 19 | X-KDE-SubstituteUID=false 20 | X-KDE-Username= 21 | -------------------------------------------------------------------------------- /TechnicSolderHelper/TechnicSolderHelper.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/TechnicSolderHelper/TechnicSolderHelper.pfx -------------------------------------------------------------------------------- /TechnicSolderHelper/TechnicSolderHelper.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 | 255, 17 122 | 123 | 124 | 17, 17 125 | 126 | 127 | These are packs used only on one specific server. Their intention is to allow servers to customize their server experience without compromising the ease of installation offered by the Technic launcher. 128 | 129 | 130 | These are packs used only on one specific server. Their intention is to allow servers to customize their server experience without compromising the ease of installation offered by the FTB launcher. These modpacks must only be accessible behind a application process of some form. The code may not be posted publicly.​ 131 | 132 | 133 | 146, 17 134 | 135 | -------------------------------------------------------------------------------- /TechnicSolderHelper/confighandler/confighandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.SQLite; 3 | using System.Diagnostics; 4 | using Mono.Data.Sqlite; 5 | using TechnicSolderHelper.SQL; 6 | 7 | namespace TechnicSolderHelper.Confighandler 8 | { 9 | public class ConfigHandler : SqlHelper 10 | { 11 | private readonly String _createTableString; 12 | 13 | public ConfigHandler() 14 | : base("configs") 15 | { 16 | _createTableString = 17 | String.Format("CREATE TABLE IF NOT EXISTS `{0}` (`key` TEXT NOT NULL UNIQUE, `value` TEXT);", TableName); 18 | ExecuteDatabaseQuery(_createTableString); 19 | } 20 | 21 | public string GetConfig(String configName) 22 | { 23 | String sql = String.Format("SELECT value FROM {0} WHERE key LIKE @key;", TableName); 24 | if (Globalfunctions.IsUnix()) 25 | { 26 | using (SqliteConnection db = new SqliteConnection(ConnectionString)) 27 | { 28 | db.Open(); 29 | using (SqliteCommand cmd = new SqliteCommand(sql, db)) 30 | { 31 | cmd.Parameters.AddWithValue("@key", configName); 32 | using (SqliteDataReader reader = cmd.ExecuteReader()) 33 | { 34 | while (reader.Read()) 35 | { 36 | return reader["value"].ToString(); 37 | } 38 | } 39 | } 40 | } 41 | } 42 | else 43 | { 44 | using (SQLiteConnection db = new SQLiteConnection(ConnectionString)) 45 | { 46 | db.Open(); 47 | using (SQLiteCommand cmd = new SQLiteCommand(sql, db)) 48 | { 49 | cmd.Parameters.AddWithValue("@key", configName); 50 | using (SQLiteDataReader reader = cmd.ExecuteReader()) 51 | { 52 | while (reader.Read()) 53 | { 54 | return reader["value"].ToString(); 55 | } 56 | } 57 | } 58 | } 59 | } 60 | return String.Empty; 61 | } 62 | 63 | public void SetConfig(String configName, Boolean configValue) 64 | { 65 | SetConfig(configName, configValue.ToString()); 66 | } 67 | 68 | public void SetConfig(String configName, String configValue) 69 | { 70 | String sql = String.Format("INSERT OR REPLACE INTO {0}(key, value) VALUES(@key, @value);", TableName); 71 | Debug.WriteLine(sql); 72 | if (Globalfunctions.IsUnix()) 73 | { 74 | using (SqliteConnection db = new SqliteConnection(ConnectionString)) 75 | { 76 | db.Open(); 77 | using (SqliteCommand cmd = new SqliteCommand(sql, db)) 78 | { 79 | cmd.Parameters.AddWithValue("@key", configName); 80 | cmd.Parameters.AddWithValue("@value", configValue); 81 | cmd.ExecuteNonQuery(); 82 | } 83 | } 84 | } 85 | else 86 | { 87 | using (SQLiteConnection db = new SQLiteConnection(ConnectionString)) 88 | { 89 | db.Open(); 90 | using (SQLiteCommand cmd = new SQLiteCommand(sql, db)) 91 | { 92 | cmd.Parameters.AddWithValue("@key", configName); 93 | cmd.Parameters.AddWithValue("@value", configValue); 94 | cmd.ExecuteNonQuery(); 95 | } 96 | } 97 | } 98 | } 99 | 100 | public override void ResetTable() 101 | { 102 | base.ResetTable(); 103 | ExecuteDatabaseQuery(_createTableString); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /TechnicSolderHelper/cryptography/KeyHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechnicSolderHelper.cryptography 5 | { 6 | public class KeyHandler 7 | { 8 | readonly String _keysPath; 9 | readonly String _vectorPath; 10 | 11 | public KeyHandler() 12 | { 13 | _keysPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SolderHelper", "keys.dat"); 14 | _vectorPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SolderHelper", "vector.dat"); 15 | 16 | Random r; 17 | if (!File.Exists(_keysPath)) 18 | { 19 | r = new Random(); 20 | for (int i = 0; i < 32; i++) 21 | { 22 | File.AppendAllText(_keysPath, r.Next(0, 255)+Environment.NewLine); 23 | } 24 | } 25 | if (File.Exists(_vectorPath)) return; 26 | r = new Random(); 27 | for (int i = 0; i < 16; i++) 28 | { 29 | File.AppendAllText(_vectorPath, r.Next(0, 255) + Environment.NewLine); 30 | } 31 | } 32 | 33 | public byte[] GetKeys() 34 | { 35 | byte[] b = new byte[32]; 36 | using (StreamReader reader = new StreamReader(_keysPath)) 37 | { 38 | for (int i = 0; i < b.Length; i++) 39 | { 40 | b[i] = Convert.ToByte(reader.ReadLine()); 41 | } 42 | } 43 | return b; 44 | } 45 | 46 | public byte[] GetVector() 47 | { 48 | byte[] b = new byte[16]; 49 | using (StreamReader reader = new StreamReader(_vectorPath)) 50 | { 51 | for (int i = 0; i < b.Length; i++) 52 | { 53 | b[i] = Convert.ToByte(reader.ReadLine()); 54 | } 55 | } 56 | return b; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /TechnicSolderHelper/cryptography/crypto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Security.Cryptography; 4 | using System.Text; 5 | 6 | namespace TechnicSolderHelper.cryptography 7 | { 8 | public class Crypto 9 | { 10 | // Change these keys 11 | 12 | 13 | private readonly ICryptoTransform _encryptorTransform; 14 | private readonly ICryptoTransform _decryptorTransform; 15 | private readonly UTF8Encoding _utfEncoder; 16 | 17 | public Crypto() 18 | { 19 | KeyHandler keyhandler = new KeyHandler(); 20 | var key = keyhandler.GetKeys(); 21 | var vector = keyhandler.GetVector(); 22 | 23 | //This is our encryption method 24 | RijndaelManaged rm = new RijndaelManaged(); 25 | 26 | //Create an encryptor and a decryptor using our encryption method, key, and vector. 27 | _encryptorTransform = rm.CreateEncryptor(key, vector); 28 | _decryptorTransform = rm.CreateDecryptor(key, vector); 29 | 30 | //Used to translate bytes to text and vice versa 31 | _utfEncoder = new UTF8Encoding(); 32 | } 33 | 34 | 35 | /// ----------- The commonly used methods ------------------------------ 36 | /// Encrypt some text and return a string suitable for passing in a URL. 37 | public string EncryptToString(string textValue) 38 | { 39 | return ByteArrToString(Encrypt(textValue)); 40 | } 41 | 42 | /// Encrypt some text and return an encrypted byte array. 43 | private byte[] Encrypt(string textValue) 44 | { 45 | //Translates our text value into a byte array. 46 | Byte[] bytes = _utfEncoder.GetBytes(textValue); 47 | 48 | //Used to stream the data in and out of the CryptoStream. 49 | MemoryStream memoryStream = new MemoryStream(); 50 | 51 | /* 52 | * We will have to write the unencrypted bytes to the stream, 53 | * then read the encrypted result back from the stream. 54 | */ 55 | #region Write the decrypted value to the encryption stream 56 | CryptoStream cs = new CryptoStream(memoryStream, _encryptorTransform, CryptoStreamMode.Write); 57 | cs.Write(bytes, 0, bytes.Length); 58 | cs.FlushFinalBlock(); 59 | #endregion 60 | 61 | #region Read encrypted value back out of the stream 62 | memoryStream.Position = 0; 63 | byte[] encrypted = new byte[memoryStream.Length]; 64 | memoryStream.Read(encrypted, 0, encrypted.Length); 65 | #endregion 66 | 67 | //Clean up. 68 | cs.Close(); 69 | memoryStream.Close(); 70 | 71 | return encrypted; 72 | } 73 | 74 | /// The other side: Decryption methods 75 | public string DecryptString(string encryptedString) 76 | { 77 | return Decrypt(StrToByteArray(encryptedString)); 78 | } 79 | 80 | /// Decryption when working with byte arrays. 81 | private string Decrypt(byte[] encryptedValue) 82 | { 83 | #region Write the encrypted value to the decryption stream 84 | MemoryStream encryptedStream = new MemoryStream(); 85 | CryptoStream decryptStream = new CryptoStream(encryptedStream, _decryptorTransform, CryptoStreamMode.Write); 86 | decryptStream.Write(encryptedValue, 0, encryptedValue.Length); 87 | decryptStream.FlushFinalBlock(); 88 | #endregion 89 | 90 | #region Read the decrypted value from the stream. 91 | encryptedStream.Position = 0; 92 | Byte[] decryptedBytes = new Byte[encryptedStream.Length]; 93 | encryptedStream.Read(decryptedBytes, 0, decryptedBytes.Length); 94 | encryptedStream.Close(); 95 | #endregion 96 | return _utfEncoder.GetString(decryptedBytes); 97 | } 98 | 99 | /// Convert a string to a byte array. NOTE: Normally we'd create a Byte Array from a string using an ASCII encoding (like so). 100 | // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); 101 | // return encoding.GetBytes(str); 102 | // However, this results in character values that cannot be passed in a URL. So, instead, I just 103 | // lay out all of the byte values in a long string of numbers (three per - must pad numbers less than 100). 104 | private byte[] StrToByteArray(string str) 105 | { 106 | if (str.Length == 0) 107 | throw new Exception("Invalid string value in StrToByteArray"); 108 | 109 | byte[] byteArr = new byte[str.Length / 3]; 110 | int i = 0; 111 | int j = 0; 112 | do 113 | { 114 | var val = byte.Parse(str.Substring(i, 3)); 115 | byteArr[j++] = val; 116 | i += 3; 117 | } 118 | while (i < str.Length); 119 | return byteArr; 120 | } 121 | 122 | // Same comment as above. Normally the conversion would use an ASCII encoding in the other direction: 123 | // System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 124 | // return enc.GetString(byteArr); 125 | private string ByteArrToString(byte[] byteArr) 126 | { 127 | string tempStr = ""; 128 | for (int i = 0; i <= byteArr.GetUpperBound(0); i++) 129 | { 130 | var val = byteArr[i]; 131 | if (val < 10) 132 | tempStr += "00" + val; 133 | else if (val < 100) 134 | tempStr += "0" + val; 135 | else 136 | tempStr += val.ToString(); 137 | } 138 | return tempStr; 139 | } 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /TechnicSolderHelper/globalfunctions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechnicSolderHelper 4 | { 5 | public static class Globalfunctions 6 | { 7 | public static char PathSeperator; 8 | 9 | public static Boolean IsUnix() 10 | { 11 | return Environment.OSVersion.ToString().ToLower().Contains("unix"); 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /TechnicSolderHelper/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=$(lsb_release -a | sed -n -e 's/^.*ID://p') 4 | DISTRO=${DISTRO//[[:blank:]]/} 5 | 6 | echo "$DISTRO detected." 7 | 8 | function dl() { 9 | echo "Downloading SolderHelper..." 10 | wget -c "$1" >/dev/null 2>&1 #Download archive 11 | echo "Done." 12 | } 13 | 14 | function extract() { 15 | echo "Extracting Archive..." 16 | unzip -o "$1" >/dev/null 2>&1 #Extract (Will be in "TechnicSolderHelper") 17 | echo "Done." 18 | } 19 | 20 | function makexec() { 21 | echo "Marking $1 executable..." 22 | chmod +x $1 23 | echo "Done." 24 | } 25 | 26 | function install() { 27 | echo "Trying to install $1, you might get asked for your password." 28 | case "$DISTRO" in 29 | "Arch") 30 | sudo pacman -Sy $1 31 | ;; 32 | "Debian" | "Ubuntu") 33 | if [[ $1 == "mono" ]]; then 34 | wget -c "http://download.mono-project.com/repo/xamarin.gpg" 35 | sudo apt-key add xamarin.gpg 36 | rm xamarin.gpg 37 | sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list 38 | sudo echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" >> /etc/apt/sources.list.d/mono-xamarin.list 39 | sudo apt-get -y update 40 | sudo apt-get -y install mono-complete 41 | else 42 | sudo apt-get -y install $1 43 | fi 44 | ;; 45 | *) 46 | echo "Your package manager is not yet supported! Please install $1 yourself." 47 | ;; 48 | esac 49 | } 50 | 51 | command -v zip >/dev/null 2>&1 || { install "zip"; } 52 | command -v unzip >/dev/null 2>&1 || { install "unzip"; } 53 | command -v mono >/dev/null 2>&1 || { install "mono"; } 54 | 55 | dl "http://zlepper.dk/solderhelper/TechnicSolderHelper.zip" 56 | trap "rm 'TechnicSolderHelper.zip'" EXIT 57 | extract "TechnicSolderHelper.zip" 58 | makexec "TechnicSolderHelper/SolderHelper.desktop" 59 | 60 | echo "Successfully installed SolderHelper if no errors occured!" -------------------------------------------------------------------------------- /TechnicSolderHelper/mcmod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using TechnicSolderHelper.SQL; 5 | 6 | namespace TechnicSolderHelper 7 | { 8 | public class Mcmod 9 | { 10 | public string Modid { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | private string version; 15 | 16 | public string Version 17 | { 18 | get { return version; } 19 | set 20 | { 21 | if (string.IsNullOrWhiteSpace(value)) 22 | { 23 | value = ""; 24 | } 25 | this.version = Regex.Replace(value, "_| ", ""); 26 | } 27 | } 28 | 29 | public string Mcversion { get; set; } 30 | 31 | public string Url { get; set; } 32 | 33 | public string Description { get; set; } 34 | 35 | public Boolean HasBeenWritenToModlist { get; set; } 36 | 37 | public Boolean IsSkipping { get; set; } 38 | 39 | public List AuthorList { get; set; } 40 | 41 | public List Authors { get; set; } 42 | 43 | public PermissionPolicy PublicPerms { get; set; } 44 | 45 | public PermissionPolicy PrivatePerms { get; set; } 46 | 47 | public String PermissionLink { get; set; } 48 | 49 | public String LicenseLink { get; set; } 50 | 51 | public Boolean IsIgnore { get; set; } 52 | 53 | public Boolean UseShortName { get; set; } 54 | 55 | public Boolean FromSuggestion { get; set; } 56 | 57 | public Boolean FromUserInput { get; set; } 58 | 59 | public String Filename { get; set; } 60 | 61 | public String Path { get; set; } 62 | 63 | public Boolean Aredone { get; set; } 64 | 65 | private static string reg = null; 66 | public virtual string GetSafeModId() 67 | { 68 | if (string.IsNullOrWhiteSpace(reg)) 69 | { 70 | reg = @"\\|\/|\||:|\*|" + "\"" + @"|<|>|'|\?|&|\$|@|=|;|\+|\s|,|{|}|\^|%|`|\]|\[|~|#"; 71 | for (int i = 0; i < 32; i++) 72 | { 73 | char c = (char)i; 74 | reg += "|" + c; 75 | } 76 | for (int i = 127; i < 256; i++) 77 | { 78 | char c = (char)i; 79 | reg += "|" + c; 80 | } 81 | Debug.WriteLine(reg); 82 | } 83 | // Regex get rids of any illigal windows explorer characters 84 | // And some characters that breaks url navigation 85 | // And anything amazon recommends removing 86 | return Regex.Replace(Regex.Replace(Modid, "_| ", "-"), reg, string.Empty).ToLower(); 87 | } 88 | 89 | } 90 | 91 | public class OwnPermissions 92 | { 93 | public Boolean HasPermission { get; set; } 94 | 95 | public String PermissionLink { get; set; } 96 | 97 | public String ModLink { get; set; } 98 | 99 | public String LicenseLink { get; set; } 100 | } 101 | 102 | public class ModHelper 103 | { 104 | 105 | public static Mcmod GoodVersioning(String fileName) 106 | { 107 | fileName = fileName.Remove(fileName.LastIndexOf(".")); 108 | Mcmod mod = new Mcmod(); 109 | 110 | //Figure out modname 111 | String modname = ""; 112 | foreach (char c in fileName) 113 | { 114 | if (!(c.Equals('-'))) 115 | { 116 | modname = modname + c; 117 | } 118 | else 119 | { 120 | break; 121 | } 122 | } 123 | mod.Name = modname; 124 | fileName = fileName.Replace(modname + "-", ""); 125 | 126 | //Figure out minecraft version 127 | String mcversion = ""; 128 | foreach (char c in fileName) 129 | { 130 | if (!(c.Equals('-'))) 131 | { 132 | mcversion = mcversion + c; 133 | } 134 | else 135 | { 136 | break; 137 | } 138 | } 139 | mod.Mcversion = mcversion; 140 | 141 | //Figure out modversion 142 | fileName = fileName.Replace(mcversion + "-", ""); 143 | mod.Version = fileName; 144 | 145 | 146 | return mod; 147 | } 148 | 149 | public static Mcmod WailaPattern(String fileName) // waila-1.5.5_1.7.10.jar 150 | { 151 | fileName = fileName.Remove(fileName.LastIndexOf(".", StringComparison.Ordinal)); 152 | Mcmod mod = new Mcmod(); 153 | 154 | String name = ""; 155 | foreach (char c in fileName) 156 | { 157 | if (!(c.Equals('-'))) 158 | { 159 | name = name + c; 160 | } 161 | else 162 | { 163 | break; 164 | } 165 | } 166 | mod.Name = name; 167 | 168 | fileName = fileName.Replace(name, ""); 169 | 170 | String version = ""; 171 | foreach (char c in fileName) 172 | { 173 | if (!(c.Equals('_'))) 174 | { 175 | version = version + c; 176 | } 177 | else 178 | { 179 | break; 180 | } 181 | } 182 | mod.Version = version; 183 | 184 | fileName = fileName.Replace("_", "").Replace(version, ""); 185 | mod.Mcversion = fileName; 186 | 187 | return mod; 188 | } 189 | 190 | public static Mcmod ReikasMods(String fileName) 191 | { 192 | Mcmod mod = new Mcmod(); 193 | 194 | fileName = fileName.Remove(fileName.LastIndexOf(".", StringComparison.Ordinal)); 195 | 196 | //Figure out mod name 197 | String[] reikas = fileName.Split(' '); 198 | 199 | mod.Name = reikas[0].Replace(" ", String.Empty); 200 | mod.Mcversion = reikas[1].Replace(" ", String.Empty); 201 | mod.Version = reikas[2].Replace(" ", String.Empty); 202 | 203 | return mod; 204 | } 205 | 206 | } 207 | 208 | public class Mcmod2 209 | { 210 | public int Modinfoversion { get; set; } 211 | 212 | public int ModListVersion { get; set; } 213 | 214 | public List Modlist { get; set; } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /TechnicSolderHelper/modinfo.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 | 124 | 40 125 | 126 | -------------------------------------------------------------------------------- /TechnicSolderHelper/modpackhelper.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/TechnicSolderHelper/modpackhelper.ico -------------------------------------------------------------------------------- /TechnicSolderHelper/modpacks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace TechnicSolderHelper 5 | { 6 | public class Modpacks 7 | { 8 | public Dictionary> Modpack; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /TechnicSolderHelper/output/technicsolderhelper.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $("td").click(function () { 3 | window.prompt("Copy to clipboard: Ctrl+c, Enter", $(this).text()); 4 | }) 5 | }) -------------------------------------------------------------------------------- /TechnicSolderHelper/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /TechnicSolderHelper/s3/S3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading; 6 | using System.Windows.Forms; 7 | using Amazon; 8 | using Amazon.S3; 9 | using Amazon.S3.Model; 10 | using Amazon.S3.Transfer; 11 | using TechnicSolderHelper.cryptography; 12 | using TechnicSolderHelper.Confighandler; 13 | 14 | namespace TechnicSolderHelper.s3 15 | { 16 | class S3 17 | { 18 | private readonly AmazonS3Client _client; 19 | private readonly String _bucket; 20 | 21 | public S3() 22 | { 23 | ConfigHandler ch = new ConfigHandler(); 24 | Crypto crypto = new Crypto(); 25 | var accessKey = crypto.DecryptString(ch.GetConfig("S3accessKey")); 26 | var secretKey = crypto.DecryptString(ch.GetConfig("S3secretKey")); 27 | String url = ch.GetConfig("S3url"); 28 | _bucket = ch.GetConfig("S3Bucket"); 29 | var config = new AmazonS3Config {ServiceURL = url}; 30 | _client = AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey, config) as AmazonS3Client; 31 | } 32 | 33 | public S3(string accessKey, string secretKey, String serviceUrl) 34 | { 35 | var config = new AmazonS3Config(){ServiceURL = serviceUrl}; 36 | _client = AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey, config) as AmazonS3Client; 37 | } 38 | 39 | public List GetBucketList() 40 | { 41 | try 42 | { 43 | 44 | ListBucketsResponse responce = _client.ListBuckets(); 45 | return responce.Buckets.Select(bucket => bucket.BucketName).ToList(); 46 | } 47 | catch 48 | { 49 | return null; 50 | } 51 | } 52 | 53 | public void CreateNewBucket(String bucketName) 54 | { 55 | try 56 | { 57 | PutBucketRequest request = new PutBucketRequest {BucketName = bucketName}; 58 | _client.PutBucket(request); 59 | } 60 | catch (Exception exception) 61 | { 62 | MessageBox.Show(string.Format("Could not create bucket:\n{0}", exception.Message)); 63 | } 64 | } 65 | 66 | public void UploadFolder(String folderPath) 67 | { 68 | MessageToUser m = new MessageToUser(); 69 | Thread startingThread = new Thread(m.UploadToS3); 70 | startingThread.Start(); 71 | TransferUtilityUploadDirectoryRequest request = new TransferUtilityUploadDirectoryRequest() 72 | { 73 | BucketName = _bucket, 74 | Directory = folderPath, 75 | SearchOption = SearchOption.AllDirectories, 76 | SearchPattern = "*.zip", 77 | KeyPrefix = "mods" 78 | }; 79 | TransferUtility directorytTransferUtility = new TransferUtility(_client); 80 | directorytTransferUtility.UploadDirectory(request); 81 | MessageBox.Show("Done uploading files to s3"); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /TechnicSolderHelper/s3/S3Info.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using TechnicSolderHelper.cryptography; 5 | using TechnicSolderHelper.Confighandler; 6 | 7 | namespace TechnicSolderHelper.s3 8 | { 9 | public partial class S3Info : Form 10 | { 11 | private S3 _service; 12 | 13 | public S3Info() 14 | { 15 | InitializeComponent(); 16 | } 17 | 18 | private void test_Click(object sender, EventArgs e) 19 | { 20 | if (!(serviceURL.Text.StartsWith("http://") || serviceURL.Text.StartsWith("https://"))) 21 | { 22 | serviceURL.Text = "http://" + serviceURL.Text; 23 | } 24 | if (IsEveryFilledIn()) 25 | { 26 | if (!Uri.IsWellFormedUriString(serviceURL.Text, UriKind.Absolute)) 27 | { 28 | MessageBox.Show("Service url is not valid"); 29 | return; 30 | } 31 | 32 | _service = new S3(accessKey.Text, secretKey.Text, serviceURL.Text); 33 | try 34 | { 35 | _service.GetBucketList(); 36 | if (sender != null) 37 | { 38 | MessageBox.Show("Connection Succesful."); 39 | } 40 | } 41 | catch (Exception exception) 42 | { 43 | MessageBox.Show(string.Format("Connection not succesful.\n{0}", exception.Message)); 44 | } 45 | GetBuckets(); 46 | } 47 | else 48 | { 49 | MessageBox.Show("Please fill in everything."); 50 | } 51 | } 52 | 53 | private bool test_Click() 54 | { 55 | if (!(serviceURL.Text.StartsWith("http://") ||serviceURL.Text.StartsWith("https://"))) 56 | { 57 | serviceURL.Text = "http://" + serviceURL.Text; 58 | } 59 | if (IsEveryFilledIn()) 60 | { 61 | if (!Uri.IsWellFormedUriString(serviceURL.Text, UriKind.Absolute)) 62 | { 63 | MessageBox.Show("Service url is not valid"); 64 | return false; 65 | } 66 | 67 | _service = new S3(accessKey.Text, secretKey.Text, serviceURL.Text); 68 | try 69 | { 70 | _service.GetBucketList(); 71 | GetBuckets(); 72 | return true; 73 | } 74 | catch (Exception exception) 75 | { 76 | MessageBox.Show(string.Format("Connection not succesful.\n{0}", exception.Message)); 77 | } 78 | 79 | } 80 | else 81 | { 82 | MessageBox.Show("Please fill in everything."); 83 | } 84 | return false; 85 | } 86 | 87 | private void cancel_Click(object sender, EventArgs e) 88 | { 89 | Close(); 90 | } 91 | 92 | private void GetBuckets() 93 | { 94 | List bucketList = _service.GetBucketList(); 95 | buckets.Items.Clear(); 96 | if (bucketList != null) 97 | { 98 | foreach (string bucket in bucketList) 99 | { 100 | buckets.Items.Add(bucket); 101 | } 102 | } 103 | } 104 | 105 | private bool IsEveryFilledIn() 106 | { 107 | if (String.IsNullOrWhiteSpace(accessKey.Text) || String.IsNullOrWhiteSpace(serviceURL.Text) ||String.IsNullOrWhiteSpace(secretKey.Text)) 108 | { 109 | return false; 110 | } 111 | return true; 112 | } 113 | 114 | private void Save_Click(object sender, EventArgs e) 115 | { 116 | if (IsEveryFilledIn()) 117 | { 118 | if (buckets.SelectedItem != null) 119 | { 120 | String bucket = buckets.SelectedItem.ToString(); 121 | ConfigHandler ch = new ConfigHandler(); 122 | Crypto crypto = new Crypto(); 123 | ch.SetConfig("S3url", serviceURL.Text); 124 | ch.SetConfig("S3accessKey", crypto.EncryptToString(accessKey.Text)); 125 | ch.SetConfig("S3secretKey", crypto.EncryptToString(secretKey.Text)); 126 | ch.SetConfig("S3Bucket", bucket); 127 | Close(); 128 | } 129 | else 130 | { 131 | MessageBox.Show("Please select a bucket"); 132 | } 133 | } 134 | } 135 | 136 | private void S3Info_Load(object sender, EventArgs e) 137 | { 138 | try 139 | { 140 | ConfigHandler ch = new ConfigHandler(); 141 | Crypto crypto = new Crypto(); 142 | serviceURL.Text = ch.GetConfig("S3url"); 143 | accessKey.Text = crypto.DecryptString(ch.GetConfig("S3accessKey")); 144 | secretKey.Text = crypto.DecryptString(ch.GetConfig("S3secretKey")); 145 | } 146 | catch 147 | { 148 | // ignored 149 | } 150 | } 151 | 152 | private void button1_Click(object sender, EventArgs e) 153 | { 154 | if (_service != null) 155 | { 156 | if (String.IsNullOrWhiteSpace(newBucketName.Text)) 157 | { 158 | MessageBox.Show("You need to enter a name of the new bucket."); 159 | } 160 | else 161 | { 162 | _service.CreateNewBucket(newBucketName.Text); 163 | test_Click(); 164 | buckets.SelectedItem = newBucketName.Text; 165 | } 166 | } 167 | else 168 | { 169 | test_Click(); 170 | } 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /TechnicSolderHelper/s3/S3Info.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 | -------------------------------------------------------------------------------- /TechnicSolderHelper/sqlite3.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sqlite3_aggregate_context 3 | sqlite3_aggregate_count 4 | sqlite3_auto_extension 5 | sqlite3_backup_finish 6 | sqlite3_backup_init 7 | sqlite3_backup_pagecount 8 | sqlite3_backup_remaining 9 | sqlite3_backup_step 10 | sqlite3_bind_blob 11 | sqlite3_bind_double 12 | sqlite3_bind_int 13 | sqlite3_bind_int64 14 | sqlite3_bind_null 15 | sqlite3_bind_parameter_count 16 | sqlite3_bind_parameter_index 17 | sqlite3_bind_parameter_name 18 | sqlite3_bind_text 19 | sqlite3_bind_text16 20 | sqlite3_bind_value 21 | sqlite3_bind_zeroblob 22 | sqlite3_blob_bytes 23 | sqlite3_blob_close 24 | sqlite3_blob_open 25 | sqlite3_blob_read 26 | sqlite3_blob_reopen 27 | sqlite3_blob_write 28 | sqlite3_busy_handler 29 | sqlite3_busy_timeout 30 | sqlite3_cancel_auto_extension 31 | sqlite3_changes 32 | sqlite3_clear_bindings 33 | sqlite3_close 34 | sqlite3_close_v2 35 | sqlite3_collation_needed 36 | sqlite3_collation_needed16 37 | sqlite3_column_blob 38 | sqlite3_column_bytes 39 | sqlite3_column_bytes16 40 | sqlite3_column_count 41 | sqlite3_column_database_name 42 | sqlite3_column_database_name16 43 | sqlite3_column_decltype 44 | sqlite3_column_decltype16 45 | sqlite3_column_double 46 | sqlite3_column_int 47 | sqlite3_column_int64 48 | sqlite3_column_name 49 | sqlite3_column_name16 50 | sqlite3_column_origin_name 51 | sqlite3_column_origin_name16 52 | sqlite3_column_table_name 53 | sqlite3_column_table_name16 54 | sqlite3_column_text 55 | sqlite3_column_text16 56 | sqlite3_column_type 57 | sqlite3_column_value 58 | sqlite3_commit_hook 59 | sqlite3_compileoption_get 60 | sqlite3_compileoption_used 61 | sqlite3_complete 62 | sqlite3_complete16 63 | sqlite3_config 64 | sqlite3_context_db_handle 65 | sqlite3_create_collation 66 | sqlite3_create_collation16 67 | sqlite3_create_collation_v2 68 | sqlite3_create_function 69 | sqlite3_create_function16 70 | sqlite3_create_function_v2 71 | sqlite3_create_module 72 | sqlite3_create_module_v2 73 | sqlite3_data_count 74 | sqlite3_db_config 75 | sqlite3_db_filename 76 | sqlite3_db_handle 77 | sqlite3_db_mutex 78 | sqlite3_db_readonly 79 | sqlite3_db_release_memory 80 | sqlite3_db_status 81 | sqlite3_declare_vtab 82 | sqlite3_enable_load_extension 83 | sqlite3_enable_shared_cache 84 | sqlite3_errcode 85 | sqlite3_errmsg 86 | sqlite3_errmsg16 87 | sqlite3_errstr 88 | sqlite3_exec 89 | sqlite3_expired 90 | sqlite3_extended_errcode 91 | sqlite3_extended_result_codes 92 | sqlite3_file_control 93 | sqlite3_finalize 94 | sqlite3_free 95 | sqlite3_free_table 96 | sqlite3_get_autocommit 97 | sqlite3_get_auxdata 98 | sqlite3_get_table 99 | sqlite3_global_recover 100 | sqlite3_initialize 101 | sqlite3_interrupt 102 | sqlite3_last_insert_rowid 103 | sqlite3_libversion 104 | sqlite3_libversion_number 105 | sqlite3_limit 106 | sqlite3_load_extension 107 | sqlite3_log 108 | sqlite3_malloc 109 | sqlite3_memory_alarm 110 | sqlite3_memory_highwater 111 | sqlite3_memory_used 112 | sqlite3_mprintf 113 | sqlite3_mutex_alloc 114 | sqlite3_mutex_enter 115 | sqlite3_mutex_free 116 | sqlite3_mutex_leave 117 | sqlite3_mutex_try 118 | sqlite3_next_stmt 119 | sqlite3_open 120 | sqlite3_open16 121 | sqlite3_open_v2 122 | sqlite3_os_end 123 | sqlite3_os_init 124 | sqlite3_overload_function 125 | sqlite3_prepare 126 | sqlite3_prepare16 127 | sqlite3_prepare16_v2 128 | sqlite3_prepare_v2 129 | sqlite3_profile 130 | sqlite3_progress_handler 131 | sqlite3_randomness 132 | sqlite3_realloc 133 | sqlite3_release_memory 134 | sqlite3_reset 135 | sqlite3_reset_auto_extension 136 | sqlite3_result_blob 137 | sqlite3_result_double 138 | sqlite3_result_error 139 | sqlite3_result_error16 140 | sqlite3_result_error_code 141 | sqlite3_result_error_nomem 142 | sqlite3_result_error_toobig 143 | sqlite3_result_int 144 | sqlite3_result_int64 145 | sqlite3_result_null 146 | sqlite3_result_text 147 | sqlite3_result_text16 148 | sqlite3_result_text16be 149 | sqlite3_result_text16le 150 | sqlite3_result_value 151 | sqlite3_result_zeroblob 152 | sqlite3_rollback_hook 153 | sqlite3_rtree_geometry_callback 154 | sqlite3_rtree_query_callback 155 | sqlite3_set_authorizer 156 | sqlite3_set_auxdata 157 | sqlite3_shutdown 158 | sqlite3_sleep 159 | sqlite3_snprintf 160 | sqlite3_soft_heap_limit 161 | sqlite3_soft_heap_limit64 162 | sqlite3_sourceid 163 | sqlite3_sql 164 | sqlite3_status 165 | sqlite3_step 166 | sqlite3_stmt_busy 167 | sqlite3_stmt_readonly 168 | sqlite3_stmt_status 169 | sqlite3_strglob 170 | sqlite3_stricmp 171 | sqlite3_strnicmp 172 | sqlite3_table_column_metadata 173 | sqlite3_test_control 174 | sqlite3_thread_cleanup 175 | sqlite3_threadsafe 176 | sqlite3_total_changes 177 | sqlite3_trace 178 | sqlite3_transfer_bindings 179 | sqlite3_update_hook 180 | sqlite3_uri_boolean 181 | sqlite3_uri_int64 182 | sqlite3_uri_parameter 183 | sqlite3_user_data 184 | sqlite3_value_blob 185 | sqlite3_value_bytes 186 | sqlite3_value_bytes16 187 | sqlite3_value_double 188 | sqlite3_value_int 189 | sqlite3_value_int64 190 | sqlite3_value_numeric_type 191 | sqlite3_value_text 192 | sqlite3_value_text16 193 | sqlite3_value_text16be 194 | sqlite3_value_text16le 195 | sqlite3_value_type 196 | sqlite3_vfs_find 197 | sqlite3_vfs_register 198 | sqlite3_vfs_unregister 199 | sqlite3_vmprintf 200 | sqlite3_vsnprintf 201 | sqlite3_vtab_config 202 | sqlite3_vtab_on_conflict 203 | sqlite3_wal_autocheckpoint 204 | sqlite3_wal_checkpoint 205 | sqlite3_wal_checkpoint_v2 206 | sqlite3_wal_hook 207 | sqlite3_win32_mbcs_to_utf8 208 | sqlite3_win32_set_directory 209 | sqlite3_win32_sleep 210 | sqlite3_win32_utf8_to_mbcs 211 | sqlite3_win32_write_debug 212 | -------------------------------------------------------------------------------- /TechnicSolderHelper/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=$(lsb_release -a | sed -n -e 's/^.*ID://p') 4 | DISTRO=${DISTRO//[[:blank:]]/} 5 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 6 | 7 | echo "Updating SolderHelper..." 8 | cd "$DIR/.." 9 | echo "$DISTRO detected." 10 | 11 | function dl() { 12 | echo "Downloading SolderHelper..." 13 | wget -c "$1" >/dev/null 2>&1 #Download archive 14 | echo "Done." 15 | } 16 | 17 | function extract() { 18 | echo "Extracting Archive..." 19 | unzip -o "$1" >/dev/null 2>&1 #Extract (Will be in "TechnicSolderHelper") 20 | echo "Done." 21 | } 22 | 23 | function makexec() { 24 | echo "Marking $1 executable..." 25 | chmod +x $1 26 | echo "Done." 27 | } 28 | 29 | function install() { 30 | echo "Trying to install $1, you might get asked for your password." 31 | case "$DISTRO" in 32 | "Arch") 33 | sudo pacman -Sy $1 34 | ;; 35 | "Debian" | "Ubuntu") 36 | if [[ $1 == "mono" ]]; then 37 | wget -c "http://download.mono-project.com/repo/xamarin.gpg" 38 | sudo apt-key add xamarin.gpg 39 | rm xamarin.gpg 40 | sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list 41 | sudo echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" >> /etc/apt/sources.list.d/mono-xamarin.list 42 | sudo apt-get -y update 43 | sudo apt-get -y install mono-complete 44 | else 45 | sudo apt-get -y install $1 46 | fi 47 | ;; 48 | *) 49 | echo "Your package manager is not yet supported! Please install $1 yourself." 50 | esac 51 | } 52 | 53 | command -v zip >/dev/null 2>&1 || { install "zip"; } 54 | command -v unzip >/dev/null 2>&1 || { install "unzip"; } 55 | command -v mono >/dev/null 2>&1 || { install "mono"; } 56 | 57 | dl "http://zlepper.dk/solderhelper/TechnicSolderHelper.zip" 58 | trap "rm 'TechnicSolderHelper.zip'" EXIT 59 | extract "TechnicSolderHelper.zip" 60 | makexec "TechnicSolderHelper/SolderHelper.desktop" 61 | 62 | echo "Successfully updated SolderHelper if no errors occured!" -------------------------------------------------------------------------------- /TechnicSolderHelper/x64/SQLite.Interop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/TechnicSolderHelper/x64/SQLite.Interop.dll -------------------------------------------------------------------------------- /TechnicSolderHelper/x86/SQLite.Interop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlepper/TechnicSolderHelper/f68be38acbb71cba40d8a58791f161b75b6f2c7c/TechnicSolderHelper/x86/SQLite.Interop.dll --------------------------------------------------------------------------------