Skip to content

Commit

Permalink
Fixed the issue with the launcher trying to connect indefinetly to a …
Browse files Browse the repository at this point in the history
…lost pub serv. Bella ciao ->1.0.2.1
  • Loading branch information
MaelElseware committed Nov 4, 2018
1 parent 01d2266 commit 3428a69
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
23 changes: 14 additions & 9 deletions NaturalLauncher/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,21 @@ public static void AddToIgnoreList()

internal static void UpdatePubServ(out int publicPlayers, out int maxPlayers)
{

// TO BE CONTINUED but so far we can retrieve pub serv info...
string serverIP = "104.156.251.121"; //public us
int port = 27015;
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(serverIP), port);

var ServInfo = new ServerChecker.A2S_INFO(remoteEP);

publicPlayers = ServInfo.Players; //out
maxPlayers = ServInfo.MaxPlayers; //out
// Check for the launcher to self update
/*
string serverIP = "104.156.251.121"; //public us
int port = 27015;
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(serverIP), port);
var ServInfo = new ServerChecker.A2S_INFO(remoteEP);
publicPlayers = ServInfo.Players; //out
maxPlayers = ServInfo.MaxPlayers; //out
// Check for the launcher to self update
*/ //shit get stuck at trying to connect with the ip.
publicPlayers = 0;
maxPlayers = 0;
}
}
}
4 changes: 2 additions & 2 deletions NaturalLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
<ImageBrush ImageSource="Ressources/pauseimage.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Image Grid.Column="2" Margin="9,20,0,0" Source="Ressources/steam_icon.png" Stretch="Fill" Height="22" VerticalAlignment="Top" HorizontalAlignment="Left" Width="31"/>
<Label x:Name="ServInfoLabel" Content="Public Server :" Grid.Column="2" HorizontalAlignment="Left" Margin="44,18,0,0" VerticalAlignment="Top" Foreground="White" FontFamily="Segoe WP Black" Width="224">
<Image Grid.Column="2" Margin="9,20,0,0" Source="Ressources/steam_icon.png" Stretch="Fill" Height="22" VerticalAlignment="Top" HorizontalAlignment="Left" Width="31" Visibility="Hidden"/>
<Label x:Name="ServInfoLabel" Content="Public Server :" Grid.Column="2" HorizontalAlignment="Left" Margin="44,18,0,0" VerticalAlignment="Top" Foreground="White" FontFamily="Segoe WP Black" Width="224" Visibility="Hidden">
<Label.ContextMenu>
<ContextMenu>
<MenuItem Header="Join the server" Click="JoinPublicServer"/>
Expand Down
2 changes: 1 addition & 1 deletion NaturalLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public MainWindow()

if (SelfUpdater.LaucherRemoteVNumber != SelfUpdater.LaucherLocalVNumber && SelfUpdater.isSelfUpdating)
{
this.Hide();
Hide();
}
else
{
Expand Down
1 change: 1 addition & 0 deletions NaturalLauncher/NaturalLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ConsoleManager.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="LauncherManifest.cs" />
<Compile Include="ManifestBuilder.cs" />
<Compile Include="ProjectSettings.cs" />
Expand Down

0 comments on commit 3428a69

Please sign in to comment.