From 3033cea7b4d19333d4ad24353f7692d46b28a133 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Wed, 30 Jun 2010 15:57:13 +0000 Subject: [PATCH] Always try to open UDP default port when discovering Netgames and give warning if that fails; If entered IP address cannot be resoled, do not warn me twice --- CHANGELOG.txt | 1 + main/net_udp.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 27253bbb7..99363360a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D2X-Rebirth Changelog -------- main/gameseq.c: If multi_level_sync() fails, restart menu music since level music is playing already main/game.c, main/net_ipx.c, main/net_udp.c, main/newmenu.c, main/newmenu.h, main/weapon.c: Removed SurfingNet global and made tabs a parameter of newmenu_dotiny; Same procedure with MenuReordering which is replaced with newmenu_doreorder to set reordering flag specifically +main/net_udp.c: Always try to open UDP default port when discovering Netgames and give warning if that fails; If entered IP address cannot be resoled, do not warn me twice 20100629 -------- diff --git a/main/net_udp.c b/main/net_udp.c index b2fcf89b5..9df1abd75 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -454,7 +454,6 @@ static int manual_join_game_handler(newmenu *menu, d_event *event, manual_join * // Resolve address if (udp_dns_filladdr(mj->addrbuf, atoi(mj->portbuf), &mj->host_addr) < 0) { - nm_messagebox(TXT_ERROR, 1, TXT_OK, "Could not resolve Address!"); return 1; } else @@ -696,6 +695,10 @@ void net_udp_list_join_game() if (udp_open_socket(0, GameArg.MplUdpMyPort != 0?GameArg.MplUdpMyPort:UDP_PORT_DEFAULT) < 0) return; + if (GameArg.MplUdpMyPort != 0) + if (udp_open_socket(1, UDP_PORT_DEFAULT) < 0) + nm_messagebox(TXT_WARNING, 1, TXT_OK, "Cannot open default port!\nYou can only scan for games\nmanually."); + MALLOC(m, newmenu_item, ((UDP_NETGAMES_PPAGE+2)*2)+1); if (!m) return;