[READ-ONLY] Mirror of https://github.com/jackmawer/ServoUtility. Servo Utility, formally WhiteRose, is a cross-platform .NET library to build FreeSO update and launcher utilities.
0

Configure Feed

Select the types of activity you want to include in your feed.

Initial source commit

Tomas (Oct 13, 2016, 7:05 PM EDT) 6054e83a

+1003
+17
.gitattributes
··· 1 + # Auto detect text files and perform LF normalization 2 + * text=auto 3 + 4 + # Custom for Visual Studio 5 + *.cs diff=csharp 6 + 7 + # Standard to msysgit 8 + *.doc diff=astextplain 9 + *.DOC diff=astextplain 10 + *.docx diff=astextplain 11 + *.DOCX diff=astextplain 12 + *.dot diff=astextplain 13 + *.DOT diff=astextplain 14 + *.pdf diff=astextplain 15 + *.PDF diff=astextplain 16 + *.rtf diff=astextplain 17 + *.RTF diff=astextplain
+303
.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 + *.userosscache 8 + *.sln.docstates 9 + 10 + # User-specific files (MonoDevelop/Xamarin Studio) 11 + *.userprefs 12 + 13 + # Build results 14 + [Dd]ebug/ 15 + [Dd]ebugPublic/ 16 + [Rr]elease/ 17 + [Rr]eleases/ 18 + x64/ 19 + x86/ 20 + bld/ 21 + [Bb]in/ 22 + [Oo]bj/ 23 + [Ll]og/ 24 + 25 + # Visual Studio 2015 cache/options directory 26 + .vs/ 27 + # Uncomment if you have tasks that create the project's static files in wwwroot 28 + #wwwroot/ 29 + 30 + # MSTest test Results 31 + [Tt]est[Rr]esult*/ 32 + [Bb]uild[Ll]og.* 33 + 34 + # NUNIT 35 + *.VisualState.xml 36 + TestResult.xml 37 + 38 + # Build Results of an ATL Project 39 + [Dd]ebugPS/ 40 + [Rr]eleasePS/ 41 + dlldata.c 42 + 43 + # DNX 44 + project.lock.json 45 + artifacts/ 46 + 47 + *_i.c 48 + *_p.c 49 + *_i.h 50 + *.ilk 51 + *.meta 52 + *.obj 53 + *.pch 54 + *.pdb 55 + *.pgc 56 + *.pgd 57 + *.rsp 58 + *.sbr 59 + *.tlb 60 + *.tli 61 + *.tlh 62 + *.tmp 63 + *.tmp_proj 64 + *.log 65 + *.vspscc 66 + *.vssscc 67 + .builds 68 + *.pidb 69 + *.svclog 70 + *.scc 71 + 72 + # Chutzpah Test files 73 + _Chutzpah* 74 + 75 + # Visual C++ cache files 76 + ipch/ 77 + *.aps 78 + *.ncb 79 + *.opendb 80 + *.opensdf 81 + *.sdf 82 + *.cachefile 83 + *.VC.db 84 + *.VC.VC.opendb 85 + 86 + # Visual Studio profiler 87 + *.psess 88 + *.vsp 89 + *.vspx 90 + *.sap 91 + 92 + # TFS 2012 Local Workspace 93 + $tf/ 94 + 95 + # Guidance Automation Toolkit 96 + *.gpState 97 + 98 + # ReSharper is a .NET coding add-in 99 + _ReSharper*/ 100 + *.[Rr]e[Ss]harper 101 + *.DotSettings.user 102 + 103 + # JustCode is a .NET coding add-in 104 + .JustCode 105 + 106 + # TeamCity is a build add-in 107 + _TeamCity* 108 + 109 + # DotCover is a Code Coverage Tool 110 + *.dotCover 111 + 112 + # NCrunch 113 + _NCrunch_* 114 + .*crunch*.local.xml 115 + nCrunchTemp_* 116 + 117 + # MightyMoose 118 + *.mm.* 119 + AutoTest.Net/ 120 + 121 + # Web workbench (sass) 122 + .sass-cache/ 123 + 124 + # Installshield output folder 125 + [Ee]xpress/ 126 + 127 + # DocProject is a documentation generator add-in 128 + DocProject/buildhelp/ 129 + DocProject/Help/*.HxT 130 + DocProject/Help/*.HxC 131 + DocProject/Help/*.hhc 132 + DocProject/Help/*.hhk 133 + DocProject/Help/*.hhp 134 + DocProject/Help/Html2 135 + DocProject/Help/html 136 + 137 + # Click-Once directory 138 + publish/ 139 + 140 + # Publish Web Output 141 + *.[Pp]ublish.xml 142 + *.azurePubxml 143 + # TODO: Comment the next line if you want to checkin your web deploy settings 144 + # but database connection strings (with potential passwords) will be unencrypted 145 + *.pubxml 146 + *.publishproj 147 + 148 + # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 + # checkin your Azure Web App publish settings, but sensitive information contained 150 + # in these scripts will be unencrypted 151 + PublishScripts/ 152 + 153 + # NuGet Packages 154 + *.nupkg 155 + # The packages folder can be ignored because of Package Restore 156 + **/packages/* 157 + # except build/, which is used as an MSBuild target. 158 + !**/packages/build/ 159 + # Uncomment if necessary however generally it will be regenerated when needed 160 + #!**/packages/repositories.config 161 + # NuGet v3's project.json files produces more ignoreable files 162 + *.nuget.props 163 + *.nuget.targets 164 + 165 + # Microsoft Azure Build Output 166 + csx/ 167 + *.build.csdef 168 + 169 + # Microsoft Azure Emulator 170 + ecf/ 171 + rcf/ 172 + 173 + # Windows Store app package directories and files 174 + AppPackages/ 175 + BundleArtifacts/ 176 + Package.StoreAssociation.xml 177 + _pkginfo.txt 178 + 179 + # Visual Studio cache files 180 + # files ending in .cache can be ignored 181 + *.[Cc]ache 182 + # but keep track of directories ending in .cache 183 + !*.[Cc]ache/ 184 + 185 + # Others 186 + ClientBin/ 187 + ~$* 188 + *~ 189 + *.dbmdl 190 + *.dbproj.schemaview 191 + *.pfx 192 + *.publishsettings 193 + node_modules/ 194 + orleans.codegen.cs 195 + 196 + # Since there are multiple workflows, uncomment next line to ignore bower_components 197 + # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 + #bower_components/ 199 + 200 + # RIA/Silverlight projects 201 + Generated_Code/ 202 + 203 + # Backup & report files from converting an old project file 204 + # to a newer Visual Studio version. Backup files are not needed, 205 + # because we have git ;-) 206 + _UpgradeReport_Files/ 207 + Backup*/ 208 + UpgradeLog*.XML 209 + UpgradeLog*.htm 210 + 211 + # SQL Server files 212 + *.mdf 213 + *.ldf 214 + 215 + # Business Intelligence projects 216 + *.rdl.data 217 + *.bim.layout 218 + *.bim_*.settings 219 + 220 + # Microsoft Fakes 221 + FakesAssemblies/ 222 + 223 + # GhostDoc plugin setting file 224 + *.GhostDoc.xml 225 + 226 + # Node.js Tools for Visual Studio 227 + .ntvs_analysis.dat 228 + 229 + # Visual Studio 6 build log 230 + *.plg 231 + 232 + # Visual Studio 6 workspace options file 233 + *.opt 234 + 235 + # Visual Studio LightSwitch build output 236 + **/*.HTMLClient/GeneratedArtifacts 237 + **/*.DesktopClient/GeneratedArtifacts 238 + **/*.DesktopClient/ModelManifest.xml 239 + **/*.Server/GeneratedArtifacts 240 + **/*.Server/ModelManifest.xml 241 + _Pvt_Extensions 242 + 243 + # Paket dependency manager 244 + .paket/paket.exe 245 + paket-files/ 246 + 247 + # FAKE - F# Make 248 + .fake/ 249 + 250 + # JetBrains Rider 251 + .idea/ 252 + *.sln.iml 253 + 254 + # ========================= 255 + # Operating System Files 256 + # ========================= 257 + 258 + # OSX 259 + # ========================= 260 + 261 + .DS_Store 262 + .AppleDouble 263 + .LSOverride 264 + 265 + # Thumbnails 266 + ._* 267 + 268 + # Files that might appear in the root of a volume 269 + .DocumentRevisions-V100 270 + .fseventsd 271 + .Spotlight-V100 272 + .TemporaryItems 273 + .Trashes 274 + .VolumeIcon.icns 275 + 276 + # Directories potentially created on remote AFP share 277 + .AppleDB 278 + .AppleDesktop 279 + Network Trash Folder 280 + Temporary Items 281 + .apdisk 282 + 283 + # Windows 284 + # ========================= 285 + 286 + # Windows image file caches 287 + Thumbs.db 288 + ehthumbs.db 289 + 290 + # Folder config file 291 + Desktop.ini 292 + 293 + # Recycle Bin used on file shares 294 + $RECYCLE.BIN/ 295 + 296 + # Windows Installer files 297 + *.cab 298 + *.msi 299 + *.msm 300 + *.msp 301 + 302 + # Windows shortcuts 303 + *.lnk
+5
README.md
··· 1 + # WhiteRose 2 + 3 + ![UNLICENSE](https://cdn.rawgit.com/tomascw/tms-licenses/master/license-UNLICENSE-lightgrey.svg) 4 + 5 + The WhiteRose library is a cross-platform .NET library to build FreeSO update utilities.
+24
UNLICENSE
··· 1 + This is free and unencumbered software released into the public domain. 2 + 3 + Anyone is free to copy, modify, publish, use, compile, sell, or 4 + distribute this software, either in source code form or as a compiled 5 + binary, for any purpose, commercial or non-commercial, and by any 6 + means. 7 + 8 + In jurisdictions that recognize copyright laws, the author or authors 9 + of this software dedicate any and all copyright interest in the 10 + software to the public domain. We make this dedication for the benefit 11 + of the public at large and to the detriment of our heirs and 12 + successors. We intend this dedication to be an overt act of 13 + relinquishment in perpetuity of all present and future rights to this 14 + software under copyright law. 15 + 16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 + OTHER DEALINGS IN THE SOFTWARE. 23 + 24 + For more information, please refer to <http://unlicense.org/>
+23
WhiteRose.sln
··· 1 + 2 + Microsoft Visual Studio Solution File, Format Version 12.00 3 + # Visual Studio 2012 4 + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WhiteRose", "WhiteRose\WhiteRose.csproj", "{F7757A83-3FC4-4F98-B537-A1F08E76471D}" 5 + EndProject 6 + Global 7 + GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 + Debug|Any CPU = Debug|Any CPU 9 + Release|Any CPU = Release|Any CPU 10 + Debug|x64 = Debug|x64 11 + Release|x64 = Release|x64 12 + EndGlobalSection 13 + GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Release|Any CPU.Build.0 = Release|Any CPU 18 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Debug|x64.ActiveCfg = Debug|Any CPU 19 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Debug|x64.Build.0 = Debug|Any CPU 20 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Release|x64.ActiveCfg = Release|Any CPU 21 + {F7757A83-3FC4-4F98-B537-A1F08E76471D}.Release|x64.Build.0 = Release|Any CPU 22 + EndGlobalSection 23 + EndGlobal
+286
WhiteRose/FSO.cs
··· 1 + // This software is under the public domain. See the UNLICENSE file for more details. 2 + 3 + using System; 4 + using System.Diagnostics; 5 + using System.IO; 6 + using Eto.Forms; 7 + using System.Text.RegularExpressions; 8 + using Ionic.Zip; 9 + using System.Net; 10 + using System.Linq; 11 + using System.Text; 12 + using System.Reflection; 13 + 14 + namespace WhiteRose 15 + { 16 + public static class FSO 17 + { 18 + 19 + public static string[] fsoParmas { get; set; } 20 + 21 + public static string libVer = "WhiteRose " + Assembly.GetExecutingAssembly().GetName().Version.ToString(); 22 + 23 + /// <summary> 24 + /// Returns all files by their extensions within the current directory. 25 + /// You only need to type in the name of the extension. 26 + /// </summary> 27 + /// <param name="fileExt"></param> 28 + /// <returns></returns> 29 + public static FileInfo[] FileWildCard(string fileExt) 30 + { 31 + var dir = new DirectoryInfo(Environment.CurrentDirectory); 32 + var files = dir.GetFiles("*." + fileExt.ToLower()).Where(p => p.Extension == "." + fileExt.ToLower()).ToArray(); 33 + return files; 34 + } 35 + 36 + /// <summary> 37 + /// Returns all files by their extensions in the selected directory. 38 + /// </summary> 39 + /// <param name="fileExt"></param> 40 + /// <returns></returns> 41 + public static FileInfo[] FileWildCard(string fileExt, string fileDir) 42 + { 43 + var dir = new DirectoryInfo(fileDir); 44 + var files = dir.GetFiles("*." + fileExt.ToLower()).Where(p => p.Extension == "." + fileExt.ToLower()).ToArray(); 45 + return files; 46 + } 47 + 48 + /// <summary> 49 + /// Returns a given URL. If it isn't there, 50 + /// defualt to Google. 51 + /// </summary> 52 + /// <param name="url"></param> 53 + /// <returns>new Uri(url);</returns> 54 + [Obsolete] 55 + public static Uri WebPage(string url) 56 + { 57 + try { 58 + return new Uri(url); 59 + } 60 + catch { 61 + return new Uri("https://google.com"); 62 + } 63 + } 64 + 65 + /// <summary> 66 + /// 67 + /// </summary> 68 + /// <param name="url"></param> 69 + /// <returns>new Uri(url);</returns> 70 + public static Uri WebURI(string url, string fallback = "https://google.com") 71 + { 72 + try { 73 + return new Uri(url); 74 + } 75 + catch { 76 + return new Uri(fallback); 77 + } 78 + } 79 + 80 + /// <summary> 81 + /// Launches the FreeSO executable with the specified 82 + /// game arguments defined in the application settings. 83 + /// 84 + /// Defualt settings: FSO.IDE.exe must be located in same 85 + /// directory and the game arguments are "800x600 w" 86 + /// </summary> 87 + /// <param name="args"></param> 88 + public static void StartFSO() 89 + { 90 + var fso = Properties.Settings.Default.Client; 91 + var fsoProcess = new Process(); 92 + 93 + if (File.Exists(fso)) 94 + { 95 + fsoProcess.StartInfo.FileName = fso; 96 + fsoProcess.StartInfo.UseShellExecute = true; 97 + fsoProcess.StartInfo.Arguments = Properties.Settings.Default.Args; 98 + fsoProcess.Start(); 99 + } 100 + else { 101 + MessageBox.Show(fso + " not found."); 102 + } 103 + } 104 + 105 + /// <summary> 106 + /// Launches the FreeSO IDE executable with the specified 107 + /// game arguments defined in the application settings. 108 + /// 109 + /// Defualt settings: FSO.IDE.exe must be located in same 110 + /// directory and the game arguments are "800x600 w" 111 + /// </summary> 112 + /// <param name="args"></param> 113 + public static void StartIDE() 114 + { 115 + var ide = Properties.Settings.Default.IDE; 116 + var fsoProcess = new Process(); 117 + 118 + if (File.Exists(ide)) 119 + { 120 + fsoProcess.StartInfo.FileName = ide; 121 + fsoProcess.StartInfo.UseShellExecute = true; 122 + fsoProcess.StartInfo.Arguments = Properties.Settings.Default.Args; 123 + fsoProcess.Start(); 124 + } 125 + else 126 + { 127 + MessageBox.Show(ide + " not found."); 128 + } 129 + } 130 + 131 + /// <summary> 132 + /// Return the latest dist number as a string 133 + /// Thanks to LRB. http://forum.freeso.org/threads/974/ 134 + /// </summary> 135 + /// <returns>sLine</returns> 136 + // TODO: We need a new way to parse HTML files! 137 + public static string DistNumLegacy() 138 + { 139 + string url = "http://servo.freeso.org/externalStatus.html?js=1"; 140 + WebRequest wrGETURL; 141 + wrGETURL = WebRequest.Create(url); 142 + Stream objStream; 143 + objStream = wrGETURL.GetResponse().GetResponseStream(); 144 + var objReader = new StreamReader(objStream); 145 + string sLine = ""; 146 + string fll; 147 + fll = objReader.ReadLine(); 148 + sLine = fll.Remove(0, 855); 149 + sLine = sLine.Remove(sLine.IndexOf("</a>", StringComparison.Ordinal)); 150 + return sLine; 151 + } 152 + 153 + /// <summary> 154 + /// New disNum method. 155 + /// </summary> 156 + /// <returns></returns> 157 + // TODO: Put new HTML parser logic here. Make public afterwords. 158 + static string DistNum() 159 + { 160 + return null; 161 + } 162 + 163 + /// <summary> 164 + /// 165 + /// </summary> 166 + /// <param name="file"></param> 167 + /// <returns></returns> 168 + public static string ReadBuild(string file) 169 + { 170 + string line; 171 + 172 + try { 173 + string buildFile = Environment.CurrentDirectory + @"/" + file; 174 + var fileRead = new StreamReader(buildFile); 175 + while ((line = fileRead.ReadLine()) != null) { 176 + return "#" + line; 177 + } 178 + 179 + fileRead.Close(); 180 + } 181 + catch { 182 + return "NONE"; 183 + } 184 + 185 + return ""; 186 + } 187 + 188 + /// <summary> 189 + /// 190 + /// </summary> 191 + /// <param name="file"></param> 192 + public static void WriteBuild(string file) 193 + { 194 + string buildFile = Environment.CurrentDirectory + @"/" + file; 195 + string localDist = DistNumLegacy(); 196 + 197 + try { 198 + File.WriteAllText(buildFile, localDist); 199 + } 200 + catch (Exception ex) { 201 + MessageBox.Show(ex.Message); 202 + } 203 + } 204 + 205 + #region ZipGC 206 + 207 + /// <summary> 208 + /// Cleans up any ZIP files. 209 + /// </summary> 210 + public static void ZipGC() 211 + { 212 + var files = FileWildCard("zip"); 213 + 214 + foreach (FileInfo file in files) { 215 + try { 216 + file.Attributes = FileAttributes.Normal; 217 + File.Delete(file.FullName); 218 + } 219 + catch (Exception ex) { 220 + Console.WriteLine(ex.Message); 221 + } 222 + } 223 + } 224 + 225 + /// <summary> 226 + /// Detects for any present zips and unpacks them. 227 + /// </summary> 228 + public static void wildUnZip() 229 + { 230 + var dir = new DirectoryInfo(Environment.CurrentDirectory); 231 + var files = dir.GetFiles("*.zip").Where(p => p.Extension == ".zip").ToArray(); 232 + 233 + foreach (FileInfo file in files) { 234 + using (ZipFile zip2 = ZipFile.Read(file.FullName)) { 235 + foreach (ZipEntry ex in zip2) { 236 + ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 237 + } 238 + } 239 + } 240 + } 241 + 242 + public static void distUnZip(string dist) 243 + { 244 + using (ZipFile zip2 = ZipFile.Read(dist)) { 245 + foreach (ZipEntry ex in zip2) { 246 + ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 247 + } 248 + } 249 + } 250 + 251 + #endregion 252 + 253 + /// <summary> 254 + /// 255 + /// </summary> 256 + /// <param name="array"></param> 257 + /// <returns></returns> 258 + public static string ConvertStringArrayToString(string[] array) 259 + { 260 + // 261 + // Concatenate all the elements into a StringBuilder. 262 + // 263 + var builder = new StringBuilder(); 264 + foreach (string value in array) { 265 + builder.Append(value); 266 + builder.Append(' '); 267 + } 268 + return builder.ToString(); 269 + } 270 + 271 + /// <summary> 272 + /// 273 + /// </summary> 274 + /// <param name="array"></param> 275 + /// <returns></returns> 276 + public static string ConvertStringArrayToStringJoin(string[] array) 277 + { 278 + // 279 + // Use string Join to concatenate the string elements. 280 + // 281 + string result = string.Join(".", array); 282 + return result; 283 + } 284 + 285 + } 286 + }
+26
WhiteRose/Properties/AssemblyInfo.cs
··· 1 + using System.Reflection; 2 + using System.Runtime.CompilerServices; 3 + 4 + // Information about this assembly is defined by the following attributes. 5 + // Change them to the values specific to your project. 6 + 7 + [assembly: AssemblyTitle("WhiteRose")] 8 + [assembly: AssemblyDescription("")] 9 + [assembly: AssemblyConfiguration("")] 10 + [assembly: AssemblyCompany("")] 11 + [assembly: AssemblyProduct("")] 12 + [assembly: AssemblyCopyright("(c) Tomas CaseyWilcox")] 13 + [assembly: AssemblyTrademark("")] 14 + [assembly: AssemblyCulture("")] 15 + 16 + // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 + // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 + // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 + 20 + [assembly: AssemblyVersion("1.0.*")] 21 + 22 + // The following attributes are used to specify the signing key for the assembly, 23 + // if desired. See the Mono documentation for more information about signing. 24 + 25 + //[assembly: AssemblyDelaySign(false)] 26 + //[assembly: AssemblyKeyFile("")]
+62
WhiteRose/Properties/Settings.Designer.cs
··· 1 + //------------------------------------------------------------------------------ 2 + // <auto-generated> 3 + // This code was generated by a tool. 4 + // Runtime Version:4.0.30319.42000 5 + // 6 + // Changes to this file may cause incorrect behavior and will be lost if 7 + // the code is regenerated. 8 + // </auto-generated> 9 + //------------------------------------------------------------------------------ 10 + 11 + namespace WhiteRose.Properties { 12 + 13 + 14 + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 + 18 + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 + 20 + public static Settings Default { 21 + get { 22 + return defaultInstance; 23 + } 24 + } 25 + 26 + [global::System.Configuration.UserScopedSettingAttribute()] 27 + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 + [global::System.Configuration.DefaultSettingValueAttribute("FreeSO.exe")] 29 + public string Client { 30 + get { 31 + return ((string)(this["Client"])); 32 + } 33 + set { 34 + this["Client"] = value; 35 + } 36 + } 37 + 38 + [global::System.Configuration.UserScopedSettingAttribute()] 39 + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 + [global::System.Configuration.DefaultSettingValueAttribute("FSO.IDE.exe")] 41 + public string IDE { 42 + get { 43 + return ((string)(this["IDE"])); 44 + } 45 + set { 46 + this["IDE"] = value; 47 + } 48 + } 49 + 50 + [global::System.Configuration.UserScopedSettingAttribute()] 51 + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 + [global::System.Configuration.DefaultSettingValueAttribute("800x600 w")] 53 + public string Args { 54 + get { 55 + return ((string)(this["Args"])); 56 + } 57 + set { 58 + this["Args"] = value; 59 + } 60 + } 61 + } 62 + }
+15
WhiteRose/Properties/Settings.settings
··· 1 + <?xml version='1.0' encoding='utf-8'?> 2 + <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WhiteRose.Properties" GeneratedClassName="Settings"> 3 + <Profiles /> 4 + <Settings> 5 + <Setting Name="Client" Type="System.String" Scope="User"> 6 + <Value Profile="(Default)">FreeSO.exe</Value> 7 + </Setting> 8 + <Setting Name="IDE" Type="System.String" Scope="User"> 9 + <Value Profile="(Default)">FSO.IDE.exe</Value> 10 + </Setting> 11 + <Setting Name="Args" Type="System.String" Scope="User"> 12 + <Value Profile="(Default)">800x600 w</Value> 13 + </Setting> 14 + </Settings> 15 + </SettingsFile>
+158
WhiteRose/TeamCity.cs
··· 1 + // This software is under the public domain. See the UNLICENSE file for more details. 2 + 3 + using Ionic.Zip; 4 + using System; 5 + using System.IO; 6 + using System.Net; 7 + using System.Net.Http; 8 + using System.Text; 9 + using System.Threading.Tasks; 10 + using Eto.Forms; 11 + 12 + namespace WhiteRose 13 + { 14 + public static class TeamCity 15 + { 16 + 17 + public static Uri teamCityDist(string address = "servo.freeso.org", string buildType = "ProjectDollhouse_TsoClient", string buildId = "316") 18 + { 19 + return new Uri(@"http://" + address + @"/repository/download/" + buildType + @"/" + buildId + @":id/dist-" + FSO.DistNumLegacy() + ".zip"); 20 + } 21 + 22 + public static Uri teamCityAddress(string address = "servo.freeso.org", string buildType = "ProjectDollhouse_TsoClient") 23 + { 24 + return new Uri(@"http://" + address + @"/guestAuth/downloadArtifacts.html?buildTypeId=" + buildType + "&buildId=lastSuccessful"); 25 + } 26 + 27 + /// <summary> 28 + /// Downloads and extracts teamcity.zip into the current directory. 29 + /// </summary> 30 + /// <param name="address"></param> 31 + /// <param name="buildType"></param> 32 + /// <param name="distFile"></param> 33 + public static void tcManaged(string address = "servo.freeso.org", string buildType = "ProjectDollhouse_TsoClient", string distFile = "teamcity.zip") 34 + { 35 + try 36 + { 37 + var client = new WebClient(); 38 + 39 + var uri = new Uri(@"http://" + address + @"/guestAuth/downloadArtifacts.html?buildTypeId=" + buildType + "&buildId=lastSuccessful"); 40 + distFile = Path.GetFileName(uri.LocalPath); 41 + 42 + client.DownloadFileAsync(tcAddress(address, buildType), distFile); 43 + 44 + using (ZipFile buildUnpack = ZipFile.Read(distFile)) 45 + { 46 + foreach (ZipEntry ex in buildUnpack) 47 + { 48 + ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 49 + } 50 + } 51 + } 52 + catch (Exception ex) 53 + { 54 + MessageBox.Show(ex.Message); 55 + } 56 + } 57 + 58 + /// <summary> 59 + /// Return the latest dist number as a string 60 + /// Thanks to LRB. http://forum.freeso.org/threads/974/ 61 + /// </summary> 62 + /// <returns>sLine</returns> 63 + public static string distNum() 64 + { 65 + string url = "http://servo.freeso.org/externalStatus.html?js=1"; 66 + WebRequest wrGETURL; 67 + wrGETURL = WebRequest.Create(url); 68 + Stream objStream; 69 + objStream = wrGETURL.GetResponse().GetResponseStream(); 70 + var objReader = new StreamReader(objStream); 71 + string sLine = ""; 72 + string fll; 73 + fll = objReader.ReadLine(); 74 + sLine = fll.Remove(0, 855); 75 + sLine = sLine.Remove(sLine.IndexOf("</a>", StringComparison.Ordinal)); 76 + return sLine; 77 + } 78 + 79 + /// <summary> 80 + /// Html parser version. 81 + /// </summary> 82 + /// <param name="website"></param> 83 + /// <returns></returns> 84 + public static async Task<string> distNum(string website) 85 + { 86 + var http = new HttpClient(); 87 + var reponse = await http.GetByteArrayAsync(website); 88 + String source = Encoding.GetEncoding("dist-").GetString(reponse, 0, reponse.Length - 1); 89 + source = WebUtility.HtmlDecode(source); 90 + // html.HtmlDocument result = new html.HtmlDocument(); 91 + // result.LoadHtml(source); 92 + 93 + // List<html.HtmlNode> title = result.DocumentNode.Descendants(). 94 + return ""; 95 + } 96 + 97 + /// <summary> 98 + /// 99 + /// </summary> 100 + /// <param name="distFile"></param> 101 + public static void tcUnpack(string distFile = "teamcity.zip") 102 + { 103 + using (ZipFile buildUnpack = ZipFile.Read(distFile)) 104 + { 105 + buildUnpack.ExtractAll(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 106 + } 107 + 108 + File.Delete(distFile); 109 + 110 + FSO.wildUnZip(); 111 + 112 + /* using (ZipFile build2Unpack = ZipFile.Read("dist-" + distNum() + ".zip")) 113 + { 114 + build2Unpack.ExtractAll(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 115 + } */ 116 + } 117 + 118 + /// <summary> 119 + /// 120 + /// </summary> 121 + /// <param name="address"></param> 122 + /// <param name="buildType"></param> 123 + /// <param name="distFile"></param> 124 + public static string tcDistFile(string address = "servo.freeso.org", string buildType = "ProjectDollhouse_TsoClient", string distFile = "teamcity.zip") 125 + { 126 + try 127 + { 128 + var uri = new Uri(@"http://" + address + @"/guestAuth/downloadArtifacts.html?buildTypeId=" + buildType + "&buildId=lastSuccessful"); 129 + distFile = Path.GetFileName(uri.LocalPath); 130 + return distFile; 131 + } 132 + catch (Exception ex) 133 + { 134 + MessageBox.Show(ex.Message); 135 + return null; 136 + } 137 + } 138 + 139 + /// <summary> 140 + /// 141 + /// </summary> 142 + /// <param name="address"></param> 143 + /// <param name="buildType"></param> 144 + /// <returns></returns> 145 + public static Uri tcAddress(string address = "servo.freeso.org", string buildType = "ProjectDollhouse_TsoClient") 146 + { 147 + try 148 + { 149 + return new Uri(@"http://" + address + @"/guestAuth/downloadArtifacts.html?buildTypeId=" + buildType + "&buildId=lastSuccessful?guest=1"); 150 + } 151 + catch (Exception ex) 152 + { 153 + MessageBox.Show(ex.Message); 154 + return null; 155 + } 156 + } 157 + } 158 + }
+58
WhiteRose/WhiteRose.csproj
··· 1 + <?xml version="1.0" encoding="utf-8"?> 2 + <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 + <PropertyGroup> 4 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 + <ProjectGuid>{F7757A83-3FC4-4F98-B537-A1F08E76471D}</ProjectGuid> 7 + <OutputType>Library</OutputType> 8 + <RootNamespace>WhiteRose</RootNamespace> 9 + <AssemblyName>WhiteRose</AssemblyName> 10 + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 11 + </PropertyGroup> 12 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 13 + <DebugSymbols>true</DebugSymbols> 14 + <DebugType>full</DebugType> 15 + <Optimize>false</Optimize> 16 + <OutputPath>bin\Debug</OutputPath> 17 + <DefineConstants>DEBUG;</DefineConstants> 18 + <ErrorReport>prompt</ErrorReport> 19 + <WarningLevel>4</WarningLevel> 20 + <ConsolePause>false</ConsolePause> 21 + </PropertyGroup> 22 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 23 + <Optimize>true</Optimize> 24 + <OutputPath>bin\Release</OutputPath> 25 + <ErrorReport>prompt</ErrorReport> 26 + <WarningLevel>4</WarningLevel> 27 + <ConsolePause>false</ConsolePause> 28 + </PropertyGroup> 29 + <ItemGroup> 30 + <Reference Include="System" /> 31 + <Reference Include="Eto"> 32 + <HintPath>..\packages\Eto.Forms.2.3.0\lib\net45\Eto.dll</HintPath> 33 + </Reference> 34 + <Reference Include="DotNetZip"> 35 + <HintPath>..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath> 36 + </Reference> 37 + <Reference Include="System.Net.Http" /> 38 + </ItemGroup> 39 + <ItemGroup> 40 + <Compile Include="Properties\AssemblyInfo.cs" /> 41 + <Compile Include="FSO.cs" /> 42 + <Compile Include="Properties\Settings.Designer.cs"> 43 + <AutoGen>True</AutoGen> 44 + <DesignTimeSharedInput>True</DesignTimeSharedInput> 45 + <DependentUpon>Settings.settings</DependentUpon> 46 + </Compile> 47 + <Compile Include="TeamCity.cs" /> 48 + </ItemGroup> 49 + <ItemGroup> 50 + <None Include="app.config" /> 51 + <None Include="packages.config" /> 52 + <None Include="Properties\Settings.settings"> 53 + <Generator>SettingsSingleFileGenerator</Generator> 54 + <LastGenOutput>Settings.Designer.cs</LastGenOutput> 55 + </None> 56 + </ItemGroup> 57 + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 58 + </Project>
+21
WhiteRose/app.config
··· 1 + <?xml version="1.0" encoding="utf-8" ?> 2 + <configuration> 3 + <configSections> 4 + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 5 + <section name="WhiteRose.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 6 + </sectionGroup> 7 + </configSections> 8 + <userSettings> 9 + <WhiteRose.Properties.Settings> 10 + <setting name="Client" serializeAs="String"> 11 + <value>FreeSO.exe</value> 12 + </setting> 13 + <setting name="IDE" serializeAs="String"> 14 + <value>FSO.IDE.exe</value> 15 + </setting> 16 + <setting name="Args" serializeAs="String"> 17 + <value>800x600 w</value> 18 + </setting> 19 + </WhiteRose.Properties.Settings> 20 + </userSettings> 21 + </configuration>
+5
WhiteRose/packages.config
··· 1 + <?xml version="1.0" encoding="utf-8"?> 2 + <packages> 3 + <package id="DotNetZip" version="1.10.1" targetFramework="net45" /> 4 + <package id="Eto.Forms" version="2.3.0" targetFramework="net45" /> 5 + </packages>