Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion patcher/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ obj
/.idea/.idea.HitmanPatcher/.idea/riderMarkupCache.xml
*.suo
*.user
/Publish
/Publish
3 changes: 1 addition & 2 deletions patcher/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
87 changes: 60 additions & 27 deletions patcher/CliLocale.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions patcher/GameServer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HitmanPatcher
{
public class GameServer
{
public string ServerName { get; set; }
public string ServerAddress { get; set; }

public static void SaveServers(string path, GameServer[] servers)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (GameServer server in servers)
{
stringBuilder.Append(server.ServerName.Replace(";","-") + ";" + server.ServerAddress.Replace(";", "-") + '\n');
}
File.WriteAllText(path, stringBuilder.ToString().Trim());
}

public static GameServer[] LoadServers(string path)
{
if (File.Exists(path))
{
var serversString = File.ReadAllText(path).Trim();
List<GameServer> servers = new List<GameServer>();
foreach (var line in serversString.Split( '\n'))
{
var serverString = line.Split(';');
var server = new GameServer();
server.ServerName = serverString[0];
server.ServerAddress = serverString[1];
servers.Add(server);
}
return servers.ToArray();
}
else
{
throw new FileNotFoundException(path);
}

}
}

}
22 changes: 12 additions & 10 deletions patcher/HitmanPatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
Expand All @@ -40,7 +38,6 @@
<AssemblyFileVersionSettings>None.None.None.Increment</AssemblyFileVersionSettings>
<LangVersion>8</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
Expand All @@ -51,7 +48,6 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;PLATFORM_STEAM;PLATFORM_EPIC</DefineConstants>
Expand All @@ -62,14 +58,13 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

<PropertyGroup>
<ApplicationIcon>patcher.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -79,14 +74,14 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup>
<Compile Include="Cli.cs" />
<Compile Include="CliLocale.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CliLocale.resx</DependentUpon>
</Compile>
<Compile Include="GameServer.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -119,6 +114,12 @@
<Compile Include="PatchDefinitions\v3_70.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerListEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ServerListEditor.Designer.cs">
<DependentUpon>ServerListEditor.cs</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
<Compile Include="TrayOptionsForm.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -148,6 +149,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="ServerListEditor.resx">
<DependentUpon>ServerListEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TrayOptionsForm.resx">
<LastGenOutput>TrayOptionsForm.Designer.cs</LastGenOutput>
</EmbeddedResource>
Expand All @@ -167,11 +171,9 @@
<Compile Include="AOBScanner.cs" />
<Compile Include="Pinvoke.cs" />
</ItemGroup>

<ItemGroup>
<None Include="App.config" />
<Content Include="patcher.ico" />
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
Loading