Skip to content

Commit f486686

Browse files
committed
Fixes Run Game button
1 parent ffbdff5 commit f486686

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

LanPartyTool/LanPartyTool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
</PropertyGroup>
8787
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote Debug|AnyCPU'">
8888
<DebugSymbols>true</DebugSymbols>
89-
<OutputPath>R:\</OutputPath>
89+
<OutputPath>W:\</OutputPath>
9090
<DefineConstants>DEBUG;TRACE</DefineConstants>
9191
<DebugType>full</DebugType>
9292
<PlatformTarget>x86</PlatformTarget>

LanPartyTool/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

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

22-
[assembly: AssemblyVersion("0.9.30.105")]
23-
[assembly: AssemblyFileVersion("0.9.30.105")]
22+
[assembly: AssemblyVersion("0.9.31.0")]
23+
[assembly: AssemblyFileVersion("0.9.31.0")]
2424

2525
[assembly: XmlConfigurator(ConfigFile = "log4net.config")]
2626
[assembly: Guid("94403695-D3D3-4A0C-A7A8-A8B9FAAF5E9B")]

LanPartyTool/windows/MainWindow.xaml.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.IO.Ports;
77
using System.Net;
8+
using System.Net.Sockets;
89
using System.Threading;
910
using System.Windows;
1011
using System.Windows.Controls;
@@ -256,12 +257,26 @@ private void ShowCodKeyButton_Click(object sender, RoutedEventArgs e)
256257

257258
private void RunGameButton_Click(object sender, RoutedEventArgs e)
258259
{
259-
LaunchServer();
260+
LaunchGameClient();
260261
}
261262

262-
private void LaunchServer()
263+
private void LaunchGameClient()
263264
{
264-
var addresses = Dns.GetHostAddresses(_config.ServerUrl);
265+
var serverUri = new Uri(_config.ServerUrl);
266+
var host = serverUri.Host;
267+
268+
IPAddress[] addresses;
269+
270+
try
271+
{
272+
addresses = Dns.GetHostAddresses(host);
273+
}
274+
catch (SocketException)
275+
{
276+
Logger.Error($"Unable to resolve {host}");
277+
return;
278+
}
279+
265280
var serverAddress = addresses[0].ToString();
266281

267282
var arguments = " +connect " + serverAddress;

0 commit comments

Comments
 (0)