Skip to content

Commit

Permalink
Fixes Run Game button
Browse files Browse the repository at this point in the history
  • Loading branch information
sardylan committed Aug 8, 2020
1 parent ffbdff5 commit f486686
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LanPartyTool/LanPartyTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>R:\</OutputPath>
<OutputPath>W:\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
Expand Down
4 changes: 2 additions & 2 deletions LanPartyTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

[assembly: AssemblyVersion("0.9.30.105")]
[assembly: AssemblyFileVersion("0.9.30.105")]
[assembly: AssemblyVersion("0.9.31.0")]
[assembly: AssemblyFileVersion("0.9.31.0")]

[assembly: XmlConfigurator(ConfigFile = "log4net.config")]
[assembly: Guid("94403695-D3D3-4A0C-A7A8-A8B9FAAF5E9B")]
Expand Down
21 changes: 18 additions & 3 deletions LanPartyTool/windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.IO.Ports;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -256,12 +257,26 @@ private void ShowCodKeyButton_Click(object sender, RoutedEventArgs e)

private void RunGameButton_Click(object sender, RoutedEventArgs e)
{
LaunchServer();
LaunchGameClient();
}

private void LaunchServer()
private void LaunchGameClient()
{
var addresses = Dns.GetHostAddresses(_config.ServerUrl);
var serverUri = new Uri(_config.ServerUrl);
var host = serverUri.Host;

IPAddress[] addresses;

try
{
addresses = Dns.GetHostAddresses(host);
}
catch (SocketException)
{
Logger.Error($"Unable to resolve {host}");
return;
}

var serverAddress = addresses[0].ToString();

var arguments = " +connect " + serverAddress;
Expand Down

0 comments on commit f486686

Please sign in to comment.