Skip to content

Commit c049e73

Browse files
committed
Merge pull request #535 from jg18/remove_ipx
Remove IPX support.
2 parents 6c30803 + a05d19d commit c049e73

File tree

14 files changed

+50
-455
lines changed

14 files changed

+50
-455
lines changed

code/menuui/mainhallmenu.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,6 @@ void main_hall_do_multi_ready()
319319
case NETWORK_ERROR_NO_PROTOCOL:
320320
if (Multi_options_g.protocol == NET_TCP) {
321321
popup( PF_USE_AFFIRMATIVE_ICON | PF_NO_NETWORKING, 1, POPUP_OK, XSTR( "TCP/IP protocol not found. This protocol is required for multiplayer FreeSpace.", 1602));
322-
} else {
323-
Assert(Multi_options_g.protocol == NET_IPX);
324-
popup( PF_USE_AFFIRMATIVE_ICON | PF_NO_NETWORKING, 1, POPUP_OK, XSTR( "IPX protocol not found. This protocol is required for multiplayer FreeSpace.", 1603));
325322
}
326323
break;
327324
case NETWORK_ERROR_CONNECT_TO_ISP:
@@ -346,11 +343,6 @@ void main_hall_do_multi_ready()
346343
return;
347344
}
348345

349-
if ((Multi_options_g.protocol == NET_IPX) && !Ipx_active) {
350-
popup( PF_USE_AFFIRMATIVE_ICON | PF_NO_NETWORKING, 1, POPUP_OK, XSTR( "You have selected IPX for multiplayer FreeSpace, but the IPX protocol was not detected on your machine.", 1402));
351-
return;
352-
}
353-
354346
if (error != NETWORK_ERROR_NONE) {
355347
return;
356348
}

code/menuui/optionsmenumulti.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,6 @@ void options_multi_load_protocol_controls()
714714
Om_ip_input.hide();
715715
Om_ip_input.disable();
716716

717-
// disable IPX button in demo
718-
Om_pro_buttons[gr_screen.res][OM_PRO_IPX].button.disable();
719-
Om_pro_buttons[gr_screen.res][OM_PRO_IPX].button.hide();
720-
721717
// bogus control
722718
Om_pro_bogus.base_create(Om_window, UI_KIND_ICON, 0, 0, 0, 0);
723719
}
@@ -887,11 +883,7 @@ void options_multi_protocol_do(int key)
887883
}
888884

889885
// force draw the proper protocol
890-
if (Om_protocol == NET_IPX) {
891-
Om_pro_buttons[gr_screen.res][OM_PRO_IPX].button.draw_forced(2);
892-
} else {
893-
Om_pro_buttons[gr_screen.res][OM_PRO_TCP].button.draw_forced(2);
894-
}
886+
Om_pro_buttons[gr_screen.res][OM_PRO_TCP].button.draw_forced(2);
895887

896888
// force draw the proper tab button
897889
switch (Om_mode) {
@@ -1118,10 +1110,10 @@ void options_multi_protocol_button_pressed(int n)
11181110
gamesnd_play_iface(SND_USER_SELECT);
11191111
break;
11201112

1121-
// ipx mode
1113+
// ipx mode, no longer supported
11221114
case OM_PRO_IPX:
1123-
Om_protocol = NET_IPX;
1124-
gamesnd_play_iface(SND_USER_SELECT);
1115+
gamesnd_play_iface(SND_GENERAL_FAIL);
1116+
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, "The old IPX protocol is no longer supported.");
11251117
break;
11261118
}
11271119
}

code/network/multi.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ int Multi_button_info_ok = 0; // flag saying it is ok to apply critical
101101
int Multi_button_info_id = 0; // identifier of the stored button info to be applying
102102

103103
// low level networking vars
104-
int ADDRESS_LENGTH; // will be 6 for IPX, 4 for IP
105-
int PORT_LENGTH; // will be 2 for IPX, 2 for IP
104+
int ADDRESS_LENGTH;
105+
int PORT_LENGTH;
106106
int HEADER_LENGTH; // 1 byte (packet type)
107107

108108
// misc data
@@ -952,7 +952,6 @@ void multi_process_bigdata(ubyte *data, int len, net_addr *from_addr, int reliab
952952
// store fields that were passed along in the message
953953
// store header information that was captured from the network-layer header
954954
memcpy(header_info.addr, from_addr->addr, 6);
955-
memcpy(header_info.net_id, from_addr->net_id, 4);
956955
header_info.port = from_addr->port;
957956
if(player_num >= 0){
958957
header_info.id = Net_players[player_num].player_id;
@@ -1439,32 +1438,25 @@ void standalone_main_init()
14391438
// multi_options_read_config();
14401439
#ifdef _WIN32
14411440
// if we failed to startup on our desired protocol, fail
1442-
if((Multi_options_g.protocol == NET_IPX) && !Ipx_active){
1443-
MessageBox((HWND)os_get_window(), XSTR( "You have selected IPX for multiplayer FreeSpace, but the IPX protocol was not detected on your machine.", 1402), "Error", MB_OK);
1444-
exit(1);
1445-
}
1446-
if((Multi_options_g.protocol == NET_TCP) && !Tcp_active){
1441+
if ((Multi_options_g.protocol == NET_TCP) && !Tcp_active){
14471442
if (Tcp_failure_code == WSAEADDRINUSE) {
14481443
MessageBox((HWND)os_get_window(), XSTR("You have selected TCP/IP for multiplayer FreeSpace, but the TCP socket is already in use. Check for another instance and/or use the \"-port <port_num>\" command line option to select an available port.", 1620), "Error", MB_OK);
1449-
} else {
1444+
}
1445+
else {
14501446
MessageBox((HWND)os_get_window(), XSTR("You have selected TCP/IP for multiplayer FreeSpace, but the TCP/IP protocol was not detected on your machine.", 362), "Error", MB_OK);
14511447
}
14521448

14531449
exit(1);
14541450
}
14551451
#endif // ifdef _WIN32
14561452

1453+
14571454
// set the protocol
14581455
psnet_use_protocol(Multi_options_g.protocol);
14591456
switch (Multi_options_g.protocol) {
1460-
case NET_IPX:
1461-
ADDRESS_LENGTH = IPX_ADDRESS_LENGTH;
1462-
PORT_LENGTH = IPX_PORT_LENGTH;
1463-
break;
1464-
14651457
case NET_TCP:
1466-
ADDRESS_LENGTH = IP_ADDRESS_LENGTH;
1467-
PORT_LENGTH = IP_PORT_LENGTH;
1458+
ADDRESS_LENGTH = IP_ADDRESS_LENGTH;
1459+
PORT_LENGTH = IP_PORT_LENGTH;
14681460
break;
14691461

14701462
default:

code/network/multi.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ class player;
9292
// low level networking defines
9393
#define IP_ADDRESS_LENGTH 4 // length of the address field for an IP address
9494
#define IP_PORT_LENGTH 2 // length of the port field for an IP address
95-
#define IPX_ADDRESS_LENGTH 6 // length of the address field for an IPX address
96-
#define IPX_PORT_LENGTH 2 // length of the port field for an IPX address
9795

9896
// netgame defines
9997
#define MP_SINGLE_MISSION 0 // not playing a campaign - single mission
@@ -762,8 +760,8 @@ extern int Multi_button_info_ok; // flag saying it is ok to apply criti
762760
extern int Multi_button_info_id; // identifier of the stored button info to be applying
763761

764762
// low level networking vars
765-
extern int ADDRESS_LENGTH; // will be 6 for IPX, 4 for IP
766-
extern int PORT_LENGTH; // will be 2 for IPX, 2 for IP
763+
extern int ADDRESS_LENGTH; // will be 4 for IP
764+
extern int PORT_LENGTH; // will be 2 for IP
767765
extern int HEADER_LENGTH; // 1 byte (packet type)
768766

769767
// misc data

code/network/multi_voice.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,14 +1456,8 @@ int multi_voice_max_chunk_size(int msg_mode)
14561456
header_size += 2; // targeted player's object net_signature
14571457
}
14581458

1459-
// if we're in IPX mode
1460-
if(Psnet_my_addr.type == NET_IPX){
1461-
header_size += 10; // my address (10 bytes in IPX)
1462-
}
1463-
// if we're in TCP mode
1464-
else {
1465-
header_size += 4; // my address (4 bytes in TCP)
1466-
}
1459+
// allocate header space for my address
1460+
header_size += 4; // my address (4 bytes in TCP)
14671461

14681462
// calculate max chunk size
14691463
return (MAX_PACKET_SIZE - // max freespace packet size

code/network/multilag.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef SCP_UNIX
1313

1414
#include <winsock.h>
15-
#include <wsipx.h>
1615

1716
#include "network/multilag.h"
1817
#include "io/timer.h"
@@ -59,8 +58,7 @@ typedef struct lag_buf {
5958
int data_len; // length of the data
6059
uint socket; // this can be either a PSNET_SOCKET or a PSNET_SOCKET_RELIABLE
6160
int stamp; // when this expires, make this packet available
62-
SOCKADDR_IN ip_addr; // ip address when in TCP
63-
SOCKADDR_IPX ipx_addr; // ipx address when in IPX mode
61+
SOCKADDR_IN ip_addr; // ip address
6462

6563
struct lag_buf * prev; // prev in the list
6664
struct lag_buf * next; // next in the list
@@ -172,7 +170,6 @@ int multi_lag_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
172170
char t_buf[1024];
173171
int t_from_len;
174172
SOCKADDR_IN ip_addr;
175-
SOCKADDR_IPX ipx_addr;
176173
int ret_val;
177174
lag_buf *moveup, *item;
178175

@@ -182,18 +179,13 @@ int multi_lag_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
182179

183180
// clear out addresses
184181
memset(&ip_addr, 0, sizeof(SOCKADDR_IN));
185-
memset(&ipx_addr, 0, sizeof(SOCKADDR_IPX));
186182

187183
// if there's data on the socket, read it
188184
if(select(nfds, readfds, writefds, except_fds, timeout)){
189185
// read the data and stuff it
190-
if(Tcp_active){
191-
t_from_len = sizeof(SOCKADDR_IN);
192-
ret_val = recvfrom(readfds->fd_array[0], t_buf, 1024, 0, (SOCKADDR*)&ip_addr, &t_from_len);
193-
} else {
194-
t_from_len = sizeof(SOCKADDR_IPX);
195-
ret_val = recvfrom(readfds->fd_array[0], t_buf, 1024, 0, (SOCKADDR*)&ipx_addr, &t_from_len);
196-
}
186+
Assertion(Tcp_active, "multi_lag_select(): TCP/IP is not active!");
187+
t_from_len = sizeof(SOCKADDR_IN);
188+
ret_val = recvfrom(readfds->fd_array[0], t_buf, 1024, 0, (SOCKADDR*)&ip_addr, &t_from_len);
197189

198190
// wacky socket error
199191
if(ret_val == SOCKET_ERROR){
@@ -209,7 +201,6 @@ int multi_lag_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
209201
memcpy(item->data, t_buf, ret_val);
210202
item->data_len = ret_val;
211203
item->ip_addr = ip_addr;
212-
item->ipx_addr = ipx_addr;
213204
item->socket = readfds->fd_array[0];
214205
item->stamp = timestamp(multi_lag_get_random_lag());
215206
}
@@ -260,11 +251,8 @@ int multi_lag_recvfrom(uint s, char *buf, int len, int flags, struct sockaddr *f
260251
// stuff the data
261252
Assert(item->data_len <= len);
262253
memcpy(buf, item->data, item->data_len);
263-
if(Tcp_active){
264-
memcpy(from, &item->ip_addr, sizeof(SOCKADDR_IN));
265-
} else {
266-
memcpy(from, &item->ipx_addr, sizeof(SOCKADDR_IPX)); //-V512
267-
}
254+
Assertion(Tcp_active, "multi_lag_recvfrom(): TCP/IP is not active!");
255+
memcpy(from, &item->ip_addr, sizeof(SOCKADDR_IN));
268256

269257
// stick the item back on the free list
270258
multi_lag_put_free(item);

code/network/multimsgs.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ void process_join_packet(ubyte* data, header* hinfo)
924924
PACKET_SET_SIZE();
925925

926926
// fill in the address information of where this came from
927-
fill_net_addr(&addr, hinfo->addr, hinfo->net_id, hinfo->port);
927+
fill_net_addr(&addr, hinfo->addr, hinfo->port);
928928

929929
// determine if we should accept this guy, or return a reason we should reject him
930930
// see the DENY_* codes in multi.h
@@ -1104,8 +1104,6 @@ void process_new_player_packet(ubyte* data, header* hinfo)
11041104
}
11051105

11061106
// create the player
1107-
memcpy(new_addr.net_id, Psnet_my_addr.net_id, 4);
1108-
11091107
if(new_flags & NETINFO_FLAG_OBSERVER){
11101108
multi_obs_create_player(new_player_num,new_player_name,&new_addr,&Players[player_num]);
11111109
Net_players[new_player_num].flags |= new_flags;
@@ -1349,7 +1347,7 @@ void process_accept_player_data( ubyte *data, header *hinfo )
13491347

13501348
// also - always set the server address to be where this data came from, NOT from
13511349
// the data in the packet
1352-
fill_net_addr(&Net_players[player_num].p_info.addr, hinfo->addr, hinfo->net_id, hinfo->port);
1350+
fill_net_addr(&Net_players[player_num].p_info.addr, hinfo->addr, hinfo->port);
13531351
}
13541352

13551353
// set the host pointer
@@ -1591,7 +1589,7 @@ void process_accept_packet(ubyte* data, header* hinfo)
15911589
}
15921590

15931591
// fill in the netgame server address
1594-
fill_net_addr( &Netgame.server_addr, hinfo->addr, hinfo->net_id, hinfo->port );
1592+
fill_net_addr( &Netgame.server_addr, hinfo->addr, hinfo->port );
15951593

15961594
// get the skill level setting
15971595
GET_INT(Game_skill_level);
@@ -1941,7 +1939,7 @@ void process_game_active_packet(ubyte* data, header* hinfo)
19411939
active_game ag;
19421940
int modes_compatible = 1;
19431941

1944-
fill_net_addr(&ag.server_addr, hinfo->addr, hinfo->net_id, hinfo->port);
1942+
fill_net_addr(&ag.server_addr, hinfo->addr, hinfo->port);
19451943

19461944
// read this game into a temporary structure
19471945
offset = HEADER_LENGTH;
@@ -2199,7 +2197,7 @@ void process_netgame_descript_packet( ubyte *data, header *hinfo )
21992197
char mission_desc[MISSION_DESC_LENGTH+2];
22002198
net_addr addr;
22012199

2202-
fill_net_addr(&addr, hinfo->addr, hinfo->net_id, hinfo->port);
2200+
fill_net_addr(&addr, hinfo->addr, hinfo->port);
22032201

22042202
// read this game into a temporary structure
22052203
offset = HEADER_LENGTH;
@@ -2232,7 +2230,7 @@ void process_netgame_descript_packet( ubyte *data, header *hinfo )
22322230
PACKET_SET_SIZE();
22332231
}
22342232

2235-
// broadcast a query for active games. IPX will use net broadcast and TCP will either request from the MT or from the specified list
2233+
// broadcast a query for active games. TCP will either request from the MT or from the specified list
22362234
void broadcast_game_query()
22372235
{
22382236
int packet_size;
@@ -2256,7 +2254,7 @@ void broadcast_game_query()
22562254
} while(s_moveup != Game_server_head);
22572255
}
22582256

2259-
fill_net_addr(&addr, Psnet_my_addr.addr, Psnet_my_addr.net_id, DEFAULT_GAME_PORT);
2257+
fill_net_addr(&addr, Psnet_my_addr.addr, DEFAULT_GAME_PORT);
22602258

22612259
// send out a broadcast if our options allow us
22622260
if(Net_player->p_info.options.flags & MLO_FLAG_LOCAL_BROADCAST){
@@ -2286,7 +2284,7 @@ void process_game_query(ubyte* data, header* hinfo)
22862284
PACKET_SET_SIZE();
22872285

22882286
// check to be sure that we don't capture our own broadcast message
2289-
fill_net_addr(&addr, hinfo->addr, hinfo->net_id, hinfo->port);
2287+
fill_net_addr(&addr, hinfo->addr, hinfo->port);
22902288
if ( psnet_same( &addr, &Psnet_my_addr) ){
22912289
return;
22922290
}
@@ -3474,7 +3472,7 @@ void process_ping_packet(ubyte *data, header *hinfo)
34743472
PACKET_SET_SIZE();
34753473

34763474
// get the address to return the pong to
3477-
fill_net_addr(&addr, hinfo->addr, hinfo->net_id, hinfo->port);
3475+
fill_net_addr(&addr, hinfo->addr, hinfo->port);
34783476

34793477
// send the pong
34803478
send_pong(&addr);
@@ -3490,7 +3488,7 @@ void process_pong_packet(ubyte *data, header *hinfo)
34903488

34913489
offset = HEADER_LENGTH;
34923490

3493-
fill_net_addr(&addr, hinfo->addr, hinfo->net_id, hinfo->port);
3491+
fill_net_addr(&addr, hinfo->addr, hinfo->port);
34943492

34953493
PACKET_SET_SIZE();
34963494

code/network/multimsgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void send_mission_log_packet( int entry );
300300
// send a mission message packet
301301
void send_mission_message_packet(int id, char *who_from, int priority, int timing, int source, int builtin_type, int multi_target, int multi_team_filter, int delay = 0);
302302

303-
// broadcast a query for active games. IPX will use net broadcast and TCP will either request from the MT or from the specified list
303+
// broadcast a query for active games. TCP will either request from the MT or from the specified list
304304
void broadcast_game_query();
305305

306306
// send an individual query to an address to see if there is an active game

code/network/multiui.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,6 @@ void multi_join_game_init()
824824
Assert( Net_player != NULL );
825825

826826
switch (Multi_options_g.protocol) {
827-
case NET_IPX:
828-
ADDRESS_LENGTH = IPX_ADDRESS_LENGTH;
829-
PORT_LENGTH = IPX_PORT_LENGTH;
830-
break;
831-
832827
case NET_TCP:
833828
ADDRESS_LENGTH = IP_ADDRESS_LENGTH;
834829
PORT_LENGTH = IP_PORT_LENGTH;
@@ -2077,17 +2072,7 @@ int multi_join_warn_pxo()
20772072
void multi_join_blit_protocol()
20782073
{
20792074
gr_set_color_fast(&Color_bright);
2080-
2081-
switch(Socket_type){
2082-
case NET_TCP:
2083-
// straight TCP
2084-
gr_string(5, 2, "TCP", GR_RESIZE_MENU);
2085-
break;
2086-
2087-
case NET_IPX:
2088-
gr_string(5, 2, "IPX", GR_RESIZE_MENU);
2089-
break;
2090-
}
2075+
gr_string(5, 2, "TCP", GR_RESIZE_MENU);
20912076
}
20922077

20932078

0 commit comments

Comments
 (0)