Skip to content

Commit 4b50c4b

Browse files
authored
Add check for HostedGames count before displaying "no games" message (CnCNet#867)
1 parent fd02032 commit 4b50c4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ private void GameBroadcastChannel_CTCPReceived(object sender, ChannelCTCPEventAr
15091509
Logger.Log("Ignoring CTCP game message because of an invalid amount of parameters.");
15101510

15111511
// Remind users that the network is good but the client is outdated or newer
1512-
if (lbGameList.Items.Count == 0)
1512+
if (lbGameList.Items.Count == 0 && lbGameList.HostedGames.Count == 0)
15131513
{
15141514
string message = ("There are no games listed but you are indeed connected. The client did receive a game message but can't add it to the list because the message is invalid. " +
15151515
"You can ignore this prompt if there are games listed later. " +
@@ -1563,7 +1563,7 @@ private void GameBroadcastChannel_CTCPReceived(object sender, ChannelCTCPEventAr
15631563
Logger.Log("Ignoring CTCP game message because there are no tunnels at all. Available tunnel count: 0. Is the connection to CnCNet HTTP service broken?");
15641564

15651565
// Remind users that the game is ignored because of no tunnel
1566-
if (lbGameList.Items.Count == 0)
1566+
if (lbGameList.Items.Count == 0 && lbGameList.HostedGames.Count == 0)
15671567
{
15681568
string message = ("There are no games listed. The client did receive a valid game message but can't add it to the list because there are no available tunnels. " +
15691569
"You can ignore this prompt if there are games listed later. Otherwise, it might indicate a network problem to CnCNet HTTP service.").L10N("Client:Main:NoTunnels");
@@ -1585,7 +1585,7 @@ private void GameBroadcastChannel_CTCPReceived(object sender, ChannelCTCPEventAr
15851585
tunnelAddress, tunnelPort, tunnelHandler.Tunnels.Count));
15861586

15871587
// Remind users that the game is ignored because of no specified tunnel
1588-
if (lbGameList.Items.Count == 0)
1588+
if (lbGameList.Items.Count == 0 && lbGameList.HostedGames.Count == 0)
15891589
{
15901590
string message = string.Format(("There are no games listed. The client did receive a valid game message but can't add it to the list because the specified tunnel is not available. " +
15911591
"You can ignore this prompt if there are games listed later. Otherwise, please contact support at {0}.").L10N("Client:Main:NoTunnelForGames"), ClientConfiguration.Instance.LongSupportURL);

0 commit comments

Comments
 (0)