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

This commit is contained in:
zicodxx 2010-06-30 15:57:13 +00:00
parent bff24ced0d
commit 07bdbfe610
2 changed files with 5 additions and 1 deletions

View file

@ -4,6 +4,7 @@ D1X-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
--------

View file

@ -430,7 +430,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
@ -672,6 +671,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;