| version 1.5 | | version 1.6 |
|---|
| | |
| #include "args.h" | | #include "args.h" |
| void network_init(void); | | void network_init(void); |
| int get_and_show_netgame_info(ubyte *server, ubyte *node, ubyte *net_address); | | int get_and_show_netgame_info(ubyte *server, ubyte *node, ubyte *net_address); |
| | | //from game.h: |
| | | void show_boxed_message (char *msg); |
| | | void clear_boxed_message (); |
| } | | } |
| | | |
| #include "ip_base.h" | | #include "ip_base.h" |
| | |
| ubyte buf[1500]; | | ubyte buf[1500]; |
| ip_peer *p; | | ip_peer *p; |
| ip_addr addr; | | ip_addr addr; |
| | | int last_hs_count = -1; |
| | | char hs_message[80]; |
| | | |
| if (addr.dns(textaddr,UDP_BASEPORT)) { | | if (addr.dns(textaddr,UDP_BASEPORT)) { |
| nm_messagebox(TXT_ERROR,1,TXT_OK,"Could not resolve address"); | | nm_messagebox(TXT_ERROR,1,TXT_OK,"Could not resolve address"); |
| | |
| // set_hs_state(&hsr->reply,IPHELLO); | | // set_hs_state(&hsr->reply,IPHELLO); |
| // ip_send_handshake(hsr,&hsr->reply); | | // ip_send_handshake(hsr,&hsr->reply); |
| while(hsi->state&STATE_VALID_STATES){ | | while(hsi->state&STATE_VALID_STATES){ |
| | | if (last_hs_count!=hsi->attempts) { |
| | | if (last_hs_count!=-1) |
| | | clear_boxed_message(); |
| | | last_hs_count = hsi->attempts; |
| | | sprintf(hs_message, "sending handshake (#%i)", last_hs_count); |
| | | show_boxed_message(hs_message); |
| | | } |
| r=ipx_get_packet_data(buf); | | r=ipx_get_packet_data(buf); |
| if (r>0) | | if (r>0) |
| mprintf((0,MSGHDR "ip_connect_manual: weird, someone sent us normal data\n")); | | mprintf((0,MSGHDR "ip_connect_manual: weird, someone sent us normal data\n")); |
| if (key_inkey()==KEY_ESC) | | if (key_inkey()==KEY_ESC) { |
| | | clear_boxed_message(); |
| return 0; | | return 0; |
| } | | } |
| | | } |
| | | clear_boxed_message(); |
| if (hsi->state&STATE_ERR) { | | if (hsi->state&STATE_ERR) { |
| nm_messagebox(TXT_ERROR,1,TXT_OK,"handshake timeout"); | | nm_messagebox(TXT_ERROR,1,TXT_OK,"handshake timeout"); |
| return -1; | | return -1; |