Compare commits

...

9 commits

17 changed files with 987 additions and 412 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
.vs/ .vs/
packages/

Binary file not shown.

View file

@ -1,34 +1,46 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio Version 16
VisualStudioVersion = 14.0.23107.0 VisualStudioVersion = 16.0.32901.82
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSLauncher", "PSLauncher\PSLauncher.csproj", "{0D6A691E-95FE-4056-8979-190A9A35BDC7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSLauncher", "PSLauncher\PSLauncher.csproj", "{0D6A691E-95FE-4056-8979-190A9A35BDC7}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
LiveSupport|Any CPU = LiveSupport|Any CPU LiveSupport|Any CPU = LiveSupport|Any CPU
LiveSupport|x64 = LiveSupport|x64
LiveSupport|x86 = LiveSupport|x86 LiveSupport|x86 = LiveSupport|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x64.ActiveCfg = Debug|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x64.Build.0 = Debug|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x86.ActiveCfg = Debug|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x86.ActiveCfg = Debug|x86
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x86.Build.0 = Debug|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Debug|x86.Build.0 = Debug|x86
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|Any CPU.ActiveCfg = LiveSupport|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|Any CPU.ActiveCfg = LiveSupport|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|Any CPU.Build.0 = LiveSupport|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|Any CPU.Build.0 = LiveSupport|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x64.ActiveCfg = LiveSupport|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x64.Build.0 = LiveSupport|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x86.ActiveCfg = LiveSupport|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x86.ActiveCfg = LiveSupport|x86
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x86.Build.0 = LiveSupport|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.LiveSupport|x86.Build.0 = LiveSupport|x86
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|Any CPU.Build.0 = Release|Any CPU {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|Any CPU.Build.0 = Release|Any CPU
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x64.ActiveCfg = Release|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x64.Build.0 = Release|x64
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x86.ActiveCfg = Release|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x86.ActiveCfg = Release|x86
{0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x86.Build.0 = Release|x86 {0D6A691E-95FE-4056-8979-190A9A35BDC7}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92FA1014-24E9-4E6D-A263-B80A2AD72F3C}
EndGlobalSection
EndGlobal EndGlobal

View file

@ -31,16 +31,16 @@ namespace PSLauncher
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion; string version = fvi.FileVersion;
string contents = "# FILE AUTOGENERATED BY PSForever Launcher " + version + "\n"; string contents = "# FILE AUTOGENERATED BY PSForever Launcher " + version + Environment.NewLine;
contents += "[network]\n"; contents += "[network]" + Environment.NewLine;
for(int i = 0; i < entries.Count; i++) for(int i = 0; i < entries.Count; i++)
{ {
ServerEntry entry = entries[i]; ServerEntry entry = entries[i];
contents += "# Name: " + entry.name + "\n"; contents += "# Name: " + entry.name + Environment.NewLine;
// we only want login0 to be used, but have the rest written there for manual editing as well // we only want login0 to be used, but have the rest written there for manual editing as well
contents += String.Format("{3}login{0}={1}:{2}\n", i, entry.hostname, entry.port, contents += String.Format("{3}login{0}={1}:{2}" + Environment.NewLine, i, entry.hostname, entry.port,
i == 0 ? "" : "#"); i == 0 ? "" : "#");
} }

View file

@ -187,7 +187,7 @@
this.launchGame.TabIndex = 2; this.launchGame.TabIndex = 2;
this.launchGame.Text = "Launch"; this.launchGame.Text = "Launch";
this.launchGame.UseVisualStyleBackColor = false; this.launchGame.UseVisualStyleBackColor = false;
this.launchGame.Click += new System.EventHandler(this.button2_Click); this.launchGame.Click += new System.EventHandler(this.launchGame_Click);
// //
// launchMessage // launchMessage
// //
@ -204,7 +204,7 @@
// //
this.spinner.Enabled = false; this.spinner.Enabled = false;
this.spinner.Image = ((System.Drawing.Image)(resources.GetObject("spinner.Image"))); this.spinner.Image = ((System.Drawing.Image)(resources.GetObject("spinner.Image")));
this.spinner.Location = new System.Drawing.Point(114, 67); this.spinner.Location = new System.Drawing.Point(22, 66);
this.spinner.Name = "spinner"; this.spinner.Name = "spinner";
this.spinner.Size = new System.Drawing.Size(26, 24); this.spinner.Size = new System.Drawing.Size(26, 24);
this.spinner.TabIndex = 24; this.spinner.TabIndex = 24;
@ -232,13 +232,13 @@
this.copy, this.copy,
this.saveToFile}); this.saveToFile});
this.outputRightClick.Name = "outputRightClick"; this.outputRightClick.Name = "outputRightClick";
this.outputRightClick.Size = new System.Drawing.Size(165, 70); this.outputRightClick.Size = new System.Drawing.Size(167, 70);
// //
// selectAll // selectAll
// //
this.selectAll.Name = "selectAll"; this.selectAll.Name = "selectAll";
this.selectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.selectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.selectAll.Size = new System.Drawing.Size(164, 22); this.selectAll.Size = new System.Drawing.Size(166, 22);
this.selectAll.Text = "Select All"; this.selectAll.Text = "Select All";
this.selectAll.Click += new System.EventHandler(this.selectAll_Click); this.selectAll.Click += new System.EventHandler(this.selectAll_Click);
// //
@ -247,14 +247,14 @@
this.copy.Name = "copy"; this.copy.Name = "copy";
this.copy.ShortcutKeyDisplayString = ""; this.copy.ShortcutKeyDisplayString = "";
this.copy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.copy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copy.Size = new System.Drawing.Size(164, 22); this.copy.Size = new System.Drawing.Size(166, 22);
this.copy.Text = "Copy"; this.copy.Text = "Copy";
this.copy.Click += new System.EventHandler(this.copy_Click); this.copy.Click += new System.EventHandler(this.copy_Click);
// //
// saveToFile // saveToFile
// //
this.saveToFile.Name = "saveToFile"; this.saveToFile.Name = "saveToFile";
this.saveToFile.Size = new System.Drawing.Size(164, 22); this.saveToFile.Size = new System.Drawing.Size(166, 22);
this.saveToFile.Text = "Save to file ..."; this.saveToFile.Text = "Save to file ...";
this.saveToFile.Click += new System.EventHandler(this.saveToFile_Click); this.saveToFile.Click += new System.EventHandler(this.saveToFile_Click);
// //

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PSLauncher</RootNamespace> <RootNamespace>PSLauncher</RootNamespace>
<AssemblyName>PSForever_Launcher</AssemblyName> <AssemblyName>PSForever_Launcher</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
@ -27,7 +28,7 @@
<UpdateRequired>false</UpdateRequired> <UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.0</ApplicationVersion> <ApplicationVersion>1.3.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
@ -37,19 +38,21 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'LiveSupport|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'LiveSupport|x86'">
<OutputPath>bin\x86\LiveSupport\</OutputPath> <OutputPath>bin\x86\LiveSupport\</OutputPath>
@ -66,6 +69,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -82,11 +86,11 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants> <DefineConstants>TRACE</DefineConstants>
</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>none</DebugType> <DebugType>none</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -100,12 +104,13 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<UseVSHostingProcess>false</UseVSHostingProcess> <UseVSHostingProcess>false</UseVSHostingProcess>
<WarningLevel>0</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode> <CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'LiveSupport|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'LiveSupport|AnyCPU'">
<OutputPath>bin\LiveSupport\</OutputPath> <OutputPath>bin\LiveSupport\</OutputPath>
<DefineConstants>HACKS</DefineConstants> <DefineConstants>TRACE;HACKS</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -118,6 +123,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ManifestCertificateThumbprint>793DD622BA49EF7D3494640F6D9646D8D289304B</ManifestCertificateThumbprint> <ManifestCertificateThumbprint>793DD622BA49EF7D3494640F6D9646D8D289304B</ManifestCertificateThumbprint>
@ -144,14 +150,80 @@
<PropertyGroup> <PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest> <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'LiveSupport|x64'">
<OutputPath>bin\x64\LiveSupport\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<StartupObject>PSLauncher.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" /> <Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" /> <Reference Include="System.DirectoryServices" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Json, Version=7.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.Json.7.0.1\lib\net462\System.Net.Http.Json.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.7.0.3\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
@ -213,6 +285,7 @@
<DependentUpon>SettingsForm.cs</DependentUpon> <DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" /> <None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
@ -225,9 +298,9 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> <BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible> <Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName> <ProductName>Microsoft .NET Framework 4.8 %28x86 und x64%29</ProductName>
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
@ -247,6 +320,88 @@
<ItemGroup> <ItemGroup>
<Content Include="Resources\icon.ico" /> <Content Include="Resources\icon.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PublishFile Include="Microsoft.Bcl.AsyncInterfaces">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Buffers">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Memory">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Numerics.Vectors">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Runtime.CompilerServices.Unsafe">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Text.Encodings.Web">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.Threading.Tasks.Extensions">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="System.ValueTuple">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -1,25 +1,53 @@
using PSLauncher.Properties; using PSLauncher.Properties;
using System; using System;
using System.Collections.Generic; using System.Diagnostics;
using System.Linq; using System.Reflection;
using System.Windows.Forms; using System.Windows.Forms;
namespace PSLauncher namespace PSLauncher
{ {
public enum EHashingAlgoType
{
MD5,
SHA1,
SHA256,
SHA384,
SHA512
}
static class Program static class Program
{ {
public static string launcherVersion;
public static string launcherHash;
public static EHashingAlgoType hashingAlgoType = EHashingAlgoType.SHA1;
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main(string[] args)
{ {
// prepare launcher info
{
var assemblyLocation = Assembly.GetExecutingAssembly().Location;
launcherVersion = FileVersionInfo.GetVersionInfo(assemblyLocation).FileVersion;
launcherHash = Util.CalculateFileHash(assemblyLocation);
}
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Settings.Default.PropertyChanged += Default_PropertyChanged; Settings.Default.PropertyChanged += Default_PropertyChanged;
Application.Run(new LauncherForm()); Application.Run(new LauncherForm());
// check if the launcher was called from the URI psf://
if (args.Length == 2 && args[0] == "--")
{
MessageBox.Show(args[1], args[0]);
}
} }
static void Default_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) static void Default_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)

View file

@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
@ -32,8 +31,8 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")]
// Stamp // Stamp
// [assembly: AssemblyInformationalVersion("%version% [ %branch% @ %shorthash%%haschanges% ]")] // [assembly: AssemblyInformationalVersion("%version% [ %branch% @ %shorthash%%haschanges% ]")]

View file

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // Dieser Code wurde von einem Tool generiert.
// Runtime Version:4.0.30319.42000 // Laufzeitversion:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// the code is regenerated. // der Code erneut generiert wird.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -13,13 +13,13 @@ namespace PSLauncher.Properties {
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// class via a tool like ResGen or Visual Studio. // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// To add or remove a member, edit your .ResX file then rerun ResGen // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// with the /str option, or rebuild your VS project. // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -33,7 +33,7 @@ namespace PSLauncher.Properties {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
@ -47,8 +47,8 @@ namespace PSLauncher.Properties {
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// resource lookups using this strongly typed resource class. /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
@ -61,7 +61,7 @@ namespace PSLauncher.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap vector_logo_psforever { internal static System.Drawing.Bitmap vector_logo_psforever {
get { get {

View file

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // Dieser Code wurde von einem Tool generiert.
// Runtime Version:4.0.30319.42000 // Laufzeitversion:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// the code is regenerated. // der Code erneut generiert wird.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -12,7 +12,7 @@ namespace PSLauncher.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -61,7 +61,7 @@ namespace PSLauncher.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")] [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool SkipLauncher { public bool SkipLauncher {
get { get {
return ((bool)(this["SkipLauncher"])); return ((bool)(this["SkipLauncher"]));
@ -95,20 +95,6 @@ namespace PSLauncher.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
"org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <s" +
"tring>PSForever,play.psforever.net,51000</string>\r\n</ArrayOfString>")]
public global::System.Collections.Specialized.StringCollection ServerList {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["ServerList"]));
}
set {
this["ServerList"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")] [global::System.Configuration.DefaultSettingValueAttribute("True")]
@ -132,5 +118,19 @@ namespace PSLauncher.Properties {
this["ServerSelection"] = value; this["ServerSelection"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
"org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <s" +
"tring>PSForever,play.psforever.net,51000</string>\r\n</ArrayOfString>")]
public global::System.Collections.Specialized.StringCollection ServerList {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["ServerList"]));
}
set {
this["ServerList"] = value;
}
}
} }
} }

View file

@ -12,7 +12,7 @@
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="SkipLauncher" Type="System.Boolean" Scope="User"> <Setting Name="SkipLauncher" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="ClearOutputOnLaunch" Type="System.Boolean" Scope="User"> <Setting Name="ClearOutputOnLaunch" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
@ -20,17 +20,17 @@
<Setting Name="CoreCombat" Type="System.Boolean" Scope="User"> <Setting Name="CoreCombat" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="ServerList" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;string&gt;PSForever,play.psforever.net,51000&lt;/string&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
<Setting Name="GenerateClientINI" Type="System.Boolean" Scope="User"> <Setting Name="GenerateClientINI" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="ServerSelection" Type="System.Int32" Scope="User"> <Setting Name="ServerSelection" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value> <Value Profile="(Default)">0</Value>
</Setting> </Setting>
<Setting Name="ServerList" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;string&gt;PSForever,play.psforever.net,51000&lt;/string&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View file

@ -8,6 +8,7 @@ using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Security.Cryptography;
namespace PSLauncher namespace PSLauncher
{ {
@ -165,6 +166,58 @@ namespace PSLauncher
return Environment.GetEnvironmentVariable("ProgramFiles"); return Environment.GetEnvironmentVariable("ProgramFiles");
} }
public static string CalculateFileHash(string _filePath)
{
using (var hashingAlgorithm = HashAlgorithm.Create(Program.hashingAlgoType.ToString()))
{
using (var fileHandle = File.OpenRead(_filePath))
{
return CalculateFileHash(hashingAlgorithm, fileHandle);
}
}
}
public static string CalculateFileHash(FileStream _fileHandle)
{
using (var hashingAlgorithm = HashAlgorithm.Create(Program.hashingAlgoType.ToString()))
{
return CalculateFileHash(hashingAlgorithm, _fileHandle);
}
}
private static string CalculateFileHash(HashAlgorithm _hashingAlgorithm, FileStream _fileHandle)
{
const int bufferSize = 1 * 1000 * 1000; // 1MB
// read file in bigger buffer to improve hashing performance (slightly)
using (var stream2 = new BufferedStream(_fileHandle, bufferSize))
{
return BitConverter.ToString(_hashingAlgorithm.ComputeHash(stream2)).Replace("-", "").ToLower();
}
}
public static string CalculateStringHash(string _string)
{
using (var hashingAlgorithm = HashAlgorithm.Create(Program.hashingAlgoType.ToString()))
{
return CalculateStringHash(hashingAlgorithm, _string);
}
}
public static string CalculateStringHash(EHashingAlgoType _algoType, string _string)
{
using (var hashingAlgorithm = HashAlgorithm.Create(_algoType.ToString()))
{
return CalculateStringHash(hashingAlgorithm, _string);
}
}
private static string CalculateStringHash(HashAlgorithm _hashAlgorithm, string _string)
{
byte[] stringBytes = System.Text.Encoding.ASCII.GetBytes(_string);
return BitConverter.ToString(_hashAlgorithm.ComputeHash(stringBytes)).Replace("-", "").ToLower();
}
// from https://stackoverflow.com/questions/18726852/redirecting-console-writeline-to-textbox // from https://stackoverflow.com/questions/18726852/redirecting-console-writeline-to-textbox
public class ControlWriter : TextWriter public class ControlWriter : TextWriter
{ {
@ -189,5 +242,15 @@ namespace PSLauncher
get { return Encoding.ASCII; } get { return Encoding.ASCII; }
} }
} }
// https://stackoverflow.com/a/250400
public static DateTime UnixTimestampToDateTime( double unixTimestmap )
{
// Unix timestamp is seconds past epoch
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dateTime = dateTime.AddSeconds(unixTimestmap).ToLocalTime();
return dateTime;
}
} }
} }

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="PSLauncher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="PSLauncher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
@ -17,7 +17,7 @@
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="SkipLauncher" serializeAs="String"> <setting name="SkipLauncher" serializeAs="String">
<value>False</value> <value>True</value>
</setting> </setting>
<setting name="ClearOutputOnLaunch" serializeAs="String"> <setting name="ClearOutputOnLaunch" serializeAs="String">
<value>True</value> <value>True</value>
@ -25,6 +25,12 @@
<setting name="CoreCombat" serializeAs="String"> <setting name="CoreCombat" serializeAs="String">
<value>True</value> <value>True</value>
</setting> </setting>
<setting name="GenerateClientINI" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerSelection" serializeAs="String">
<value>0</value>
</setting>
<setting name="ServerList" serializeAs="Xml"> <setting name="ServerList" serializeAs="Xml">
<value> <value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@ -33,12 +39,19 @@
</ArrayOfString> </ArrayOfString>
</value> </value>
</setting> </setting>
<setting name="GenerateClientINI" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerSelection" serializeAs="String">
<value>0</value>
</setting>
</PSLauncher.Properties.Settings> </PSLauncher.Properties.Settings>
</userSettings> </userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="7.0.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Net.Http.Json" version="7.0.1" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="7.0.0" targetFramework="net48" />
<package id="System.Text.Json" version="7.0.3" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>

View file

@ -1,9 +1,14 @@
PlanetSide 1 GameLauncher PlanetSide 1 GameLauncher
========================= =========================
The frontend C# GUI for a simple PlanetSide 1 (PS1) launcher. The frontend C# GUI for a simple PlanetSide 1 (PS1) launcher.
It automatically rewrites PlanetSide's `client.ini` file to enable users to quickly switch between servers.
Created to assist the [PSForever](http://psforever.net/) project. Created to assist the [PSForever](http://psforever.net/) project.
![Imgur](http://i.imgur.com/122GpvC.png)
![Imgur](http://i.imgur.com/cOF69eO.png)
Notable Features Notable Features
================ ================
* Skip launcher (login through PlanetSide UI) * Skip launcher (login through PlanetSide UI)

42
tools/release.sh Normal file
View file

@ -0,0 +1,42 @@
#!/bin/sh
set -eu
# arg: prompt
ask() {
read -p "$1" choice
}
RELEASE_DIR="../Release"
BIN_DIR="../PSLauncher/bin/Release"
ask "Version: "
VERSION=$choice
echo "Making release for version $VERSION"
OUTPUT_FOLDER="PSForever_Launcher_$VERSION"
OUTPUT_PATH="${RELEASE_DIR}/${OUTPUT_FOLDER}"
mkdir -p ${OUTPUT_PATH}
# Copy files
cp "$BIN_DIR/"*.dll "$BIN_DIR/"*.exe ${OUTPUT_PATH}
cp "../README.md" ${OUTPUT_PATH}
mv "${OUTPUT_PATH}/README.md" "${OUTPUT_PATH}/README.txt"
echo "==== Releasing contents ===="
ls -la ${OUTPUT_PATH}
echo "============================"
# ZIP release
ZIP_FILE="${OUTPUT_FOLDER}.zip"
echo "ZIPing release to ${ZIP_FILE}"
cd ${RELEASE_DIR}
zip -r "${ZIP_FILE}" "${OUTPUT_FOLDER}"
echo "ZIP done"
ls -lh "${ZIP_FILE}"
echo "Release complete!"
exit 0